fix: extract icon constants for Flutter web tree-shaking compatibility#38
Merged
anilcancakir merged 1 commit intomainfrom Apr 9, 2026
Merged
fix: extract icon constants for Flutter web tree-shaking compatibility#38anilcancakir merged 1 commit intomainfrom
anilcancakir merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors runtime-conditional Icons.* usages into static const icon fields / const maps so Flutter web icon tree-shaking (const_finder) can reliably detect required glyphs, preventing missing icons in release web builds.
Changes:
- Replaced ternary-based icon selections with
static consticon fields (e.g., visibility toggles, expand/collapse icons, theme toggle). - Replaced switch-based icon selection with
static constlookup maps + defaults for notification icon resolution. - Documented the fix under
[Unreleased]in the changelog.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| lib/src/ui/widgets/magic_starter_user_profile_dropdown.dart | Extracts theme toggle icons into static const fields. |
| lib/src/ui/widgets/magic_starter_team_selector.dart | Extracts expand/collapse icons into static const fields for conditional rendering. |
| lib/src/ui/widgets/magic_starter_password_confirm_dialog.dart | Extracts password visibility icons into static const fields. |
| lib/src/ui/widgets/magic_starter_notification_dropdown.dart | Replaces switch-based icon selection with a static const icon map + default. |
| lib/src/ui/views/profile/magic_starter_profile_settings_view.dart | Extracts visibility + device-type icons into static const fields used in conditionals. |
| lib/src/ui/views/notifications/magic_starter_notifications_list_view.dart | Replaces switch expression icon selection with a static const icon map + default. |
| lib/src/ui/views/notifications/magic_starter_notification_preferences_view.dart | Replaces switch-based channel icon selection with a static const icon map + default; extracts locked icon. |
| lib/src/ui/views/auth/magic_starter_reset_password_view.dart | Extracts password visibility icons into static const fields used in ternaries. |
| lib/src/ui/views/auth/magic_starter_register_view.dart | Extracts password visibility icons into static const fields used in ternaries. |
| lib/src/ui/views/auth/magic_starter_login_view.dart | Extracts password visibility icons into static const fields used in ternaries. |
| CHANGELOG.md | Adds an [Unreleased] bug-fix entry for icon tree-shaking compatibility. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Icons.*references intostatic constfields across 10 files for Flutter web tree-shaking compatibilityconst_findercan detect all icon glyphs--no-tree-shake-icons(+1.6MB)Closes #37
Test plan
flutter analyze --no-fatal-infos— zero issuesflutter test— 589 tests passIcons.*literals remain in ternary/switch expressions (only instatic constdeclarations)