From f784af927ab2391fda31e92df27493c7e5ee1dde Mon Sep 17 00:00:00 2001 From: Vadim <44135514+vodemn@users.noreply.github.com> Date: Mon, 6 Jan 2025 15:20:18 +0100 Subject: [PATCH] removed theme deprecations --- lib/res/theme.dart | 6 ++---- .../widget_placeholder_camera_controls.dart | 2 +- .../widget_item_list_exposure_pairs.dart | 6 +++--- .../exposure_pairs_list/widget_list_exposure_pairs.dart | 2 +- .../shared/centered_slider/widget_slider_centered.dart | 2 +- .../shared/icon_placeholder/widget_icon_placeholder.dart | 7 ++----- lib/screens/shared/ruler_slider/widget_slider_ruler.dart | 4 ++-- 7 files changed, 12 insertions(+), 17 deletions(-) diff --git a/lib/res/theme.dart b/lib/res/theme.dart index c0e0a24..0362dac 100644 --- a/lib/res/theme.dart +++ b/lib/res/theme.dart @@ -33,7 +33,7 @@ ThemeData themeFrom(Color primaryColor, Brightness brightness) { elevation: Dimens.elevationLevel0, scrolledUnderElevation: Dimens.elevationLevel2, color: scheme.surface, - foregroundColor: scheme.onBackground, + foregroundColor: scheme.onSurface, surfaceTintColor: scheme.surfaceTint, ), cardTheme: CardTheme( @@ -83,8 +83,6 @@ ColorScheme _colorSchemeFromColor(Color primaryColor, Brightness brightness) { return ColorScheme( brightness: brightness, - background: Color(scheme.background), - onBackground: Color(scheme.onBackground), error: Color(scheme.error), onError: Color(scheme.onError), errorContainer: Color(scheme.errorContainer), @@ -103,7 +101,7 @@ ColorScheme _colorSchemeFromColor(Color primaryColor, Brightness brightness) { onTertiaryContainer: Color(scheme.onTertiaryContainer), surface: Color(scheme.surface), onSurface: Color(scheme.onSurface), - surfaceVariant: Color(scheme.surfaceVariant), + surfaceContainerHighest: Color(scheme.surfaceContainerHighest), onSurfaceVariant: Color(scheme.onSurfaceVariant), outline: Color(scheme.outline), outlineVariant: Color(scheme.outlineVariant), diff --git a/lib/screens/metering/components/camera_container/components/camera_controls_placeholder/widget_placeholder_camera_controls.dart b/lib/screens/metering/components/camera_container/components/camera_controls_placeholder/widget_placeholder_camera_controls.dart index 467a0b1..c2a39bf 100644 --- a/lib/screens/metering/components/camera_container/components/camera_controls_placeholder/widget_placeholder_camera_controls.dart +++ b/lib/screens/metering/components/camera_container/components/camera_controls_placeholder/widget_placeholder_camera_controls.dart @@ -25,7 +25,7 @@ class CameraControlsPlaceholder extends StatelessWidget { const SizedBox(height: Dimens.grid8), Text( error.toStringLocalized(context), - style: Theme.of(context).textTheme.bodyMedium?.copyWith(color: Theme.of(context).colorScheme.onBackground), + style: Theme.of(context).textTheme.bodyMedium?.copyWith(color: Theme.of(context).colorScheme.onSurface), textAlign: TextAlign.center, ), ], diff --git a/lib/screens/metering/components/shared/exposure_pairs_list/components/exposure_pairs_list_item/widget_item_list_exposure_pairs.dart b/lib/screens/metering/components/shared/exposure_pairs_list/components/exposure_pairs_list_item/widget_item_list_exposure_pairs.dart index d4209ba..2451a07 100644 --- a/lib/screens/metering/components/shared/exposure_pairs_list/components/exposure_pairs_list_item/widget_item_list_exposure_pairs.dart +++ b/lib/screens/metering/components/shared/exposure_pairs_list/components/exposure_pairs_list_item/widget_item_list_exposure_pairs.dart @@ -62,14 +62,14 @@ class _Title extends StatelessWidget { value.toString(), stepGranularity: 0.5, minFontSize: 10, - style: labelTextStyle(context).copyWith(color: Theme.of(context).colorScheme.onBackground), + style: labelTextStyle(context).copyWith(color: Theme.of(context).colorScheme.onSurface), softWrap: false, overflow: TextOverflow.fade, maxLines: 1, ) : Text( value.toString(), - style: labelTextStyle(context).copyWith(color: Theme.of(context).colorScheme.onBackground), + style: labelTextStyle(context).copyWith(color: Theme.of(context).colorScheme.onSurface), softWrap: false, overflow: TextOverflow.fade, maxLines: 1, @@ -97,7 +97,7 @@ class _Tick extends StatelessWidget { @override Widget build(BuildContext context) { return ColoredBox( - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.onSurface, child: SizedBox( height: 1, width: _length, diff --git a/lib/screens/metering/components/shared/exposure_pairs_list/widget_list_exposure_pairs.dart b/lib/screens/metering/components/shared/exposure_pairs_list/widget_list_exposure_pairs.dart index 415892d..f5ec902 100644 --- a/lib/screens/metering/components/shared/exposure_pairs_list/widget_list_exposure_pairs.dart +++ b/lib/screens/metering/components/shared/exposure_pairs_list/widget_list_exposure_pairs.dart @@ -78,7 +78,7 @@ class ExposurePairsList extends StatelessWidget { ? constraints.maxHeight / 2 : constraints.maxHeight, child: ColoredBox( - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.onSurface, child: const SizedBox(width: 1), ), ), diff --git a/lib/screens/shared/centered_slider/widget_slider_centered.dart b/lib/screens/shared/centered_slider/widget_slider_centered.dart index f2cc66d..10039c6 100644 --- a/lib/screens/shared/centered_slider/widget_slider_centered.dart +++ b/lib/screens/shared/centered_slider/widget_slider_centered.dart @@ -120,7 +120,7 @@ class _Slider extends StatelessWidget { width: handleDistance + trackThickness, child: ClipRRect( borderRadius: BorderRadius.circular(trackThickness / 2), - child: ColoredBox(color: Theme.of(context).colorScheme.surfaceVariant), + child: ColoredBox(color: Theme.of(context).colorScheme.surfaceContainerHighest), ), ), AnimatedPositioned.fromRect( diff --git a/lib/screens/shared/icon_placeholder/widget_icon_placeholder.dart b/lib/screens/shared/icon_placeholder/widget_icon_placeholder.dart index f11128a..1536f0d 100644 --- a/lib/screens/shared/icon_placeholder/widget_icon_placeholder.dart +++ b/lib/screens/shared/icon_placeholder/widget_icon_placeholder.dart @@ -20,15 +20,12 @@ class IconPlaceholder extends StatelessWidget { children: [ Icon( icon, - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.onSurface, ), const SizedBox(height: Dimens.grid8), Text( text, - style: Theme.of(context) - .textTheme - .bodyMedium - ?.copyWith(color: Theme.of(context).colorScheme.onBackground), + style: Theme.of(context).textTheme.bodyMedium?.copyWith(color: Theme.of(context).colorScheme.onSurface), textAlign: TextAlign.center, ), ], diff --git a/lib/screens/shared/ruler_slider/widget_slider_ruler.dart b/lib/screens/shared/ruler_slider/widget_slider_ruler.dart index 9932ef2..5075597 100644 --- a/lib/screens/shared/ruler_slider/widget_slider_ruler.dart +++ b/lib/screens/shared/ruler_slider/widget_slider_ruler.dart @@ -30,7 +30,7 @@ class RulerSlider extends StatelessWidget { children: [ Text( valueAdapter(value), - style: Theme.of(context).textTheme.labelLarge!.copyWith(color: Theme.of(context).colorScheme.onBackground), + style: Theme.of(context).textTheme.labelLarge!.copyWith(color: Theme.of(context).colorScheme.onSurface), ), const SizedBox(height: Dimens.grid4), Expanded( @@ -78,7 +78,7 @@ class _Ruler extends StatelessWidget { @override Widget build(BuildContext context) { final mainTicksFontSize = Theme.of(context).textTheme.bodySmall!.fontSize!; - final itemsColor = Theme.of(context).colorScheme.onBackground; + final itemsColor = Theme.of(context).colorScheme.onSurface; return LayoutBuilder( builder: (context, constraints) { final bool showAllMainTicks =