Objective: Strengthen the complete Flutter app using Cursor Agent and OpenCode, improve project structure, refactor code, test core user flows, prepare project documentation, and briefly cover Firebase Hosting and Android APK generation for final demonstration.
- Review the Complete Flutter App Architecture
- Reviewing the app built from previous lessons
- Understanding the relationship between screens, widgets, services and Firebase
- Identifying repeated code, messy UI logic and areas for refactoring
- Understanding what makes Flutter code easier for AI Agents to maintain
- Preparing the project for agentic improvement tasks
- Advanced Cursor Agent Mode for Feature Iteration
- Using Cursor Agent to analyse the whole project before coding
- Asking Cursor Agent to create a step-by-step implementation plan
- Using Agent Mode to add a new feature across multiple files
- Adding validation, loading states and error messages to existing pages
- Improving login, product list and product edit user experience
- Using Cursor Agent to explain every changed file after implementation
- Learning how to reject, adjust or re-prompt when AI changes are not suitable
- Advanced OpenCode Plan / Build Workflow
- Using OpenCode Plan Mode to break down a larger app improvement request
- Using OpenCode Build Mode to implement one task at a time
- Using /compact to manage long project context
- Using /undo to safely revert unwanted changes
- Switching models for planning, coding, explanation and debugging tasks
- Asking OpenCode to compare possible solutions before coding
- Using OpenCode as a pair programmer for Flutter and Firebase troubleshooting
- Creating Long-Term AI Project Context
- Writing AGENTS.md to describe project goals, folder structure and coding rules
- Creating or updating .cursor/rules for Flutter coding conventions
- Documenting preferred state management, naming style and file structure
- Adding instructions for Firebase Auth and Firestore usage
- Adding instructions for UI consistency and error handling
- Testing whether Cursor and OpenCode follow the project rules in later edits
- Refactoring Flutter Code with AI Agent Assistance
- Moving repeated UI sections into reusable widgets
- Separating Firebase access logic from screen UI code
- Creating simple service classes for Auth and Product data
- Improving variable names and function names
- Reducing overly long build methods
- Using AI to suggest safer parsing for price and quantity fields
- Reviewing refactored code manually to avoid hidden mistakes
- Debugging, Testing and Quality Review with Cursor and OpenCode
- Using Flutter error messages as prompts for AI debugging
- Asking Cursor Agent to locate the likely source of an error
- Asking OpenCode to propose a debugging checklist
- Testing login, logout, product add, product edit and product delete flows
- Checking loading, empty data and error states
- Using AI to generate manual test cases for the final app
- Understanding the limits of AI-generated fixes and the need for human review
- Firebase Hosting and Web Deployment Overview
- Understanding Flutter Web deployment at a high level
- Running flutter build web
- Understanding the build/web output folder
- Using firebase init hosting with build/web as the public directory
- Configuring as a single-page app
- Deploying with firebase deploy
- Using Cursor or OpenCode to check deployment configuration and explain common errors
- Android APK Generation and Physical Device Preview
- Briefly understanding the role of JDK, Android SDK and Flutter Doctor
- Using flutter doctor to identify missing Android build requirements
- Using AI Agent to explain Flutter Doctor warnings in simple language
- Running flutter build apk --release
- Finding build/app/outputs/flutter-apk/app-release.apk
- Installing APK manually on Android physical device for testing
- Understanding that this section focuses on practical preview, not deep Java or Android platform configuration
- Final Project Review and Presentation
- Reviewing the complete Flutter + Firebase app
- Explaining how Cursor and OpenCode supported the development process
- Presenting login, Firestore CRUD, Web deployment and Android installation
- Showing examples of AGENTS.md and .cursor/rules used in the project
- Discussing how to continue improving the app with AI Agent support
- Discussing future learning paths: Provider, Riverpod, advanced Firebase, Play Store publishing and production security rules