Improve UI consistency of directory action buttons in Settings screen#626
Improve UI consistency of directory action buttons in Settings screen#626srykaran wants to merge 1 commit intoCCExtractor:mainfrom
Conversation
📝 WalkthroughWalkthroughModified a settings directory selection list tile by converting two TextButtons to styled OutlinedButton and ElevatedButton variants with icons, updated typography using GoogleFonts.poppins, and adjusted spacing and layout properties. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment Tip You can disable poems in the walkthrough.Disable the |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@lib/app/modules/settings/views/settings_page_select_directory_list_tile.dart`:
- Around line 60-63: Replace the force-unwrapped tColors.purpleShade! with a
safe fallback and apply it consistently where button styling uses it (the
OutlinedButton.styleFrom BorderSide and any other places that reference
tColors.purpleShade at the OutlinedButton.icon and the instances around the
other usages). Create a local variable (e.g., final buttonPurple =
tColors.purpleShade ?? fallbackColor) or use the null-coalescing expression
inline, and use that variable in the BorderSide color and in any text/icon color
or style references found in the widget class (the OutlinedButton.icon styling
and the other occurrences near the same widget) so no code path can throw if
purpleShade is null.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 938a1c25-01f9-4ab3-b881-7676a4e437c6
📒 Files selected for processing (1)
lib/app/modules/settings/views/settings_page_select_directory_list_tile.dart
| child: OutlinedButton.icon( | ||
| style: OutlinedButton.styleFrom( | ||
| side: BorderSide(color: tColors.purpleShade!), | ||
| shape: RoundedRectangleBorder( |
There was a problem hiding this comment.
Avoid force-unwrapping purpleShade in button styling.
Line 62 uses tColors.purpleShade!; this can throw if the theme extension ever provides null. Use a fallback and apply it consistently to Line 173, Line 184, and Line 197.
Suggested fix
- side: BorderSide(color: tColors.purpleShade!),
+ side: BorderSide(
+ color: tColors.purpleShade ?? Theme.of(context).colorScheme.primary,
+ ),
...
- icon: Icon(Icons.restore, color: tColors.purpleShade, size: 20),
+ icon: Icon(
+ Icons.restore,
+ color: tColors.purpleShade ?? Theme.of(context).colorScheme.primary,
+ size: 20,
+ ),
...
- color: tColors.purpleShade,
+ color: tColors.purpleShade ?? Theme.of(context).colorScheme.primary,
...
- backgroundColor: tColors.purpleShade,
+ backgroundColor:
+ tColors.purpleShade ?? Theme.of(context).colorScheme.primary,Also applies to: 173-174, 184-184, 197-197
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@lib/app/modules/settings/views/settings_page_select_directory_list_tile.dart`
around lines 60 - 63, Replace the force-unwrapped tColors.purpleShade! with a
safe fallback and apply it consistently where button styling uses it (the
OutlinedButton.styleFrom BorderSide and any other places that reference
tColors.purpleShade at the OutlinedButton.icon and the instances around the
other usages). Create a local variable (e.g., final buttonPurple =
tColors.purpleShade ?? fallbackColor) or use the null-coalescing expression
inline, and use that variable in the BorderSide color and in any text/icon color
or style references found in the widget class (the OutlinedButton.icon styling
and the other occurrences near the same widget) so no code path can throw if
purpleShade is null.
Description
This PR improves the UI consistency of the "Set To Default" and "Change Directory" buttons in the Settings → Storage and Data section.
Previously these buttons appeared visually inconsistent with the rest of the settings UI.
Changes
Screenshots
Before
After
Type of Change
UI improvement / UX consistency
Summary by CodeRabbit