From bb79edf3968d91db3a12c0be70ac843ab5085646 Mon Sep 17 00:00:00 2001 From: Blazebrain Date: Tue, 1 Sep 2026 10:41:07 +0100 Subject: [PATCH] fix: lint issues --- .../seed/dismiss_seed_verification_page.dart | 76 +++++----- lib/new-ui/pages/seed/pre_seed_page.dart | 137 +++++++++--------- .../pages/seed/seed_backup_reminder_page.dart | 66 ++++----- .../pages/seed/show_keys_disclaimer_page.dart | 68 ++++----- .../seed/skip_seed_verification_page.dart | 85 +++++------ .../widgets/seed/seed_checkbox_row.dart | 101 +++++++------ .../widgets/seed/seed_page_scaffold.dart | 67 +++++---- lib/new-ui/widgets/stacked_buttons.dart | 70 +++++---- 8 files changed, 324 insertions(+), 346 deletions(-) diff --git a/lib/new-ui/pages/seed/dismiss_seed_verification_page.dart b/lib/new-ui/pages/seed/dismiss_seed_verification_page.dart index 765168cd7..79aac5840 100644 --- a/lib/new-ui/pages/seed/dismiss_seed_verification_page.dart +++ b/lib/new-ui/pages/seed/dismiss_seed_verification_page.dart @@ -11,47 +11,43 @@ class DismissSeedVerificationPage extends StatelessWidget { final VoidCallback onConfirm; @override - Widget build(BuildContext context) { - final colors = Theme.of(context).colorScheme; - - return SeedPageScaffold( - content: ConstrainedBox( - constraints: const BoxConstraints(maxWidth: 295), - child: SeedPageHeader( - image: const CakeImageWidget( - imageUrl: "assets/new-ui/warning_triangle.svg", - width: 125, - height: 111.72, - ), - imageSpacing: 48, - titleSpacing: 24, - title: S.of(context).dismiss_verification_title, - description: Text.rich( - TextSpan( - children: [ - TextSpan(text: "${S.of(context).dismiss_verification_description}\n"), - TextSpan( - text: S.of(context).seed_display_path, - style: TextStyle(color: colors.onSurface), - ), - ], + Widget build(BuildContext context) => SeedPageScaffold( + content: ConstrainedBox( + constraints: const BoxConstraints(maxWidth: 295), + child: SeedPageHeader( + image: const CakeImageWidget( + imageUrl: "assets/new-ui/warning_triangle.svg", + width: 125, + height: 111.72, + ), + imageSpacing: 48, + titleSpacing: 24, + title: S.of(context).dismiss_verification_title, + description: Text.rich( + TextSpan( + children: [ + TextSpan(text: "${S.of(context).dismiss_verification_description}\n"), + TextSpan( + text: S.of(context).seed_display_path, + style: TextStyle(color: Theme.of(context).colorScheme.onSurface), + ), + ], + ), + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.bodyMedium?.copyWith( + color: Theme.of(context).colorScheme.onSurfaceVariant, + letterSpacing: -0.07, + ), ), - textAlign: TextAlign.center, - style: Theme.of(context).textTheme.bodyMedium?.copyWith( - color: colors.onSurfaceVariant, - letterSpacing: -0.07, - ), ), ), - ), - footer: StackedButtons( - primaryKey: const ValueKey("dismiss_seed_verification_page_confirm_button_key"), - primaryText: S.of(context).dismiss_verification_confirm, - onPrimary: onConfirm, - secondaryKey: const ValueKey("dismiss_seed_verification_page_back_button_key"), - secondaryText: S.of(context).seed_alert_back, - onSecondary: () => Navigator.of(context).pop(), - ), - ); - } + footer: StackedButtons( + primaryKey: const ValueKey("dismiss_seed_verification_page_confirm_button_key"), + primaryText: S.of(context).dismiss_verification_confirm, + onPrimary: onConfirm, + secondaryKey: const ValueKey("dismiss_seed_verification_page_back_button_key"), + secondaryText: S.of(context).seed_alert_back, + onSecondary: () => Navigator.of(context).pop(), + ), + ); } diff --git a/lib/new-ui/pages/seed/pre_seed_page.dart b/lib/new-ui/pages/seed/pre_seed_page.dart index 67642bea9..04bf20a60 100644 --- a/lib/new-ui/pages/seed/pre_seed_page.dart +++ b/lib/new-ui/pages/seed/pre_seed_page.dart @@ -29,81 +29,76 @@ class _PreSeedPageState extends State { bool get _hasCheckedAll => _understandsOnlyWayToRecover && _willWriteItDown && _willNeverShareIt; @override - Widget build(BuildContext context) { - final colors = Theme.of(context).colorScheme; - final textTheme = Theme.of(context).textTheme; - - return PopScope( - canPop: false, - child: SeedPageScaffold( - content: Column( - mainAxisSize: MainAxisSize.min, - spacing: 24, - children: [ - SeedPageHeader( - image: const SeedHeroImage(), - title: S.of(context).recovery_phrase_intro_title, - description: Text( - S.of(context).recovery_phrase_intro_description, - textAlign: TextAlign.center, - style: textTheme.bodyMedium?.copyWith( - color: colors.onSurfaceVariant, - letterSpacing: -0.07, + Widget build(BuildContext context) => PopScope( + canPop: false, + child: SeedPageScaffold( + content: Column( + mainAxisSize: MainAxisSize.min, + spacing: 24, + children: [ + SeedPageHeader( + image: const SeedHeroImage(), + title: S.of(context).recovery_phrase_intro_title, + description: Text( + S.of(context).recovery_phrase_intro_description, + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.bodyMedium?.copyWith( + color: Theme.of(context).colorScheme.onSurfaceVariant, + letterSpacing: -0.07, + ), ), ), - ), - Column( - spacing: 12, - children: [ - SeedCheckboxRow( - key: const ValueKey("pre_seed_page_only_way_checkbox_key"), - iconPath: "assets/new-ui/key.svg", - text: S.of(context).recovery_phrase_check_only_way, - isChecked: _understandsOnlyWayToRecover, - onChanged: (value) => setState(() => _understandsOnlyWayToRecover = value), - ), - SeedCheckboxRow( - key: const ValueKey("pre_seed_page_write_down_checkbox_key"), - iconPath: "assets/new-ui/set-amount.svg", - text: S.of(context).recovery_phrase_check_write_down, - isChecked: _willWriteItDown, - onChanged: (value) => setState(() => _willWriteItDown = value), - ), - SeedCheckboxRow( - key: const ValueKey("pre_seed_page_never_share_checkbox_key"), - iconPath: "assets/new-ui/visibility.svg", - text: S.of(context).recovery_phrase_check_never_share, - isChecked: _willNeverShareIt, - onChanged: (value) => setState(() => _willNeverShareIt = value), - ), - ], - ), - if (!_hasCheckedAll) - Text( - S.of(context).recovery_phrase_check_all_to_proceed, - textAlign: TextAlign.center, - style: textTheme.bodyMedium?.copyWith( - color: context.customColors.warningOutlineColor, - letterSpacing: -0.07, - ), + Column( + spacing: 12, + children: [ + SeedCheckboxRow( + key: const ValueKey("pre_seed_page_only_way_checkbox_key"), + iconPath: "assets/new-ui/key.svg", + text: S.of(context).recovery_phrase_check_only_way, + isChecked: _understandsOnlyWayToRecover, + onChanged: (value) => setState(() => _understandsOnlyWayToRecover = value), + ), + SeedCheckboxRow( + key: const ValueKey("pre_seed_page_write_down_checkbox_key"), + iconPath: "assets/new-ui/set-amount.svg", + text: S.of(context).recovery_phrase_check_write_down, + isChecked: _willWriteItDown, + onChanged: (value) => setState(() => _willWriteItDown = value), + ), + SeedCheckboxRow( + key: const ValueKey("pre_seed_page_never_share_checkbox_key"), + iconPath: "assets/new-ui/visibility.svg", + text: S.of(context).recovery_phrase_check_never_share, + isChecked: _willNeverShareIt, + onChanged: (value) => setState(() => _willNeverShareIt = value), + ), + ], ), - ], + if (!_hasCheckedAll) + Text( + S.of(context).recovery_phrase_check_all_to_proceed, + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.bodyMedium?.copyWith( + color: context.customColors.warningOutlineColor, + letterSpacing: -0.07, + ), + ), + ], + ), + footer: _hasCheckedAll + ? StackedButtons( + primaryKey: const ValueKey("pre_seed_page_button_key"), + primaryText: S.of(context).show_recovery_phrase, + onPrimary: () => Navigator.of(context).pushNamed(Routes.seed, arguments: true), + secondaryKey: const ValueKey("pre_seed_page_skip_button_key"), + secondaryText: S.of(context).skip_this_step, + onSecondary: _confirmSkip, + secondaryAsLink: true, + ) + : null, + alignTop: true, ), - footer: _hasCheckedAll - ? StackedButtons( - primaryKey: const ValueKey("pre_seed_page_button_key"), - primaryText: S.of(context).show_recovery_phrase, - onPrimary: () => Navigator.of(context).pushNamed(Routes.seed, arguments: true), - secondaryKey: const ValueKey("pre_seed_page_skip_button_key"), - secondaryText: S.of(context).skip_this_step, - onSecondary: _confirmSkip, - secondaryAsLink: true, - ) - : null, - alignTop: true, - ), - ); - } + ); void _confirmSkip() { Navigator.of(context).push( diff --git a/lib/new-ui/pages/seed/seed_backup_reminder_page.dart b/lib/new-ui/pages/seed/seed_backup_reminder_page.dart index d2558ba3f..c7b9fd7bc 100644 --- a/lib/new-ui/pages/seed/seed_backup_reminder_page.dart +++ b/lib/new-ui/pages/seed/seed_backup_reminder_page.dart @@ -21,43 +21,39 @@ class SeedBackupReminderPage extends StatelessWidget { final AuthService authService; @override - Widget build(BuildContext context) { - final colors = Theme.of(context).colorScheme; - - return SeedPageScaffold( - content: SeedPageHeader( - image: const SeedHeroImage(), - title: S.of(context).recovery_phrase_intro_title, - description: Text( - S.of(context).recovery_phrase_intro_description, - textAlign: TextAlign.center, - style: Theme.of(context).textTheme.bodyMedium?.copyWith( - color: colors.onSurfaceVariant, - letterSpacing: -0.07, - ), - ), - ), - footer: StackedButtons( - primaryKey: const ValueKey("seed_backup_reminder_page_button_key"), - primaryText: S.of(context).show_recovery_phrase, - onPrimary: () => authService.authenticateAction( - context, - route: Routes.seed, - arguments: false, - conditionToDetermineIfToUse2FA: - dashboardViewModel.settingsStore.shouldRequireTOTP2FAForAllSecurityAndBackupSettings, - ), - secondaryKey: const ValueKey("seed_backup_reminder_page_dismiss_button_key"), - secondaryText: S.of(context).dismiss_this_step, - onSecondary: () => Navigator.of(context).push( - CupertinoPageRoute( - builder: (_) => DismissSeedVerificationPage(onConfirm: () => _dismiss(context)), + Widget build(BuildContext context) => SeedPageScaffold( + content: SeedPageHeader( + image: const SeedHeroImage(), + title: S.of(context).recovery_phrase_intro_title, + description: Text( + S.of(context).recovery_phrase_intro_description, + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.bodyMedium?.copyWith( + color: Theme.of(context).colorScheme.onSurfaceVariant, + letterSpacing: -0.07, + ), ), ), - secondaryAsLink: true, - ), - ); - } + footer: StackedButtons( + primaryKey: const ValueKey("seed_backup_reminder_page_button_key"), + primaryText: S.of(context).show_recovery_phrase, + onPrimary: () => authService.authenticateAction( + context, + route: Routes.seed, + arguments: false, + conditionToDetermineIfToUse2FA: dashboardViewModel + .settingsStore.shouldRequireTOTP2FAForAllSecurityAndBackupSettings, + ), + secondaryKey: const ValueKey("seed_backup_reminder_page_dismiss_button_key"), + secondaryText: S.of(context).dismiss_this_step, + onSecondary: () => Navigator.of(context).push( + CupertinoPageRoute( + builder: (_) => DismissSeedVerificationPage(onConfirm: () => _dismiss(context)), + ), + ), + secondaryAsLink: true, + ), + ); Future _dismiss(BuildContext context) async { await dashboardViewModel.dismissSeedBackupReminder(); diff --git a/lib/new-ui/pages/seed/show_keys_disclaimer_page.dart b/lib/new-ui/pages/seed/show_keys_disclaimer_page.dart index 4b523a20c..447c58b38 100644 --- a/lib/new-ui/pages/seed/show_keys_disclaimer_page.dart +++ b/lib/new-ui/pages/seed/show_keys_disclaimer_page.dart @@ -20,43 +20,39 @@ class ShowKeysDisclaimerPage extends StatelessWidget { final SettingsStore settingsStore; @override - Widget build(BuildContext context) { - final colors = Theme.of(context).colorScheme; - - return SeedPageScaffold( - content: SeedPageHeader( - image: const SeedHeroImage(showWarningBadge: true), - title: S.of(context).secret_information_ahead, - description: Text.rich( - TextSpan( - children: [ - TextSpan(text: "${S.of(context).secret_information_ahead_description}\n\n"), - TextSpan( - text: S.of(context).secret_information_ahead_warning, - style: TextStyle(color: context.customColors.warningOutlineColor), - ), - ], + Widget build(BuildContext context) => SeedPageScaffold( + content: SeedPageHeader( + image: const SeedHeroImage(showWarningBadge: true), + title: S.of(context).secret_information_ahead, + description: Text.rich( + TextSpan( + children: [ + TextSpan(text: "${S.of(context).secret_information_ahead_description}\n\n"), + TextSpan( + text: S.of(context).secret_information_ahead_warning, + style: TextStyle(color: context.customColors.warningOutlineColor), + ), + ], + ), + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.bodyMedium?.copyWith( + color: Theme.of(context).colorScheme.onSurfaceVariant, + letterSpacing: -0.07, + ), ), - textAlign: TextAlign.center, - style: Theme.of(context).textTheme.bodyMedium?.copyWith( - color: colors.onSurfaceVariant, - letterSpacing: -0.07, - ), ), - ), - footer: StackedButtons( - primaryKey: const ValueKey("show_keys_disclaimer_page_button_key"), - primaryText: S.of(context).show_recovery_phrase_and_keys, - onPrimary: () => authService.authenticateAction( - context, - route: Routes.showKeys, - conditionToDetermineIfToUse2FA: - settingsStore.shouldRequireTOTP2FAForAllSecurityAndBackupSettings, + footer: StackedButtons( + primaryKey: const ValueKey("show_keys_disclaimer_page_button_key"), + primaryText: S.of(context).show_recovery_phrase_and_keys, + onPrimary: () => authService.authenticateAction( + context, + route: Routes.showKeys, + conditionToDetermineIfToUse2FA: + settingsStore.shouldRequireTOTP2FAForAllSecurityAndBackupSettings, + ), + secondaryKey: const ValueKey("show_keys_disclaimer_page_back_button_key"), + secondaryText: S.of(context).seed_alert_back, + onSecondary: () => Navigator.of(context).pop(), ), - secondaryKey: const ValueKey("show_keys_disclaimer_page_back_button_key"), - secondaryText: S.of(context).seed_alert_back, - onSecondary: () => Navigator.of(context).pop(), - ), - ); - } + ); } diff --git a/lib/new-ui/pages/seed/skip_seed_verification_page.dart b/lib/new-ui/pages/seed/skip_seed_verification_page.dart index 8d87601e9..d10a13d1d 100644 --- a/lib/new-ui/pages/seed/skip_seed_verification_page.dart +++ b/lib/new-ui/pages/seed/skip_seed_verification_page.dart @@ -12,53 +12,48 @@ class SkipSeedVerificationPage extends StatelessWidget { final VoidCallback onConfirm; @override - Widget build(BuildContext context) { - final colors = Theme.of(context).colorScheme; - final textTheme = Theme.of(context).textTheme; - - return SeedPageScaffold( - content: ConstrainedBox( - constraints: const BoxConstraints(maxWidth: 295), - child: SeedPageHeader( - image: const CakeImageWidget( - imageUrl: "assets/new-ui/warning_triangle.svg", - width: 125, - height: 111.72, - ), - imageSpacing: 48, - titleSpacing: 24, - title: S.of(context).skip_verification_title, - description: Column( - spacing: 24, - children: [ - Text( - S.of(context).skip_verification_warning, - textAlign: TextAlign.center, - style: textTheme.bodyMedium?.copyWith( - color: context.customColors.warningOutlineColor, - letterSpacing: -0.07, + Widget build(BuildContext context) => SeedPageScaffold( + content: ConstrainedBox( + constraints: const BoxConstraints(maxWidth: 295), + child: SeedPageHeader( + image: const CakeImageWidget( + imageUrl: "assets/new-ui/warning_triangle.svg", + width: 125, + height: 111.72, + ), + imageSpacing: 48, + titleSpacing: 24, + title: S.of(context).skip_verification_title, + description: Column( + spacing: 24, + children: [ + Text( + S.of(context).skip_verification_warning, + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.bodyMedium?.copyWith( + color: context.customColors.warningOutlineColor, + letterSpacing: -0.07, + ), ), - ), - Text( - S.of(context).skip_verification_question, - textAlign: TextAlign.center, - style: textTheme.bodyMedium?.copyWith( - color: colors.onSurfaceVariant, - letterSpacing: -0.07, + Text( + S.of(context).skip_verification_question, + textAlign: TextAlign.center, + style: Theme.of(context).textTheme.bodyMedium?.copyWith( + color: Theme.of(context).colorScheme.onSurfaceVariant, + letterSpacing: -0.07, + ), ), - ), - ], + ], + ), ), ), - ), - footer: StackedButtons( - primaryKey: const ValueKey("skip_seed_verification_page_confirm_button_key"), - primaryText: S.of(context).skip_verification_confirm, - onPrimary: onConfirm, - secondaryKey: const ValueKey("skip_seed_verification_page_back_button_key"), - secondaryText: S.of(context).seed_alert_back, - onSecondary: () => Navigator.of(context).pop(), - ), - ); - } + footer: StackedButtons( + primaryKey: const ValueKey("skip_seed_verification_page_confirm_button_key"), + primaryText: S.of(context).skip_verification_confirm, + onPrimary: onConfirm, + secondaryKey: const ValueKey("skip_seed_verification_page_back_button_key"), + secondaryText: S.of(context).seed_alert_back, + onSecondary: () => Navigator.of(context).pop(), + ), + ); } diff --git a/lib/new-ui/widgets/seed/seed_checkbox_row.dart b/lib/new-ui/widgets/seed/seed_checkbox_row.dart index 9291e9858..2d8c75cc5 100644 --- a/lib/new-ui/widgets/seed/seed_checkbox_row.dart +++ b/lib/new-ui/widgets/seed/seed_checkbox_row.dart @@ -16,57 +16,62 @@ class SeedCheckboxRow extends StatelessWidget { final ValueChanged onChanged; @override - Widget build(BuildContext context) { - final colors = Theme.of(context).colorScheme; - - return MergeSemantics( - child: Semantics( - checked: isChecked, - child: GestureDetector( - behavior: HitTestBehavior.opaque, - onTap: () => onChanged(!isChecked), - child: Container( - padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 16), - decoration: BoxDecoration( - color: colors.surfaceContainer, - borderRadius: BorderRadius.circular(18), - ), - child: Row( - spacing: 12, - children: [ - ExcludeSemantics( - child: CakeImageWidget( - imageUrl: iconPath, - width: 24, - height: 24, - colorFilter: ColorFilter.mode(colors.primary, BlendMode.srcIn), - ), - ), - Expanded( - child: Text( - text, - style: Theme.of(context).textTheme.bodySmall?.copyWith( - color: colors.primary, - letterSpacing: -0.06, - ), - ), - ), - ExcludeSemantics( - child: Container( - width: 24, - height: 24, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: isChecked ? colors.primary : colors.surfaceContainerHighest, + Widget build(BuildContext context) => MergeSemantics( + child: Semantics( + checked: isChecked, + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () => onChanged(!isChecked), + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 16), + decoration: BoxDecoration( + color: Theme.of(context).colorScheme.surfaceContainer, + borderRadius: BorderRadius.circular(18), + ), + child: Row( + spacing: 12, + children: [ + ExcludeSemantics( + child: CakeImageWidget( + imageUrl: iconPath, + width: 24, + height: 24, + colorFilter: + ColorFilter.mode(Theme.of(context).colorScheme.primary, BlendMode.srcIn), ), - child: isChecked ? Icon(Icons.check, size: 16, color: colors.onPrimary) : null, ), - ), - ], + Expanded( + child: Text( + text, + style: Theme.of(context).textTheme.bodySmall?.copyWith( + color: Theme.of(context).colorScheme.primary, + letterSpacing: -0.06, + ), + ), + ), + ExcludeSemantics( + child: Container( + width: 24, + height: 24, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: isChecked + ? Theme.of(context).colorScheme.primary + : Theme.of(context).colorScheme.surfaceContainerHighest, + ), + child: isChecked + ? Icon( + Icons.check, + size: 16, + color: Theme.of(context).colorScheme.onPrimary, + ) + : null, + ), + ), + ], + ), ), ), ), - ), - ); - } + ); } diff --git a/lib/new-ui/widgets/seed/seed_page_scaffold.dart b/lib/new-ui/widgets/seed/seed_page_scaffold.dart index cfdbcfa64..ff4a0434b 100644 --- a/lib/new-ui/widgets/seed/seed_page_scaffold.dart +++ b/lib/new-ui/widgets/seed/seed_page_scaffold.dart @@ -13,46 +13,45 @@ class SeedPageScaffold extends StatelessWidget { final bool alignTop; @override - Widget build(BuildContext context) { - final colors = Theme.of(context).colorScheme; - - return Material( - child: Container( - decoration: BoxDecoration( - gradient: LinearGradient( - colors: [colors.surface, colors.surfaceDim], - begin: Alignment.topCenter, - end: Alignment.bottomCenter, + Widget build(BuildContext context) => Material( + child: Container( + decoration: BoxDecoration( + gradient: LinearGradient( + colors: [ + Theme.of(context).colorScheme.surface, + Theme.of(context).colorScheme.surfaceDim, + ], + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + ), ), - ), - child: SafeArea( - child: Column( - children: [ - Expanded( - child: LayoutBuilder( - builder: (context, constraints) => SingleChildScrollView( - child: ConstrainedBox( - constraints: BoxConstraints(minHeight: constraints.maxHeight), - child: Align( - alignment: alignTop ? Alignment.topCenter : Alignment.center, - child: Padding( - padding: EdgeInsets.fromLTRB(18, alignTop ? 0 : 16, 18, 16), - child: content, + child: SafeArea( + child: Column( + children: [ + Expanded( + child: LayoutBuilder( + builder: (context, constraints) => SingleChildScrollView( + child: ConstrainedBox( + constraints: BoxConstraints(minHeight: constraints.maxHeight), + child: Align( + alignment: alignTop ? Alignment.topCenter : Alignment.center, + child: Padding( + padding: EdgeInsets.fromLTRB(18, alignTop ? 0 : 16, 18, 16), + child: content, + ), ), ), ), ), ), - ), - if (footer != null) - Padding( - padding: const EdgeInsets.fromLTRB(16, 0, 16, 16), - child: footer, - ), - ], + if (footer != null) + Padding( + padding: const EdgeInsets.fromLTRB(16, 0, 16, 16), + child: footer, + ), + ], + ), ), ), - ), - ); - } + ); } diff --git a/lib/new-ui/widgets/stacked_buttons.dart b/lib/new-ui/widgets/stacked_buttons.dart index 0e14e6788..8ba237a63 100644 --- a/lib/new-ui/widgets/stacked_buttons.dart +++ b/lib/new-ui/widgets/stacked_buttons.dart @@ -22,44 +22,40 @@ class StackedButtons extends StatelessWidget { final Key? secondaryKey; @override - Widget build(BuildContext context) { - final colors = Theme.of(context).colorScheme; - - return Column( - mainAxisSize: MainAxisSize.min, - children: [ - NewPrimaryButton( - key: primaryKey, - onPressed: onPrimary, - text: primaryText, - color: colors.primary, - textColor: colors.onPrimary, - ), - if (secondaryAsLink) ...[ - const SizedBox(height: 9), - TextButton( - key: secondaryKey, - onPressed: onSecondary, - style: TextButton.styleFrom(minimumSize: const Size(48, 48)), - child: Text( - secondaryText, - style: Theme.of(context).textTheme.labelLarge?.copyWith( - color: colors.primary, - letterSpacing: -0.07, - ), - ), - ), - ] else ...[ - const SizedBox(height: 12), + Widget build(BuildContext context) => Column( + mainAxisSize: MainAxisSize.min, + children: [ NewPrimaryButton( - key: secondaryKey, - onPressed: onSecondary, - text: secondaryText, - color: colors.surfaceContainer, - textColor: colors.primary, + key: primaryKey, + onPressed: onPrimary, + text: primaryText, + color: Theme.of(context).colorScheme.primary, + textColor: Theme.of(context).colorScheme.onPrimary, ), + if (secondaryAsLink) ...[ + const SizedBox(height: 9), + TextButton( + key: secondaryKey, + onPressed: onSecondary, + style: TextButton.styleFrom(minimumSize: const Size(48, 48)), + child: Text( + secondaryText, + style: Theme.of(context).textTheme.labelLarge?.copyWith( + color: Theme.of(context).colorScheme.primary, + letterSpacing: -0.07, + ), + ), + ), + ] else ...[ + const SizedBox(height: 12), + NewPrimaryButton( + key: secondaryKey, + onPressed: onSecondary, + text: secondaryText, + color: Theme.of(context).colorScheme.surfaceContainer, + textColor: Theme.of(context).colorScheme.primary, + ), + ], ], - ], - ); - } + ); }