Projects from dicoding.com flutter class as a practice in advanced navigation, use of media (audio, images, and video), and use of maps such as Google Maps.
-
Install Flutter SDK with the same version as defined on
pubspec.yaml
or.fvmrc
file.You may use FVM (Flutter Version Manager) for easy installation.
fvm use
Main packages that are used as foundation for this project.
- injectable -- Dependency injection framework.
- freezed -- Data model with short and simple syntax.
- chopper -- HTTP client service.
- shared_preferences -- Local storage.
- go_router -- Web friendly routing.
- provider -- State management.
Most of them need to generate its utilities with build_runner.
-
Install dependencies
flutter pub get
-
Intialize git hooks to validate commit messages
dart run husky install
-
Create
.env
file. Use.env.example
as a template. -
You may also need to change Google Maps API key on android, ios, and web configs if you need to debug the app custom maps.
-
Build project environment.
dart run build_runner build -d # generate code utils flutter gen-l10n # generate localizations
-
Now you're good to go!
# Check connected devices flutter devices # Check available emulators flutter emulators # Run app flutter run -d <device-id>
This project is follow the Clean Architecture principles.
-
/lib
-- Source code-
main.dart
-- Application entry point. -
service_locator.dart
-- Service locator to get injectable services. -
/domain
-- Domain layer (Entities and services abstractions). -
/infrastructures
-- Infrastructure layer (Services implementations). -
/interfaces
-- Interfaces layer (Application routes, states, etc). -
/use_cases
-- Application logic layer. -
**/libs
-- Common constants, or other utilities used by folder it belongs, e.g/lib/libs
is global libs,/lib/domain/libs
is domain libs, and so on.
-
We use Conventional Commits to handle Git commit messages, and Github PR titles.
Look at dangerfile.dart
to see supported commit
types/scopes (the GitlintConfig
class).
<type>(<scopes(optional)>): <content>
Examples:
feat: add simple auth
bug(interfaces): unresponsive post story page
<type>(<scopes(optional)>): <content> ds-<issue-number>
Examples:
feat: add auth repo abstraction ds-25
fix(interfaces): fix auth repo impl ds-250
fix(domain/infrastructures): fix invalid stories request ds-502
<type>-<content>-ds-<issue-number>
Examples:
chore-commitlint-ds-1
fix-unresponsive-home-page-ds-250
Other documentations that might be useful: