From 490d101081d2e80e760ef86b94b312a919db6904 Mon Sep 17 00:00:00 2001 From: Payam Zahedi Date: Thu, 27 Jul 2023 14:49:13 +0330 Subject: [PATCH] update theme values --- example/lib/src/core/views/widgets/soon.dart | 6 +++--- example/lib/src/core/views/widgets/toggle.dart | 2 +- .../lib/src/features/home/views/widgets/header.dart | 9 +++------ example/lib/src/theme/theme.dart | 13 +++++++++---- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/example/lib/src/core/views/widgets/soon.dart b/example/lib/src/core/views/widgets/soon.dart index d286f98..b1c98ef 100644 --- a/example/lib/src/core/views/widgets/soon.dart +++ b/example/lib/src/core/views/widgets/soon.dart @@ -12,14 +12,14 @@ class SoonWidget extends StatelessWidget { borderRadius: BorderRadius.circular(10), child: Padding( padding: const EdgeInsets.symmetric( - horizontal: 4, - vertical: 2, + horizontal: 6, + vertical: 3, ), child: Text( 'SOON', style: theme.textTheme.titleSmall?.copyWith( color: theme.colorScheme.onError, - fontSize: 8, + fontSize: 10, fontWeight: FontWeight.w700, height: 1, ), diff --git a/example/lib/src/core/views/widgets/toggle.dart b/example/lib/src/core/views/widgets/toggle.dart index 68a6b16..75050f5 100644 --- a/example/lib/src/core/views/widgets/toggle.dart +++ b/example/lib/src/core/views/widgets/toggle.dart @@ -55,7 +55,7 @@ class RoundToggle extends StatelessWidget { this.backgroundRadius ?? const BorderRadius.all(Radius.circular(8)); final backgroundColor = value - ? enabledTrackColor ?? theme.focusColor + ? enabledTrackColor ?? theme.colorScheme.primary : disabledTrackColor ?? theme.disabledColor; return InkWell( diff --git a/example/lib/src/features/home/views/widgets/header.dart b/example/lib/src/features/home/views/widgets/header.dart index 149600f..be5b602 100644 --- a/example/lib/src/features/home/views/widgets/header.dart +++ b/example/lib/src/features/home/views/widgets/header.dart @@ -4,7 +4,6 @@ import 'package:example/src/features/home/views/ui_states/extra.dart'; import 'package:example/src/features/home/views/widgets/customization_panel.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import 'package:iconsax_flutter/iconsax_flutter.dart'; class ToastHeader extends StatelessWidget { const ToastHeader({super.key}); @@ -79,9 +78,7 @@ class ToastHeader extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ FilledButton( - style: FilledButton.styleFrom( - padding: const EdgeInsets.symmetric(horizontal: 40), - ), + style: FilledButton.styleFrom(), onPressed: () { // TODO: add Make a Random Toast feature }, @@ -92,13 +89,13 @@ class ToastHeader extends StatelessWidget { style: FilledButton.styleFrom( padding: const EdgeInsets.symmetric(horizontal: 16), backgroundColor: theme.colorScheme.secondary, - foregroundColor: theme.colorScheme.onSecondary, + foregroundColor: theme.colorScheme.onBackground, ), onPressed: () { openGithub(context); }, label: const Text('Give a Star'), - icon: const Icon(Iconsax.star_copy, size: 24), + icon: const Icon(Icons.star_rounded, size: 20), ), if (context.isInMobileZone) ...[ const Padding( diff --git a/example/lib/src/theme/theme.dart b/example/lib/src/theme/theme.dart index 680590f..f7d7acf 100644 --- a/example/lib/src/theme/theme.dart +++ b/example/lib/src/theme/theme.dart @@ -1,10 +1,10 @@ import 'package:flutter/material.dart'; -const _primary = Color(0xff605CFF); +const _primary = Color(0xff3F5EFF); const _onPrimary = Color(0xffFFFFFF); const _onPrimaryContainer = Color(0xff303030); const _secondary = Color(0xffFFCE51); -const _onSecondary = Color(0xff000000); +const _onSecondary = Color(0xff474648); const _background = Color(0xffffffff); const _onBackground = Color(0xff000000); const _surface = Color(0xffF4F6F8); @@ -18,7 +18,7 @@ const _outline = Color(0xffF2F2F2); const _tagBackgroundColor = Color(0xffEDFBFE); const _tagTextColor = Color(0xff21C9EE); -const _switchActiveColor = Color(0xff605CFF); +const _switchActiveColor = _primary; const _switchInActiveColor = Color(0xffC5CCD7); const _cardColor = Color(0xffFAFAFA); @@ -58,8 +58,13 @@ ThemeData _themeBuilder() { brightness: Brightness.light, colorScheme: scheme, dividerColor: scheme.outline, + switchTheme: SwitchThemeData( + thumbColor: MaterialStateProperty.all(_switchActiveColor), + trackColor: MaterialStateProperty.all(_switchInActiveColor), + splashRadius: 16, + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + ), disabledColor: _switchInActiveColor, - focusColor: _switchActiveColor, textTheme: textTheme, filledButtonTheme: FilledButtonThemeData( style: FilledButton.styleFrom(