diff --git a/lib/providers/theme_provider.dart b/lib/providers/theme_provider.dart index 8caae68..6a1a47c 100644 --- a/lib/providers/theme_provider.dart +++ b/lib/providers/theme_provider.dart @@ -175,7 +175,11 @@ class _ThemeDataProvider extends StatelessWidget { primaryColor: primaryColor, colorScheme: scheme, dialogBackgroundColor: scheme.surface, - dialogTheme: DialogTheme(backgroundColor: scheme.surface), + dialogTheme: DialogTheme( + backgroundColor: scheme.surface, + surfaceTintColor: scheme.surfaceTint, + elevation: 6, + ), scaffoldBackgroundColor: scheme.surface, ); } diff --git a/lib/screens/metering/components/shared/readings_container/components/animated_dialog_picker/components/animated_dialog/widget_dialog_animated.dart b/lib/screens/metering/components/shared/readings_container/components/animated_dialog_picker/components/animated_dialog/widget_dialog_animated.dart index 820e933..276f83a 100644 --- a/lib/screens/metering/components/shared/readings_container/components/animated_dialog_picker/components/animated_dialog/widget_dialog_animated.dart +++ b/lib/screens/metering/components/shared/readings_container/components/animated_dialog_picker/components/animated_dialog/widget_dialog_animated.dart @@ -35,6 +35,8 @@ class AnimatedDialogState extends State with SingleTickerProvide late final Animation _borderRadiusAnimation; late final Animation _closedOpacityAnimation; late final Animation _openedOpacityAnimation; + late final Animation _foregroundColorAnimation; + late final Animation _elevationAnimation; bool _isDialogShown = false; @@ -112,6 +114,20 @@ class AnimatedDialogState extends State with SingleTickerProvide }); } + @override + void didChangeDependencies() { + super.didChangeDependencies(); + _foregroundColorAnimation = ColorTween( + begin: Theme.of(context).colorScheme.primaryContainer, + end: Theme.of(context).colorScheme.surface, + ).animate(_defaultCurvedAnimation); + + _elevationAnimation = Tween( + begin: 0, + end: Theme.of(context).dialogTheme.elevation!, + ).animate(_defaultCurvedAnimation); + } + @override void dispose() { _animationController.dispose(); @@ -151,6 +167,8 @@ class AnimatedDialogState extends State with SingleTickerProvide sizeAnimation: _sizeAnimation, offsetAnimation: _offsetAnimation, borderRadiusAnimation: _borderRadiusAnimation, + foregroundColorAnimation: _foregroundColorAnimation, + elevationAnimation: _elevationAnimation, onDismiss: close, builder: widget.closedChild != null && widget.openedChild != null ? (_) => _AnimatedSwitcher( @@ -195,6 +213,8 @@ class _AnimatedOverlay extends StatelessWidget { final Animation sizeAnimation; final Animation offsetAnimation; final Animation borderRadiusAnimation; + final Animation foregroundColorAnimation; + final Animation elevationAnimation; final VoidCallback onDismiss; final Widget? child; final Widget Function(BuildContext context)? builder; @@ -205,6 +225,8 @@ class _AnimatedOverlay extends StatelessWidget { required this.sizeAnimation, required this.offsetAnimation, required this.borderRadiusAnimation, + required this.foregroundColorAnimation, + required this.elevationAnimation, required this.onDismiss, this.child, this.builder, @@ -236,7 +258,9 @@ class _AnimatedOverlay extends StatelessWidget { child: ClipRRect( borderRadius: BorderRadius.circular(borderRadiusAnimation.value), child: Material( - color: Theme.of(context).colorScheme.primaryContainer, + elevation: elevationAnimation.value, + surfaceTintColor: Theme.of(context).colorScheme.surfaceTint, + color: foregroundColorAnimation.value, child: builder?.call(context) ?? child, ), ), diff --git a/lib/screens/metering/components/shared/readings_container/components/animated_dialog_picker/components/photography_value_picker_dialog/widget_dialog_picker_photography_value.dart b/lib/screens/metering/components/shared/readings_container/components/animated_dialog_picker/components/photography_value_picker_dialog/widget_dialog_picker_photography_value.dart index 3cb04bc..66cd15b 100644 --- a/lib/screens/metering/components/shared/readings_container/components/animated_dialog_picker/components/photography_value_picker_dialog/widget_dialog_picker_photography_value.dart +++ b/lib/screens/metering/components/shared/readings_container/components/animated_dialog_picker/components/photography_value_picker_dialog/widget_dialog_picker_photography_value.dart @@ -57,37 +57,34 @@ class _PhotographyValuePickerDialogState return Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - ColoredBox( - color: Theme.of(context).colorScheme.primaryContainer, - child: Column( - children: [ - Padding( - padding: const EdgeInsets.fromLTRB( - Dimens.paddingL, - Dimens.paddingL, - Dimens.paddingL, - Dimens.paddingM, - ), - child: Column( - children: [ - Text( - widget.title, - style: Theme.of(context).textTheme.headlineSmall!, - ), - const SizedBox(height: Dimens.grid16), - Text( - widget.subtitle, - style: Theme.of(context).textTheme.bodyMedium!, - ), - ], - ), + Column( + children: [ + Padding( + padding: const EdgeInsets.fromLTRB( + Dimens.paddingL, + Dimens.paddingL, + Dimens.paddingL, + Dimens.paddingM, ), - Divider( - color: Theme.of(context).colorScheme.onPrimaryContainer, - height: 0, + child: Column( + children: [ + Text( + widget.title, + style: Theme.of(context).textTheme.headlineSmall!, + ), + const SizedBox(height: Dimens.grid16), + Text( + widget.subtitle, + style: Theme.of(context).textTheme.bodyMedium!, + ), + ], ), - ], - ), + ), + Divider( + color: Theme.of(context).colorScheme.onSurface, + height: 0, + ), + ], ), Expanded( child: ListView.builder( @@ -117,35 +114,32 @@ class _PhotographyValuePickerDialogState ), ), ), - ColoredBox( - color: Theme.of(context).colorScheme.primaryContainer, - child: Column( - children: [ - Divider( - color: Theme.of(context).colorScheme.onPrimaryContainer, - height: 0, + Column( + children: [ + Divider( + color: Theme.of(context).colorScheme.onSurface, + height: 0, + ), + Padding( + padding: const EdgeInsets.all(Dimens.paddingL), + child: Row( + crossAxisAlignment: CrossAxisAlignment.end, + mainAxisSize: MainAxisSize.max, + children: [ + const Spacer(), + TextButton( + onPressed: widget.onCancel, + child: Text(S.of(context).cancel), + ), + const SizedBox(width: Dimens.grid16), + TextButton( + onPressed: () => widget.onSelect(_selectedValue), + child: Text(S.of(context).select), + ), + ], ), - Padding( - padding: const EdgeInsets.all(Dimens.paddingL), - child: Row( - crossAxisAlignment: CrossAxisAlignment.end, - mainAxisSize: MainAxisSize.max, - children: [ - const Spacer(), - TextButton( - onPressed: widget.onCancel, - child: Text(S.of(context).cancel), - ), - const SizedBox(width: Dimens.grid16), - TextButton( - onPressed: () => widget.onSelect(_selectedValue), - child: Text(S.of(context).select), - ), - ], - ), - ), - ], - ), + ), + ], ), ], ); diff --git a/lib/screens/metering/components/shared/readings_container/components/reading_value_container/widget_container_reading_value.dart b/lib/screens/metering/components/shared/readings_container/components/reading_value_container/widget_container_reading_value.dart index d1c55c7..e973beb 100644 --- a/lib/screens/metering/components/shared/readings_container/components/reading_value_container/widget_container_reading_value.dart +++ b/lib/screens/metering/components/shared/readings_container/components/reading_value_container/widget_container_reading_value.dart @@ -12,10 +12,12 @@ class ReadingValue { } class ReadingValueContainer extends StatelessWidget { + final Color? backgroundColor; late final List _items; ReadingValueContainer({ required List values, + this.backgroundColor, super.key, }) { _items = []; @@ -29,6 +31,7 @@ class ReadingValueContainer extends StatelessWidget { ReadingValueContainer.singleValue({ required ReadingValue value, + this.backgroundColor, super.key, }) : _items = [_ReadingValueBuilder(value)]; @@ -37,7 +40,7 @@ class ReadingValueContainer extends StatelessWidget { return ClipRRect( borderRadius: BorderRadius.circular(Dimens.borderRadiusM), child: ColoredBox( - color: Theme.of(context).colorScheme.primaryContainer, + color: backgroundColor ?? Theme.of(context).colorScheme.primaryContainer, child: Padding( padding: const EdgeInsets.all(Dimens.paddingM), child: Column( diff --git a/lib/screens/metering/components/shared/readings_container/widget_container_readings.dart b/lib/screens/metering/components/shared/readings_container/widget_container_readings.dart index b47817d..28c7028 100644 --- a/lib/screens/metering/components/shared/readings_container/widget_container_readings.dart +++ b/lib/screens/metering/components/shared/readings_container/widget_container_readings.dart @@ -89,6 +89,7 @@ class _IsoValueTile extends StatelessWidget { evDifferenceBuilder: (selected, other) => selected.toStringDifference(other), onChanged: onChanged, closedChild: ReadingValueContainer.singleValue( + backgroundColor: null, value: ReadingValue( label: S.of(context).iso, value: value.value.toString(), @@ -118,6 +119,7 @@ class _NdValueTile extends StatelessWidget { evDifferenceBuilder: (selected, other) => other.toStringDifference(selected), onChanged: onChanged, closedChild: ReadingValueContainer.singleValue( + backgroundColor: null, value: ReadingValue( label: S.of(context).iso, value: value.value.toString(),