- Purpose: App entry point and main navigation
- Key Components:
AuthWrapperStatefulWidget for authentication flow_checkAuth()method validates user session on startup- Route definitions for all screens
- Provider setup for state management
- Key Features:
- Automatically routes to appropriate screen based on auth status
- Handles role-based navigation
- Purpose: Local data storage abstraction
- Backend: SharedPreferences (cross-platform)
- Key Methods:
setString/getString- Basic key-value storagesetJson/getJson- JSON document storagesetStringList/getStringList- List storageremove/clear- Data cleanup
- Usage: Used throughout app for persistent local storage
- Purpose: User authentication (local-only)
- Key Methods:
signUp()- Create new user (parent or child)signIn()- Authenticate user locallysignOut()- Clear sessionisSignedIn()- Check auth statusgetCurrentUserId()- Get session user IDgetCurrentUserRole()- Get user rolelinkChildToParent()- Create parent-child relationship
- Data Storage: Uses TinyDB for user credentials
- Purpose: Global application state (Provider)
- Key Properties:
userId- Current user IDuserRole- Current user roleusername- Current user's usernameecoPoints- Total eco pointsscreenTimeMinutes- Green time trackedwaterSaved,co2Saved- Environmental impact
- Key Methods:
setUserId()- Initialize user contextsetEcoImpact()- Update environmental metricsresetState()- Clear on logout
- Used By: All screens via
Provider.of<AppState>(context)
- Purpose: Task data model
- Key Properties:
id,title,description- Task metadatapoints- EcoPoints rewardkidID,parentID- Task assignmentstatus- Current task statusapprovedByParent- Approval statuscreatedAt,completedAt- Timestamps
- Key Methods:
- Constructor for creating tasks
fromMap()factory - Create from TinyDB JSONtoJson()- Serialize for storage
- Purpose: Initial role selection
- Components:
RoleSelectScreen- Main screen_RoleCard- Reusable role card widget
- Features:
- Beautiful gradient background
- Two options: "I'm a Kid" and "I'm a Parent"
- Routes to AuthScreen with role parameter
- Responsive design
- Purpose: User login and signup
- Features:
- Login/Signup toggle
- Role-specific fields (child username)
- Email & password validation
- Form validation with helpers
- Integrates with AuthService
- Routes to appropriate dashboard on success
- Purpose: Child user's main interface
- Features:
- Display assigned tasks
- Show EcoPoints and GreenTime counters
- "Mark Done" button for task completion
- Confetti celebration animation
- Sign out functionality
- Responsive layout with FutureBuilder
- Material design cards and icons
- Purpose: Parent user's main interface
- Features:
- Tab navigation (Pending/Approved tasks)
- Task management (create, approve, reject, delete)
- Environmental impact summary
- Link children functionality
- Add custom tasks dialog
- Task approval workflow
- Sign out option
- Purpose: Link children to parent account
- Features:
- Instructions card for parents
- Child username input with validation
- Link child button
- Display linked children list
- Remove child functionality
- Loading indicator during linking
- Purpose: EcoPoints redemption
- Features:
- Display current EcoPoints
- Info cards about redemption
- WebView integration for external store
- Role-based access (parents only)
- Beautiful Material design
- Purpose: Project dependencies and configuration
- Key Dependencies:
- Flutter & Dart SDK
- UI: google_fonts, flutter_vector_icons, confetti, flutter_screenutil
- State: provider
- Storage: shared_preferences (TinyDB backend)
- Other: image_picker, url_launcher, webview_flutter, intl, lottie
- Removed: All Firebase packages (firebase_core, cloud_firestore, firebase_auth, etc.)
- Purpose: Dart linting and analysis rules
- Includes: Recommended lint rules for code quality
- Purpose: Android project build configuration
- Content:
- Build script dependencies
- Repository configuration
- Project-wide gradle settings
- Purpose: Unit tests for TinyDB functionality
- Test Cases:
- User signup validation
- User signin validation
- JSON storage and retrieval
- Status: ✅ PASSING (00:26 +1: All tests passed!)
- Complete project status summary
- Architecture overview
- Feature checklist
- Testing results
- Build instructions
- Quick start guide
- Project structure explanation
- Service documentation
- User flows
- Troubleshooting guide
- Deployment instructions
Key: "users"
Value: {
"user123": {
"id": "user123",
"email": "parent@example.com",
"username": "parent_eco",
"role": "parent",
"ecoPoints": 500,
"screenTimeMinutes": 2000,
"waterSaved": 50.0,
"co2Saved": 25.5,
"createdAt": "2025-11-13T10:30:00Z"
},
"user456": {
"id": "user456",
"email": "child@example.com",
"username": "eco_warrior_123",
"role": "kid",
"parentID": "user123",
"ecoPoints": 250,
"screenTimeMinutes": 1240,
"createdAt": "2025-11-13T11:45:00Z"
}
}
Key: "tasks"
Value: {
"task_001": {
"id": "task_001",
"title": "Plant a Tree",
"description": "Plant one tree in your area",
"points": 50,
"kidID": "user456",
"parentID": "user123",
"status": "pending",
"approvedByParent": false,
"createdAt": "2025-11-13T12:00:00Z"
}
}
Key: "current_user"
Value: "user123"
Key: "current_role"
Value: "parent"
Key: "linked_children"
Value: "eco_warrior_123,another_child"
build/windows/x64/runner/Release/hi.exe
build/windows/x64/runner/Debug/hi.exe
build/app/outputs/flutter-apk/app-release.apk
build/ios/iphoneos/Runner.app
| Metric | Value |
|---|---|
| Dart Files | 20+ |
| Screen Files | 6 |
| Service Files | 3 |
| Model Files | 3 |
| Test Files | 1+ |
| Total Lines of Code | 3,000+ |
| Compilation Errors | 0 |
| Build Status | ✅ PASSING |
| Test Status | ✅ PASSING |
README.md- Project overviewQUICK_START.md- Quick referenceREADME_GREENTIME.md- GreenTime app infoCOMMANDS_REFERENCE.md- CLI commandsMASTER_CHECKLIST.md- Project checklist
- Local authentication (no server needed)
- Task creation and management
- Parent-child relationships
- EcoPoints tracking
- Offline functionality
- Cross-platform (ready for iOS/Android)
- Responsive UI
- Error handling
- Data persistence
- No Cloud: App is 100% local - no Firebase or internet required
- Data Reset: Use
TinyDB.clear()to reset all app data - Passwords: Are stored as plain text in SharedPreferences (not production-ready for sensitive data)
- No Sync: Data doesn't sync between devices (each device has separate storage)
- Storage Limit: SharedPreferences has typical platform limits (usually 1-10MB)
- Implement proper password hashing (bcrypt/scrypt)
- Add cloud sync (Firebase, Supabase, or custom backend)
- Implement data validation
- Add rate limiting
- Implement proper logging
- Add crash reporting
- Consider database migration (SQLite → better for large datasets)
Reference Document Generated: November 13, 2025 Version: 1.0.0