What changed, and why it matters
This commit is a routine code cleanup titled "fix: lint issues". It only refactors how theme colors are accessed in several user-interface screens and widgets, switching from a local variable to inline lookups. There is no change to app behavior, security logic, or user-facing functionality.
No security action required. Treat as normal code-quality/lint cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff refactors Dart/Flutter UI code to address lint/style issues. In eight files under lib/new-ui/pages/seed and lib/new-ui/widgets, it replaces local final colors = Theme.of(context).colorScheme; and final textTheme = Theme.of(context).textTheme; variables with inline Theme.of(context).colorScheme.* and Theme.of(context).textTheme.* accesses. It also converts some build methods from block bodies to expression bodies. No logic, authentication, navigation, or seed-handling behavior is altered.
Changed components
lib/new-ui/pages/seed/dismiss_seed_verification_page.dartlib/new-ui/pages/seed/pre_seed_page.dartlib/new-ui/pages/seed/seed_backup_reminder_page.dartlib/new-ui/pages/seed/show_keys_disclaimer_page.dartlib/new-ui/pages/seed/skip_seed_verification_page.dartlib/new-ui/widgets/seed/seed_checkbox_row.dartlib/new-ui/widgets/seed/seed_page_scaffold.dartlib/new-ui/widgets/stacked_buttons.dartInspect captured patch +321 / −343
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 765168cd..79aac584 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 67642bea..04bf20a6 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<PreSeedPage> {
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 d2558ba3..c7b9fd7b 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,
+ 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,
+ ),
+ ),
),
- secondaryKey: const ValueKey("seed_backup_reminder_page_dismiss_button_key"),
- secondaryText: S.of(context).dismiss_this_step,
- onSecondary: () => Navigator.of(context).push(
- CupertinoPageRoute<void>(
- builder: (_) => DismissSeedVerificationPage(onConfirm: () => _dismiss(context)),
+ 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<void>(
+ builder: (_) => DismissSeedVerificationPage(onConfirm: () => _dismiss(context)),
+ ),
+ ),
+ secondaryAsLink: true,
),
- secondaryAsLink: true,
- ),
- );
- }
+ );
Future<void> _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 4b523a20..447c58b3 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 8d87601e..d10a13d1 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 9291e985..2d8c75cc 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<bool> 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),
+ 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),
+ ),
),
- ),
- Expanded(
- child: Text(
- text,
- style: Theme.of(context).textTheme.bodySmall?.copyWith(
- color: colors.primary,
- letterSpacing: -0.06,
- ),
+ 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 ? colors.primary : colors.surfaceContainerHighest,
+ 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,
),
- child: isChecked ? Icon(Icons.check, size: 16, color: colors.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 cfdbcfa6..ff4a0434 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 0e14e678..8ba237a6 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,
+ ),
+ ],
],
- ],
- );
- }
+ );
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.