From f0ca436f7e7e1def1024312a2276c03b2663e1e1 Mon Sep 17 00:00:00 2001 From: AhsanSarwar45 Date: Tue, 12 Dec 2023 15:15:35 +0500 Subject: [PATCH] Add theme --- lib/common/widgets/customize_screen.dart | 2 +- lib/theme/data/default_color_schemes.dart | 13 +++++++++++++ lib/theme/data/default_style_themes.dart | 12 +++++++++++- lib/theme/slider.dart | 2 +- lib/theme/switch.dart | 4 ++-- 5 files changed, 28 insertions(+), 5 deletions(-) diff --git a/lib/common/widgets/customize_screen.dart b/lib/common/widgets/customize_screen.dart index 0fb0dbe0..394efe82 100644 --- a/lib/common/widgets/customize_screen.dart +++ b/lib/common/widgets/customize_screen.dart @@ -75,7 +75,7 @@ class _CustomizeScreenState context: context, builder: (buildContext) { return AlertDialog( - actionsPadding: const EdgeInsets.only(bottom: 2, right: 2), + actionsPadding: const EdgeInsets.only(bottom: 6, right: 10), content: const Text("Do you want to leave without saving?"), actions: [ TextButton( diff --git a/lib/theme/data/default_color_schemes.dart b/lib/theme/data/default_color_schemes.dart index 4adbd878..7b5f85f1 100644 --- a/lib/theme/data/default_color_schemes.dart +++ b/lib/theme/data/default_color_schemes.dart @@ -45,4 +45,17 @@ List defaultColorSchemes = [ onError: Colors.white, isDefault: true, ), + ColorSchemeData( + name: 'Ocean', + background: const Color.fromARGB(255, 248, 249, 250), + onBackground: const Color.fromARGB(255, 48, 48, 49), + card: const Color.fromARGB(255, 255, 255, 255), + onCard: const Color.fromARGB(255, 48, 48, 49), + accent: const Color.fromARGB(255, 34, 102, 238), + onAccent: const Color.fromARGB(255, 196, 219, 255), + shadow: const Color.fromARGB(255, 0, 0, 0), + outline: const Color.fromARGB(255, 235, 235, 235), + error: const Color(0xFFFE4A49), + onError: Colors.white, + isDefault: true) ]; diff --git a/lib/theme/data/default_style_themes.dart b/lib/theme/data/default_style_themes.dart index 4a8561f8..5c591c7e 100644 --- a/lib/theme/data/default_style_themes.dart +++ b/lib/theme/data/default_style_themes.dart @@ -2,7 +2,7 @@ import 'package:clock_app/theme/types/style_theme.dart'; List defaultStyleThemes = [ StyleTheme( - name: 'Default', + name: 'Paper', shadowElevation: 1, shadowOpacity: 0.2, shadowBlurRadius: 1, @@ -31,4 +31,14 @@ List defaultStyleThemes = [ borderWidth: 0, isDefault: true, ), + StyleTheme( + name: 'Outline', + shadowElevation: 0, + shadowOpacity: 0, + shadowBlurRadius: 0, + shadowSpreadRadius: 0, + borderRadius: 16, + borderWidth: 1, + isDefault: true, + ), ]; diff --git a/lib/theme/slider.dart b/lib/theme/slider.dart index 17c44ece..d53c609d 100644 --- a/lib/theme/slider.dart +++ b/lib/theme/slider.dart @@ -22,7 +22,7 @@ SliderThemeData getSliderTheme(ColorSchemeData colorScheme) { return SliderThemeData( // trackShape: CustomTrackShape(), overlayShape: SliderComponentShape.noOverlay, - inactiveTrackColor: colorScheme.onBackground.withOpacity(0.3) + inactiveTrackColor: colorScheme.onBackground.withOpacity(0.2) // overlayShape: RoundSliderOverlayShape(overlayRadius: 16), ); diff --git a/lib/theme/switch.dart b/lib/theme/switch.dart index b9aff160..0de8dea2 100644 --- a/lib/theme/switch.dart +++ b/lib/theme/switch.dart @@ -8,11 +8,11 @@ SwitchThemeData getSwitchTheme(ColorSchemeData colorScheme) { trackColor: MaterialStateProperty.resolveWith((states) => states.contains(MaterialState.selected) ? colorScheme.accent - : colorScheme.onBackground.withOpacity(0.4)), + : colorScheme.onBackground.withOpacity(0.3)), overlayColor: MaterialStateProperty.resolveWith((states) => states.contains(MaterialState.selected) ? colorScheme.accent - : colorScheme.onBackground.withOpacity(0.4)), + : colorScheme.onBackground.withOpacity(0.3)), trackOutlineColor: MaterialStateProperty.resolveWith((states) => states.contains(MaterialState.selected) ? colorScheme.accent