Last updated: 2026-03-29
Project context: Flutter frontend + Node.js backend
Audience: Beginners learning Flutter while building a real team project
Keep this project strong but realistic for class delivery.
HomePageServicesPage(list of services/items)ServiceDetailsPage(single item details)ContactPage(form submission)AboutPageNotFoundPage(for bad routes)
SplashPage(branding + initialization)LoginPageandRegisterPageProfilePageSettingsPage
You already created:
lib/pages/home_page.dartlib/pages/services_page.dartlib/pages/contact_page.dartlib/pages/about_page.dart
Good next step is to complete those 4 first, then add ServiceDetailsPage.
- Purpose: first impression + quick navigation.
- Suggested sections:
- Hero/title area
- Short project/service intro
- Top services preview (3-5 cards)
- Primary actions (View Services, Contact Us)
- Backend needs:
- Optional featured services endpoint
- States to handle:
- Loading
- Empty (no featured services)
- Error + retry
- Purpose: browse all available services/items.
- Suggested sections:
- Search bar
- Category/filter chips (optional)
- Paginated or scroll list of service cards
- Backend needs:
- Get services list
- Optional query params: search, filter, page
- States to handle:
- Loading
- Empty results
- Network error
- Purpose: show full info for a selected service/item.
- Suggested sections:
- Main image
- Title and description
- Price/rate (if applicable)
- Contact/Book action
- Backend needs:
- Get service by id
- States to handle:
- Loading
- Item not found
- Error + back action
- Purpose: let user send inquiry/feedback.
- Suggested fields:
- Name
- Phone (optional)
- Message
- Backend needs:
- Submit contact form endpoint
- Validation needed:
- Required fields
- Email format
- Minimum message length
- UX needed:
- Disabled submit while sending
- Success confirmation
- Friendly error message
- Purpose: who you are + what the project does.
- Suggested sections:
- Team mission
- What problem you solve
- Team members (optional)
- Social/contact links (optional)
- Backend needs:
- Usually none (can be static)
- Purpose: handle broken links/routes.
- Should include:
- Simple error message
- Button to return home
Use this minimal stack. It is beginner-friendly and enough for clean architecture.
go_router
- Why: clean navigation/routing and easy deep-link style route management.
- Install:
flutter pub add go_router - Use it for: central route table and named navigation.
flutter_riverpod
- Why: predictable state management with less hidden behavior than
setStateeverywhere. - Install:
flutter pub add flutter_riverpod - Use it for: page state, API loading state, shared app state.
dio
- Why: robust HTTP client with interceptors, timeout control, and cleaner error handling.
- Install:
flutter pub add dio - Use it for: all backend communication.
flutter_secure_storage
- Why: secure local storage for auth tokens.
- Install:
flutter pub add flutter_secure_storage - Use it for: storing access token and clearing it on logout.
intl
- Why: formatting dates, times, and numbers in a clean way.
- Install:
flutter pub add intl - Use it for: user-facing date/time and currency formatting.
url_launcher
- Why: open email, phone dialer, or external links.
- Install:
flutter pub add url_launcher - Use it for: contact actions from About or Contact pages.
cached_network_image(optional but useful)
- Why: smooth image loading with caching and placeholders.
- Install:
flutter pub add cached_network_image - Use it for: service images from backend URLs.
json_annotation
- Why: standard annotations for generated JSON model mapping.
- Install:
flutter pub add json_annotation
json_serializable(dev dependency)
- Why: auto-generates model parsing to reduce manual bugs.
- Install:
flutter pub add --dev json_serializable
build_runner(dev dependency)
- Why: runs code generation for models.
- Install:
flutter pub add --dev build_runner
mocktail(dev dependency)
- Why: easier mocking for unit tests.
- Install:
flutter pub add --dev mocktail
Run these in this order:
flutter pub add go_router flutter_riverpod dio flutter_secure_storage intl url_launcherflutter pub add cached_network_imageflutter pub add json_annotationflutter pub add --dev build_runner json_serializable mocktailflutter pub get
When model generation is needed:
dart run build_runner build --delete-conflicting-outputs
When model files are changed frequently during development:
dart run build_runner watch --delete-conflicting-outputs
- Create one central route file.
- Define all page routes in one place.
- Use named routes instead of hardcoded path strings across files.
- Add unknown-route fallback to
NotFoundPage.
- Create feature-level state providers.
- Keep API calls outside widgets (service/repository layer).
- Widgets read provider state and display loading/error/data UI.
- Avoid mixing business logic directly inside page widgets.
- Create one configured HTTP client with base URL and timeout.
- Add request/response interceptors for logging during development.
- Centralize API error mapping into user-friendly messages.
- Do not call backend directly from page widgets.
- Save token after successful login.
- Read token when app starts.
- Attach token to API headers (through
diointerceptor). - Delete token on logout or auth failure.
- Create model classes based on backend JSON contracts.
- Run generator after model changes.
- Keep model naming aligned with backend keys.
- Regenerate files before pushing code to avoid CI failures.
- Mock repository or API layer, not UI widgets.
- Write tests for success, failure, and empty responses.
- Use widget tests only for key flows and forms.
Use this structure to keep project easy to understand:
lib/main.dart-> app entrylib/app/-> app-level setuplib/app/router/-> routing configlib/core/config/-> environment config and constantslib/core/network/-> API client and network error mappinglib/core/storage/-> secure/local storage servicelib/shared/widgets/-> reusable UI componentslib/shared/theme/-> colors, text styles, spacinglib/features/home/-> home feature fileslib/features/services/-> services list + detailslib/features/contact/-> contact form flowlib/features/about/-> about contentlib/features/auth/-> login/register (if needed)
Inside each feature folder:
data/-> models, remote data source, repository implementationdomain/-> entities/use-cases (lightweight for class project)presentation/-> pages, providers, widgets
For each endpoint, confirm:
- URL path and HTTP method
- Required headers
- Request body fields and types
- Success response shape
- Error response shape
- Which fields are nullable
- Example request and response payload
Minimum backend endpoints to request from Node.js team:
GET /servicesGET /services/{id}POST /contactPOST /auth/login(if auth is part of MVP)POST /auth/register(if auth is part of MVP)
- Clean template app.
- Configure theme and routing.
- Add dependency stack.
- Set folder structure.
- Build Home, Services, Contact, About with static data.
- Finalize navigation flow between pages.
- Make UI responsive on small/medium phones.
- Connect Services list and details to API.
- Connect Contact form submission.
- Add loading/empty/error handling on each connected page.
- Add form validation and user feedback states.
- Add tests for core services and key widgets.
- Run
flutter analyze,dart format .,flutter test. - Fix final bugs and freeze scope.
- Calling API directly inside widget build methods.
- Mixing route names and literal paths across files.
- Starting all pages at once before finishing one complete flow.
- Ignoring loading and error states until the end.
- Hardcoding backend URLs in many places.
- Skipping basic tests for forms and API mapping.
A feature is considered done only when all are true:
- UI is complete and navigable.
- Backend integration works for success and failure cases.
- Loading, empty, and error states are visible and usable.
- Basic validation exists for user inputs.
- At least one test covers the feature's key behavior.
- README/API notes updated if behavior changed.
- Install dependencies:
flutter pub get - Run app:
flutter run - Analyze:
flutter analyze - Format:
dart format . - Test:
flutter test - Build Android APK:
flutter build apk - Build web (if needed):
flutter build web