-
Notifications
You must be signed in to change notification settings - Fork 0
flutter: const constructors cleanup (batch 1) #54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… register and enhanced register; refresh SQLx cache
…null-aware in AccountAdapter; minor cast cleanup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request performs const constructor optimizations and API migration updates across Flutter and Rust codebases. The primary focus is reducing rebuild costs through const constructors while also migrating from deprecated Flutter APIs.
- Make compile-time constant constructors
constto optimize widget rebuilds - Replace deprecated
withOpacity()calls withwithValues(alpha:)API - Update method signatures to include BuildContext parameters for proper context usage
- Add integration tests for auth registration routes with family/ledger creation validation
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test_tag_functionality.dart | Replace deprecated withOpacity with withValues API |
| tag_demo.dart | Replace deprecated withOpacity with withValues API |
| qr_code_generator.dart | Mixed const constructor changes and property removals |
| permission_guard.dart | Add const constructors and improve null safety patterns |
| invite_member_dialog.dart | Add const constructors for compile-time constant widgets |
| dashboard_overview.dart | Add BuildContext parameters to private methods |
| account_adapter.dart | Simplify null-conditional operator usage |
| mod.rs | Add new integration test module |
| auth_register_route_e2e_test.rs | New integration test for auth registration flow |
| auth_register_enhanced_route_e2e_test.rs | New integration test for enhanced registration |
| family_service.rs | Add owner_id field to family creation and improve logging |
| main.rs | Update route handler reference |
| enhanced_profile.rs | Add comprehensive logging and error handling |
| auth.rs | Refactor user/family creation order with owner_id support |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| child: Center( | ||
| child: CircularProgressIndicator(), | ||
| child: const Center( | ||
| child: const CircularProgressIndicator(), |
Copilot
AI
Sep 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the redundant const keyword. The parent const Center already makes the child widget const.
| child: const CircularProgressIndicator(), | |
| child: CircularProgressIndicator(), |
Copilot uses AI. Check for mistakes.
| ? SizedBox( | ||
| width: widget.size, | ||
| height: widget.size, | ||
| child: Center( | ||
| child: CircularProgressIndicator(), | ||
| child: const Center( | ||
| child: const CircularProgressIndicator(), |
Copilot
AI
Sep 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SizedBox should be const since all its properties (width, height, child) use compile-time constants. Change SizedBox( to const SizedBox(.
Copilot uses AI. Check for mistakes.
| SizedBox( | ||
| width: 60, | ||
| child: Text( | ||
| '$label:', |
Copilot
AI
Sep 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SizedBox should be const since its width is a compile-time constant and the Text widget uses string interpolation that could be evaluated at compile time for static labels. Consider making this const SizedBox( if the label parameter is always a compile-time constant.
Copilot uses AI. Check for mistakes.
| ), | ||
| const SizedBox(height: 20), | ||
| const SizedBox( | ||
| SizedBox( |
Copilot
AI
Sep 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SizedBox should be const since its height is a compile-time constant. Change SizedBox( to const SizedBox( to be consistent with the const optimization goals of this PR.
| SizedBox( | |
| const SizedBox( |
Copilot uses AI. Check for mistakes.
flutter: const constructors cleanup (batch 1)
Scope
Changes
Why
Validation
flutter analyze— no blocking errors.flutter test— all tests passing (10/10).Next