Goal: Upgrade GitDoIt to modern Flutter standards while maintaining stability
Duration: 8 Sprints (2-3 days each)
Risk Level: Medium (incremental changes with testing)
| Sprint | Focus | Duration | Risk |
|---|---|---|---|
| 1 | Code Quality Foundation | 1-2 days | Low |
| 2 | Dio HTTP Client | 2-3 days | Medium |
| 3 | GoRouter Navigation | 2-3 days | Medium |
| 4 | Freezed Models (Part 1) | 2-3 days | Medium |
| 5 | Freezed Models (Part 2) | 2-3 days | Medium |
| 6 | Flutter Hooks & Riverpod | 1-2 days | Low |
| 7 | UI Polish (Gap, Formz) | 1-2 days | Low |
| 8 | Testing & Cleanup | 2-3 days | Low |
Goal: Establish stricter code quality standards
- 1.1 Add
very_good_analysistopubspec.yaml - 1.2 Update
analysis_options.yaml - 1.3 Run
flutter analyzeand fix critical issues - 1.4 Add
gappackage for consistent spacing - 1.5 Run
dart format .
dev_dependencies:
very_good_analysis: ^6.0.0
dependencies:
gap: ^3.0.0- ✅
flutter analyzepasses with 0 errors - ✅ Code is properly formatted
- ✅ No deprecated API usage
pubspec.yamlanalysis_options.yaml
Goal: Replace http package with dio for better error handling and logging
- 2.1 Add
dioandtalker_dio_loggertopubspec.yaml - 2.2 Create
DioClientservice (singleton with configuration) - 2.3 Update
GitHubApiServiceto use Dio - 2.4 Implement Dio interceptors (logging, retry, error handling)
- 2.5 Remove old
httppackage - 2.6 Test all API calls (repos, issues, comments)
dependencies:
dio: ^5.7.0
talker_dio_logger: ^4.0.0- ✅ All API calls work with Dio
- ✅ Retry logic works (test with network issues)
- ✅ Logging shows in console
- ✅ Error messages are user-friendly
pubspec.yamllib/services/dio_client.dart(new)lib/services/github_api_service.dart
Goal: Implement declarative navigation with go_router
- 3.1 Add
go_routertopubspec.yaml - 3.2 Create
app_router.dartwith route definitions - 3.3 Define all 7 MVP screen routes
- 3.4 Update
main.dartto use GoRouter - 3.5 Replace
Navigator.push()calls withcontext.go()/context.push() - 3.6 Add route parameters (repo_id, issue_number, etc.)
- 3.7 Test deep navigation scenarios
dependencies:
go_router: ^14.0.0- ✅ All screens navigable via routes
- ✅ Back button works correctly
- ✅ Route parameters pass correctly
- ✅ Can navigate with named routes
pubspec.yamllib/main.dartlib/router/app_router.dart(new)- All screen files
Goal: Migrate Item, RepoItem, IssueItem to freezed
- 4.1 Add
freezedandjson_serializabletopubspec.yaml - 4.2 Update
Itemmodel with@freezed - 4.3 Update
RepoItemmodel with@freezed - 4.4 Update
IssueItemmodel with@freezed - 4.5 Run
build_runnerto generate code - 4.6 Update all usages of
copyWith()(now auto-generated) - 4.7 Fix any breaking changes
dependencies:
freezed_annotation: ^2.4.4
json_serializable: ^6.8.0
dev_dependencies:
freezed: ^2.5.2- ✅ All models compile without errors
- ✅
build_runnergenerates files - ✅ All
copyWith()calls still work - ✅ JSON serialization works
- ✅ Tests pass
pubspec.yamllib/models/item.dartlib/models/repo_item.dartlib/models/issue_item.dartlib/models/project_item.dart
Goal: Update all services and providers to use new freezed models
- 5.1 Update
GitHubApiServiceto use freezed models - 5.2 Update
LocalStorageServiceto use freezed models - 5.3 Update
SyncServiceto use freezed models - 5.4 Update all providers in
app_providers.dart - 5.5 Update all widgets that use models
- 5.6 Run full test suite
- 5.7 Fix any runtime issues
- ✅ API service parses responses correctly
- ✅ Local storage saves/loads correctly
- ✅ Sync service works with new models
- ✅ All screens render correctly
- ✅ No runtime type errors
lib/services/github_api_service.dartlib/services/local_storage_service.dartlib/services/sync_service.dartlib/providers/app_providers.dart- All widget files that use models
Goal: Add flutter_hooks for cleaner widget code
- 6.1 Add
flutter_hooksandhooks_riverpodtopubspec.yaml - 6.2 Identify widgets that benefit from hooks
- 6.3 Convert
MainDashboardScreento use hooks (optional) - 6.4 Convert
IssueDetailScreento use hooks (optional) - 6.5 Update Riverpod providers to use
hooks_riverpod - 6.6 Test converted widgets
dependencies:
flutter_hooks: ^0.20.0
hooks_riverpod: ^3.3.1- ✅ Hooks work correctly in converted widgets
- ✅ No state management bugs
- ✅ Code is cleaner
pubspec.yaml- Selected screen files (optional)
Goal: Add UI helper packages for better UX
- 7.1 Replace
SizedBoxwithGapwhere appropriate - 7.2 Add
formzfor form validation - 7.3 Create validation classes for forms
- 7.4 Update
CreateIssueScreenwith formz validation - 7.5 Update
EditIssueScreenwith formz validation
dependencies:
formz: ^0.8.0- ✅ UI spacing is consistent
- ✅ Forms validate input correctly
- ✅ Error messages show for invalid input
- All screen files (Gap replacement)
lib/screens/create_issue_screen.dartlib/screens/edit_issue_screen.dart
Goal: Ensure everything works and clean up technical debt
- 8.1 Run
flutter testand fix failing tests - 8.2 Run
flutter analyzeand fix all warnings - 8.3 Update
CHANGELOG.mdwith all changes - 8.4 Update
README.mdwith new dependencies - 8.5 Remove unused imports
- 8.6 Remove old code
- 8.7 Run
flutter pub upgrade - 8.8 Build release APK
- 8.9 Manual testing of all screens
- ✅ All tests pass
- ✅ Zero analysis errors
- ✅ App builds successfully
- ✅ All screens work correctly
CHANGELOG.mdREADME.md
dependencies:
flutter:
sdk: flutter
# State management (upgraded)
flutter_riverpod: ^3.3.1
hooks_riverpod: ^3.3.1
riverpod_annotation: ^4.0.2
# Navigation (NEW)
go_router: ^14.0.0
# Network (upgraded)
dio: ^5.7.0
talker_dio_logger: ^4.0.0
# Local storage (keep current)
hive_ce: ^2.10.1
hive_ce_flutter: ^2.2.0
# Code generation (NEW)
freezed_annotation: ^2.4.4
json_serializable: ^6.8.0
# Forms (NEW)
formz: ^0.8.0
# UI helpers (NEW)
gap: ^3.0.0
flutter_hooks: ^0.20.0
# Existing packages (keep)
flutter_secure_storage: ^10.0.0
flutter_markdown_plus: ^1.0.6
reorderables: ^0.6.0
url_launcher: ^6.3.2
connectivity_plus: ^7.0.0
file_picker: ^10.3.10
permission_handler: ^12.0.1
flutter_screenutil: ^5.9.3
flutter_svg: ^2.0.17
cupertino_icons: ^1.0.8
package_info_plus: ^9.0.0
cached_network_image: ^3.3.1
workmanager: ^0.9.0+3
shimmer: ^3.0.0
share_plus: ^12.0.1
path_provider: ^2.1.5dev_dependencies:
flutter_test:
sdk: flutter
# Code generation
build_runner: ^2.4.12
riverpod_generator: ^4.0.3
freezed: ^2.5.2
json_serializable: ^6.8.0
# Linting (upgraded)
very_good_analysis: ^6.0.0
# Build tools
build_config: ^1.2.0
# Testing
integration_test:
sdk: flutter
benchmark_harness: ^2.3.1- Dio migration - Test thoroughly with network errors
- GoRouter - Test all navigation paths
- Freezed models - Run full test suite after migration
- Commit after each sprint
- Keep old code in git history
- If issues arise, revert to previous commit
- Manual testing after each sprint
- Run
flutter testbefore committing - Build APK at end of each sprint
# Ensure clean state
git checkout main
git pull
flutter clean
flutter pub get
# Create feature branch
git checkout -b feature/modernization# Commit changes
git add .
git commit -m "feat: Sprint X - [feature name]
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>"
# Test
flutter analyze
flutter test
flutter build apk --debug- ✅ Code quality score improved (flutter analyze)
- ✅ Reduced boilerplate code (freezed)
- ✅ Better error handling (dio)
- ✅ Improved navigation (go_router)
- ✅ All tests passing
- ✅ No regression in functionality
Ready to start? Begin with Sprint 1! 🎯