App to compare grocery product prices.
The project follows a feature-first structure with separation between UI, domain logic, and data access.
lib/main.dart→ process entrypoint (runApp)lib/app/→ app shell (theme, root widget wiring)lib/core/→ shared cross-feature infrastructurelib/features/→ isolated feature modulestest/→ automated tests
Each feature should keep layers separated:
presentation/→ screens and widgets (UI only)domain/→ entities and business rulesdata/→ repositories, datasources, mappers
Example (current home feature):
lib/features/home/presentation/home_page.dartlib/features/home/domain/entities/home_section.dartlib/features/home/data/repositories/home_sections_repository.dart
- App boots through
PriceComparatorApp - Root screen delegated to
HomePage - Base folders are ready for adding new features without mixing UI and business logic
This repo includes a local .pre-commit-config.yaml with:
dart format --output=none --set-exit-if-changedflutter analyze --no-fatal-infos
Notes:
dart formatis enforced in check mode, so it fails if a file would be reformatted.flutter analyzecurrently ignoresinfodiagnostics in pre-commit because the repo still has 4 inheriteduse_build_context_synchronouslyinfos inlib/features/home/presentation/model_records_pages.dart.- To run the hooks locally, make sure
pre-commitis available in your shell. In this environment that means activatingpyenvenvpy3first.
Example:
pyenv activate py3
pre-commit run --all-filesPull requests trigger .github/workflows/preview.yml, which runs:
flutter pub getdart run build_runner build --delete-conflicting-outputsflutter testflutter build web --release --dart-define=WEB_PREVIEW=true- Firebase Hosting preview deploy
- PR comment with the preview URL
Configure these repository secrets for preview deploys:
FIREBASE_SERVICE_ACCOUNT: service account JSON for Firebase Hosting deployFIREBASE_PROJECT_ID: Firebase project id
Publishing a GitHub Release triggers .github/workflows/release-android-apk.yml (also runnable manually via workflow_dispatch), which runs:
flutter pub getdart run build_runner build --delete-conflicting-outputsflutter create . --platforms androidflutter build apk --release- Upload
build/app/outputs/flutter-apk/*.apkas an Actions artifact - When triggered by a published GitHub Release, attach the APK to the Release assets
Current workflow builds a release APK with the default Android signing available in CI (no custom upload keystore configured yet).
If you want Play Store-ready signing, add your own keystore and key.properties wiring for the Android project, then provide the required secrets in GitHub Actions.