Framework Philosophy: βOne complete job at a time, with full understanding before actionβ
β
HEALTHY SYSTEMS:
- Flutter 3.19.6 + Dart SDK 3.3.4 (Working)
- All 8 tests passing
- Dependencies resolved (57 packages with compatible versions)
- Static analysis: 5 info warnings (BuildContext async usage - acceptable)
- Core functionality intact
- Production-ready CI/CD workflows
β οΈ MONITORED AREAS:
- 5 BuildContext async usage warnings in auth_page.dart
- 57 packages have newer versions (compatibility constrained)
- Git ownership warnings (resolved with safe.directory)
π« BLOCKED/AVOIDED:
- Major dependency upgrades (requires Dart SDK 3.5+)
- Desktop platform features (not needed for web/mobile focus)
Current Architecture Confirmed:
/workspaces/quaex/
βββ lib/ # Core application code
β βββ core/ # Shared business logic
β β βββ config/ # Supabase & environment config
β β βββ models/ # Data models (Transaction, Asset, etc.)
β β βββ providers/ # Riverpod state management
β β βββ router/ # GoRouter navigation
β β βββ services/ # Business services
β β βββ theme/ # UI theming
β βββ features/ # Feature modules
β β βββ auth/ # Authentication system
β β βββ home/ # Landing/dashboard
β β βββ assets/ # Asset management
β β βββ inventory/ # Inventory tracking
β β βββ scanner/ # QR/Barcode scanning
β βββ shared/ # Shared UI components
βββ test/ # Test suites
β βββ widget_test.dart # UI tests (8 passing)
β βββ integration/ # Integration tests
βββ .github/ # CI/CD & automation
β βββ workflows/ # 6 production workflows
β βββ projects/ # Project management
β βββ wiki/ # Internal documentation
βββ docs/ # Technical documentation
Core Framework:
flutter: 3.19.6
dart: 3.3.4
State Management:
flutter_riverpod: 2.6.1 (downgraded from 3.0.0 for compatibility)
Navigation:
go_router: 14.6.2 (downgraded from 16.2.4 for compatibility)
Backend Integration:
supabase_flutter: 2.8.4
http: 1.2.2
dio: 5.4.3+1
UI/UX:
material_symbols_icons: 4.2799.0
google_fonts: 6.3.0
flutter_screenutil: 5.9.3
Storage:
hive_flutter: 4.4.3+1
shared_preferences: 2.2.3 (downgraded for compatibility)
Utilities:
mobile_scanner: 5.1.1 (downgraded from 7.1.2)
flutter_dotenv: 6.0.0
crypto: 3.0.3 (downgraded from 3.0.5)
Compatibility Issues:
pattern: "SDK version >=X.Y.Z required"
solution: "Downgrade package or upgrade Flutter/Dart"
API Compatibility:
pattern: "method 'withValues' isn't defined"
solution: "Replace with withOpacity for older Dart versions"
Build Issues:
pattern: "dubious ownership in repository"
solution: "git config --global --add safe.directory /path"
Async Context:
pattern: "BuildContext across async gaps"
status: "INFO level - acceptable in current codebase"
Flutter/Dart SDK Chain:
Flutter 3.19.6 β Dart SDK 3.3.4 β Package Constraints
βββ flutter_riverpod 3.0.0 requires Dart >=3.8.0 β
βββ go_router 16.2.4 requires Dart ^3.7.0 β
βββ mobile_scanner 7.1.2 requires Dart >=3.7.0 β
βββ crypto 3.0.5 requires Dart >=3.4.0 β
Downgraded Compatible Chain:
Flutter 3.19.6 β Dart SDK 3.3.4 β Package Constraints
βββ flutter_riverpod 2.6.1 β
βββ go_router 14.6.2 β
βββ mobile_scanner 5.1.1 β
βββ crypto 3.0.3 β
Authentication System:
auth_page.dart
βββ Uses: Supabase client, GoRouter, Riverpod providers
βββ Depends on: supabase_config.dart, app_router.dart
βββ Connected to: home_page.dart (post-login navigation)
βββ Issues: 5 BuildContext async warnings (non-blocking)
Asset Management:
assets/ feature
βββ Uses: Hive storage, mobile_scanner, shared_preferences
βββ Depends on: transaction_model.dart, core services
βββ Connected to: inventory/, scanner/ features
βββ Status: Implemented, tested, stable
Environment Configuration:
main.dart β supabase_config.dart β .env files
βββ Production: Uses dart-define values
βββ Development: Uses .env files (if present)
βββ Fallback: SuruceranConfig.url/anonKey (placeholder)
βββ Warning System: Detects placeholder usage β
Based on actual project fixes:
Pattern 1: SDK Compatibility Issues
# 1. Identify the constraint
flutter pub deps # Shows dependency conflicts
# 2. Find compatible versions
flutter pub deps --json | jq '.packages[] | select(.name=="package_name")'
# 3. Downgrade systematically
# Edit pubspec.yaml with compatible versions
flutter pub get
# 4. Validate fix
flutter analyze
flutter test
Pattern 2: API Compatibility Issues
# 1. Identify deprecated/missing APIs
flutter analyze | grep "isn't defined"
# 2. Global search and replace
find lib/ -name "*.dart" -exec sed -i 's/oldAPI/newAPI/g' {} \;
# 3. Targeted file fixes
sed -i 's/withValues(alpha: [0-9.]*)/withOpacity(0.4)/g' lib/path/file.dart
# 4. Validate changes
flutter test
Pattern 3: Configuration Issues
# 1. Fix ownership issues
git config --global --add safe.directory $(pwd)
# 2. Clean and refresh
flutter clean
rm -rf .dart_tool/ build/
flutter pub get
# 3. Rebuild dependencies
flutter packages get
flutter packages upgrade --dry-run # Check what would change
Checkpoint Sequence (Proven):
# Stage 1: Dependency Resolution
flutter pub get
echo "Exit code: $?" # Must be 0
# Stage 2: Static Analysis
flutter analyze
echo "Errors: $(flutter analyze 2>&1 | grep -c 'error β’')" # Must be 0
# Stage 3: Test Execution
flutter test --reporter compact
echo "Tests: $(flutter test --reporter compact | grep -c 'All tests passed')" # Must be 1
# Stage 4: Build Validation
flutter build web --debug
echo "Build success: $?" # Must be 0
Never Touch During Bug Fixes:
Core Working Features:
- authentication flow (auth_page.dart)
- main navigation (app_router.dart)
- state management (providers/)
- test suite (test/widget_test.dart - 8 passing tests)
Stable Dependencies:
- flutter: sdk (framework dependency)
- cupertino_icons: ^1.0.8 (iOS icons)
- material_symbols_icons: 4.2799.0 (Material icons)
Critical Configuration:
- pubspec.yaml (dependency versions)
- main.dart (app initialization)
- supabase_config.dart (backend connection)
Low-Risk Areas for Changes:
Documentation:
- README.md, docs/, wiki/ (no impact on functionality)
Configuration:
- .github/workflows/ (CI/CD improvements)
- .devcontainer/ (development environment)
Non-Critical Features:
- shared/loading_page.dart (visual only)
- shared/not_found_page.dart (error handling)
#!/bin/bash
# health_check.sh - Based on actual project needs
set -e
echo "=== QUAEX PROJECT HEALTH CHECK ==="
echo "Date: $(date)"
echo "Directory: $(pwd)"
echo
# Check Flutter environment
echo "π§ FLUTTER ENVIRONMENT:"
flutter --version | head -3
echo
# Check dependencies
echo "π¦ DEPENDENCIES:"
flutter pub deps --no-dev | grep -E "(flutter_riverpod|go_router|supabase)" | head -3
echo "Status: $(flutter pub get 2>&1 | tail -1)"
echo
# Check analysis
echo "π STATIC ANALYSIS:"
ERRORS=$(flutter analyze 2>&1 | grep -c "error β’" || echo "0")
WARNINGS=$(flutter analyze 2>&1 | grep -c "info β’" || echo "0")
echo "Errors: $ERRORS (must be 0)"
echo "Warnings: $WARNINGS (5 expected - BuildContext async)"
echo
# Check tests
echo "π§ͺ TESTS:"
flutter test --reporter compact | tail -1
echo
# Check build capability
echo "ποΈ BUILD CHECK:"
if flutter build web --debug > /dev/null 2>&1; then
echo "β
Build: SUCCESS"
else
echo "β Build: FAILED"
fi
echo
echo "=== HEALTH CHECK COMPLETE ==="
Based on actual issues encountered:
Issue | Symptoms | Root Cause | Solution | Prevention |
---|---|---|---|---|
SDK Version Conflict | version solving failed |
Package requires newer Dart | Downgrade package version | Pin compatible versions |
API Compatibility | method isn't defined |
Flutter API changed | Replace with compatible API | Check compatibility before upgrade |
Git Ownership | dubious ownership |
Container/user mismatch | git config --global --add safe.directory |
Include in devcontainer setup |
Build Failures | Compilation errors | Missing dependencies | flutter clean && flutter pub get |
Regular dependency maintenance |
Test Failures | Widget not found | UI changes without test updates | Update test expectations | Keep tests in sync with UI |
#!/bin/bash
# emergency_recovery.sh - Return to last known good state
echo "π¨ EMERGENCY RECOVERY INITIATED"
# 1. Stop all processes
echo "Stopping any running Flutter processes..."
killall flutter 2>/dev/null || true
killall dart 2>/dev/null || true
# 2. Save current state for analysis
echo "Saving current state for post-mortem..."
flutter analyze > emergency_analysis.txt 2>&1 || true
flutter pub deps > emergency_deps.txt 2>&1 || true
cp pubspec.yaml emergency_pubspec_backup.yaml
# 3. Clean slate approach
echo "Cleaning build artifacts..."
flutter clean
rm -rf .dart_tool/ build/ .flutter-plugins .flutter-plugins-dependencies
# 4. Restore known good pubspec (if backup exists)
if [ -f "pubspec.yaml.backup" ]; then
echo "Restoring known good pubspec.yaml..."
cp pubspec.yaml.backup pubspec.yaml
fi
# 5. Reinstall dependencies
echo "Reinstalling dependencies..."
flutter pub get
# 6. Validate recovery
echo "Validating recovery..."
if flutter analyze | grep -q "No issues found"; then
echo "β
RECOVERY SUCCESSFUL"
flutter test --reporter compact
else
echo "β RECOVERY INCOMPLETE - Manual intervention required"
echo "Check emergency_analysis.txt for details"
fi
Required:
- Flutter analyze: 0 errors (5 info warnings acceptable)
- Flutter test: 8/8 tests passing
- Flutter pub get: No dependency conflicts
- Git status: Clean working directory (optional)
Quality Gates:
- No breaking changes to authentication flow
- No regression in core navigation
- All existing features remain functional
- Test suite maintains 100% pass rate
Documentation:
- Changes documented in appropriate files
- Framework updated with new patterns (if any)
- Help system updated with new solutions
# Acceptable performance thresholds (based on current project)
flutter analyze: < 3 seconds
flutter test: < 10 seconds
flutter build web --debug: < 30 seconds
flutter pub get: < 5 seconds
Problem Type | Analysis Tool | Change Approach | Validation Level | Time Investment |
---|---|---|---|---|
Dependency Conflict | flutter pub deps |
Systematic downgrade | Full test suite | 15-30 min |
API Compatibility | flutter analyze |
Search & replace | Targeted testing | 5-15 min |
Build Failure | flutter clean |
Environment reset | Build validation | 10-20 min |
Test Failure | flutter test -v |
Targeted fix | Affected tests only | 10-25 min |
Configuration Issue | Health check script | Conservative fix | Full validation | 5-10 min |
This framework is battle-tested on the Quaex/Parth project and provides practical, proven approaches for Flutter/Dart troubleshooting.
This section is auto-generated by the AI Troubleshooting Framework to document real-world results, automation, and industrial compliance for the Quaex Uniform Industrial Platform.