From 5bc7d685523a7ca5dd93d121e77b2cd2d7f586f9 Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Tue, 10 Oct 2023 09:55:15 -0400 Subject: [PATCH] cleanup --- lib/pages/main_pager/main_pager.dart | 23 +++++++++++++++-------- lib/tools/radix_generator.dart | 16 +++++++++++----- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/lib/pages/main_pager/main_pager.dart b/lib/pages/main_pager/main_pager.dart index a636ae7..7265285 100644 --- a/lib/pages/main_pager/main_pager.dart +++ b/lib/pages/main_pager/main_pager.dart @@ -154,6 +154,10 @@ class MainPagerState extends ConsumerState Widget _newContactInvitationBottomSheetBuilder( // ignore: prefer_expression_function_bodies BuildContext context) { + final theme = Theme.of(context); + final textTheme = theme.textTheme; + final scale = theme.extension()!; + return KeyboardListener( focusNode: FocusNode(), onKeyEvent: (ke) { @@ -165,37 +169,40 @@ class MainPagerState extends ConsumerState height: 200, child: Column(children: [ Text(translate('accounts_menu.invite_contact'), - style: Theme.of(context).textTheme.titleMedium) + style: textTheme.titleMedium) .paddingAll(8), Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - Column(mainAxisAlignment: MainAxisAlignment.center, children: [ + Column(children: [ IconButton( onPressed: () async { Navigator.pop(context); await SendInviteDialog.show(context); }, iconSize: 64, - icon: const Icon(Icons.contact_page)), + icon: const Icon(Icons.contact_page), + color: scale.primaryScale.background), Text(translate('accounts_menu.create_invite')) ]), - Column(mainAxisAlignment: MainAxisAlignment.center, children: [ + Column(children: [ IconButton( onPressed: () async { Navigator.pop(context); await ScanInviteDialog.show(context); }, iconSize: 64, - icon: const Icon(Icons.qr_code_scanner)), + icon: const Icon(Icons.qr_code_scanner), + color: scale.primaryScale.background), Text(translate('accounts_menu.scan_invite')) ]), - Column(mainAxisAlignment: MainAxisAlignment.center, children: [ + Column(children: [ IconButton( onPressed: () async { Navigator.pop(context); await PasteInviteDialog.show(context); }, iconSize: 64, - icon: const Icon(Icons.paste)), + icon: const Icon(Icons.paste), + color: scale.primaryScale.background), Text(translate('accounts_menu.paste_invite')) ]) ]).expanded() @@ -288,7 +295,7 @@ class MainPagerState extends ConsumerState floatingActionButton: BottomSheetActionButton( shape: const RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(14))), - //foregroundColor: scale.secondaryScale.text, + foregroundColor: scale.secondaryScale.text, backgroundColor: scale.secondaryScale.hoverBorder, builder: (context) => Icon( _fabIconList[_currentPage], diff --git a/lib/tools/radix_generator.dart b/lib/tools/radix_generator.dart index 05f498e..b805374 100644 --- a/lib/tools/radix_generator.dart +++ b/lib/tools/radix_generator.dart @@ -537,9 +537,15 @@ ThemeData radixGenerator(Brightness brightness, RadixThemeColor themeColor) { final colorScheme = _radixColorScheme(brightness, radix); final scaleScheme = radix.toScale(); - return ThemeData.from( - colorScheme: colorScheme, textTheme: textTheme, useMaterial3: true) - .copyWith(extensions: >[ - scaleScheme, - ]); + final themeData = ThemeData.from( + colorScheme: colorScheme, textTheme: textTheme, useMaterial3: true); + return themeData.copyWith( + bottomSheetTheme: themeData.bottomSheetTheme.copyWith( + elevation: 0, + modalElevation: 0, + shape: + RoundedRectangleBorder(borderRadius: BorderRadius.circular(16))), + extensions: >[ + scaleScheme, + ]); }