From 8137fba1a7d62ea206ededd8444939b30c2d07b2 Mon Sep 17 00:00:00 2001 From: Ethan Lee <125412902+ethan-tbd@users.noreply.github.com> Date: Wed, 2 Oct 2024 14:34:35 -0700 Subject: [PATCH] chore: update themes (#302) --- .../account/account_balance_card.dart | 2 +- lib/features/account/account_page.dart | 14 +++++----- lib/features/home/home_page.dart | 8 +++--- lib/features/payment/payment_fee_details.dart | 2 +- lib/features/qr/qr_code_page.dart | 10 +++---- lib/features/qr/qr_tabs.dart | 9 +++---- lib/shared/theme/color_scheme.dart | 10 +++---- lib/shared/theme/theme.dart | 20 +++++++------- lib/shared/tile_container.dart | 2 +- pubspec.lock | 26 +++++++++---------- 10 files changed, 50 insertions(+), 53 deletions(-) diff --git a/lib/features/account/account_balance_card.dart b/lib/features/account/account_balance_card.dart index 1f7f7660..e29d186e 100644 --- a/lib/features/account/account_balance_card.dart +++ b/lib/features/account/account_balance_card.dart @@ -44,7 +44,7 @@ class AccountBalanceCard extends HookConsumerWidget { ), child: Container( decoration: BoxDecoration( - color: Theme.of(context).colorScheme.surface, + color: Theme.of(context).colorScheme.surfaceContainer, borderRadius: BorderRadius.circular(Grid.radius), ), padding: const EdgeInsets.all(Grid.xs), diff --git a/lib/features/account/account_page.dart b/lib/features/account/account_page.dart index 5dd7f3f3..65a51e19 100644 --- a/lib/features/account/account_page.dart +++ b/lib/features/account/account_page.dart @@ -78,10 +78,10 @@ class AccountPage extends HookConsumerWidget { decoration: BoxDecoration( shape: BoxShape.circle, border: Border.all( - color: Theme.of(context).colorScheme.surface, + color: Theme.of(context).colorScheme.surfaceContainer, width: Grid.quarter, ), - color: Theme.of(context).colorScheme.background, + color: Theme.of(context).colorScheme.surfaceContainer, ), child: const Center(child: Icon(Icons.person, size: Grid.xl)), ), @@ -147,7 +147,7 @@ class AccountPage extends HookConsumerWidget { width: Grid.md, height: Grid.md, decoration: BoxDecoration( - color: Theme.of(context).colorScheme.surface, + color: Theme.of(context).colorScheme.surfaceContainer, borderRadius: BorderRadius.circular(Grid.xxs), ), child: const Center(child: Icon(Icons.account_balance)), @@ -170,7 +170,7 @@ class AccountPage extends HookConsumerWidget { width: Grid.md, height: Grid.md, decoration: BoxDecoration( - color: Theme.of(context).colorScheme.surface, + color: Theme.of(context).colorScheme.surfaceContainer, borderRadius: BorderRadius.circular(Grid.xxs), ), child: const Center( @@ -230,7 +230,7 @@ class AccountPage extends HookConsumerWidget { width: Grid.md, height: Grid.md, decoration: BoxDecoration( - color: Theme.of(context).colorScheme.surface, + color: Theme.of(context).colorScheme.surfaceContainer, borderRadius: BorderRadius.circular(Grid.xxs), ), child: const Center(child: Icon(Icons.gpp_good)), @@ -253,7 +253,7 @@ class AccountPage extends HookConsumerWidget { width: Grid.md, height: Grid.md, decoration: BoxDecoration( - color: Theme.of(context).colorScheme.surface, + color: Theme.of(context).colorScheme.surfaceContainer, borderRadius: BorderRadius.circular(Grid.xxs), ), child: Center( @@ -310,7 +310,7 @@ class AccountPage extends HookConsumerWidget { await ref.read(featureFlagsProvider.notifier).toggleFlag(flag); }, activeColor: Theme.of(context).colorScheme.tertiary, - trackOutlineColor: MaterialStateProperty.resolveWith( + trackOutlineColor: WidgetStateColor.resolveWith( (_) => Colors.transparent, ), ); diff --git a/lib/features/home/home_page.dart b/lib/features/home/home_page.dart index 113b7329..1b6b287b 100644 --- a/lib/features/home/home_page.dart +++ b/lib/features/home/home_page.dart @@ -26,7 +26,9 @@ class HomePage extends HookConsumerWidget { useEffect( () { Future.delayed( - Duration.zero, () async => _getExchanges(context, ref, exchanges),); + Duration.zero, + () async => _getExchanges(context, ref, exchanges), + ); return null; }, [], @@ -147,7 +149,7 @@ class HomePage extends HookConsumerWidget { const SizedBox(height: Grid.xs), FilledButton( style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( + backgroundColor: WidgetStateProperty.all( Theme.of(context).colorScheme.secondaryContainer, ), ), @@ -186,7 +188,7 @@ class HomePage extends HookConsumerWidget { const SizedBox(height: Grid.xxs), FilledButton( style: ButtonStyle( - backgroundColor: MaterialStateProperty.all( + backgroundColor: WidgetStateProperty.all( Theme.of(context).colorScheme.secondaryContainer, ), ), diff --git a/lib/features/payment/payment_fee_details.dart b/lib/features/payment/payment_fee_details.dart index b32b53e4..a1a1ec55 100644 --- a/lib/features/payment/payment_fee_details.dart +++ b/lib/features/payment/payment_fee_details.dart @@ -25,7 +25,7 @@ class PaymentFeeDetails extends HookWidget { return Container( decoration: BoxDecoration( - color: Theme.of(context).colorScheme.surface, + color: Theme.of(context).colorScheme.surfaceContainer, borderRadius: BorderRadius.circular(15), ), padding: diff --git a/lib/features/qr/qr_code_page.dart b/lib/features/qr/qr_code_page.dart index deca2804..738e6a8a 100644 --- a/lib/features/qr/qr_code_page.dart +++ b/lib/features/qr/qr_code_page.dart @@ -40,10 +40,8 @@ class QrCodePage extends HookConsumerWidget { height: qrSize, decoration: BoxDecoration( border: Border.all( - color: Theme.of(context) - .colorScheme - .onBackground - .withOpacity(0.2), + color: + Theme.of(context).colorScheme.secondary.withOpacity(0.2), ), borderRadius: BorderRadius.circular(Grid.radius), ), @@ -137,10 +135,10 @@ class QrCodePage extends HookConsumerWidget { size: size, eyeStyle: QrEyeStyle( eyeShape: QrEyeShape.square, - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.secondary, ), dataModuleStyle: QrDataModuleStyle( - color: Theme.of(context).colorScheme.onBackground, + color: Theme.of(context).colorScheme.secondary, dataModuleShape: QrDataModuleShape.square, ), ); diff --git a/lib/features/qr/qr_tabs.dart b/lib/features/qr/qr_tabs.dart index 12029ce6..5b279c99 100644 --- a/lib/features/qr/qr_tabs.dart +++ b/lib/features/qr/qr_tabs.dart @@ -37,21 +37,20 @@ class QrTabs extends HookWidget { bottom: Grid.xxl, child: Container( decoration: BoxDecoration( - color: Theme.of(context).colorScheme.surface, + color: Theme.of(context).colorScheme.surfaceContainer, borderRadius: BorderRadius.circular(Grid.radius), ), child: TabBar( controller: tabController, indicator: BoxDecoration( borderRadius: BorderRadius.circular(Grid.radius), - color: Theme.of(context).colorScheme.background, + color: Theme.of(context).colorScheme.surfaceContainer, ), indicatorSize: TabBarIndicatorSize.tab, indicatorPadding: const EdgeInsets.all(Grid.quarter), dividerColor: Colors.transparent, - labelColor: Theme.of(context).colorScheme.onBackground, - unselectedLabelColor: - Theme.of(context).colorScheme.onBackground, + labelColor: Theme.of(context).colorScheme.secondary, + unselectedLabelColor: Theme.of(context).colorScheme.secondary, tabs: [ Tab(text: Loc.of(context).scan), Tab(text: Loc.of(context).myDid), diff --git a/lib/shared/theme/color_scheme.dart b/lib/shared/theme/color_scheme.dart index ad88897a..acfbd827 100644 --- a/lib/shared/theme/color_scheme.dart +++ b/lib/shared/theme/color_scheme.dart @@ -10,9 +10,8 @@ const lightColorScheme = ColorScheme( onTertiary: Color(0xFFFBFBFB), error: Color(0xFF931919), onError: Color(0xFFFBFBFB), - background: Color(0xFFECECEC), - onBackground: Color(0xFF161616), - surface: Color(0xFFFBFBFB), + surfaceContainer: Color(0xFFFBFBFB), + surface: Color(0xFFECECEC), onSurface: Color(0xFF4F4F4F), ); @@ -26,8 +25,7 @@ const darkColorScheme = ColorScheme( onTertiary: Color(0xFF161616), error: Color(0xFFE57373), onError: Color(0xFF161616), - background: Color(0xFF161616), - onBackground: Color(0xFFBDBDBD), - surface: Color(0xFF262626), + surfaceContainer: Color(0xFF262626), + surface: Color(0xFF161616), onSurface: Color(0xFF9C9C9C), ); diff --git a/lib/shared/theme/theme.dart b/lib/shared/theme/theme.dart index 1aa80cea..b28677a3 100644 --- a/lib/shared/theme/theme.dart +++ b/lib/shared/theme/theme.dart @@ -9,18 +9,18 @@ ThemeData lightTheme(BuildContext context) => ThemeData( textTheme: textTheme(ThemeData().textTheme), appBarTheme: AppBarTheme( scrolledUnderElevation: 0, - backgroundColor: lightColorScheme.background, + backgroundColor: lightColorScheme.surface, ), segmentedButtonTheme: SegmentedButtonThemeData( style: ButtonStyle( - backgroundColor: MaterialStateProperty.resolveWith( + backgroundColor: WidgetStateProperty.resolveWith( (states) { - return states.contains(MaterialState.selected) + return states.contains(WidgetState.selected) ? lightColorScheme.secondary : lightColorScheme.onSecondary; }, ), - side: MaterialStateProperty.resolveWith( + side: WidgetStateProperty.resolveWith( (_) { return BorderSide( color: lightColorScheme.secondary, @@ -28,7 +28,7 @@ ThemeData lightTheme(BuildContext context) => ThemeData( ); }, ), - shape: MaterialStateProperty.all( + shape: WidgetStateProperty.all( RoundedRectangleBorder( borderRadius: BorderRadius.circular(Grid.xs), ), @@ -60,18 +60,18 @@ ThemeData darkTheme(BuildContext context) => ThemeData( textTheme: textTheme(ThemeData.dark().textTheme), appBarTheme: AppBarTheme( scrolledUnderElevation: 0, - backgroundColor: darkColorScheme.background, + backgroundColor: darkColorScheme.surface, ), segmentedButtonTheme: SegmentedButtonThemeData( style: ButtonStyle( - backgroundColor: MaterialStateProperty.resolveWith( + backgroundColor: WidgetStateProperty.resolveWith( (states) { - return states.contains(MaterialState.selected) + return states.contains(WidgetState.selected) ? darkColorScheme.secondary : darkColorScheme.onSecondary; }, ), - side: MaterialStateProperty.resolveWith( + side: WidgetStateProperty.resolveWith( (_) { return BorderSide( color: darkColorScheme.secondary, @@ -79,7 +79,7 @@ ThemeData darkTheme(BuildContext context) => ThemeData( ); }, ), - shape: MaterialStateProperty.all( + shape: WidgetStateProperty.all( RoundedRectangleBorder( borderRadius: BorderRadius.circular(Grid.xs), ), diff --git a/lib/shared/tile_container.dart b/lib/shared/tile_container.dart index 64873843..16851920 100644 --- a/lib/shared/tile_container.dart +++ b/lib/shared/tile_container.dart @@ -23,7 +23,7 @@ class TileContainer extends HookWidget { decoration: BoxDecoration( border: Border( bottom: BorderSide( - color: Theme.of(context).colorScheme.surface, + color: Theme.of(context).colorScheme.surfaceContainer, ), ), ), diff --git a/pubspec.lock b/pubspec.lock index 7c1290a1..f4d65da3 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -77,10 +77,10 @@ packages: dependency: "direct main" description: name: collection - sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.19.0" + version: "1.18.0" convert: dependency: transitive description: @@ -442,18 +442,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" url: "https://pub.dev" source: hosted - version: "10.0.7" + version: "10.0.5" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" url: "https://pub.dev" source: hosted - version: "3.0.8" + version: "3.0.5" leak_tracker_testing: dependency: transitive description: @@ -746,7 +746,7 @@ packages: dependency: transitive description: flutter source: sdk - version: "0.0.0" + version: "0.0.99" source_span: dependency: transitive description: @@ -791,10 +791,10 @@ packages: dependency: transitive description: name: string_scanner - sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.2.0" tbdex: dependency: "direct main" description: @@ -816,10 +816,10 @@ packages: dependency: transitive description: name: test_api - sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.7.3" + version: "0.7.2" typed_data: dependency: transitive description: @@ -928,10 +928,10 @@ packages: dependency: transitive description: name: vm_service - sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" url: "https://pub.dev" source: hosted - version: "14.3.0" + version: "14.2.5" web: dependency: transitive description: