Templates for mobile app projects using flutter.
The environment variable --dart-define=OPERATION_TYPE at build time switches firebase project, api connecting destination, and others.
- Firebase configuration file is empty, so overwrite the files under
android/app/firebaseand underios/firebase.
In case of Android, switch settings by the script in android/app/build.gradle. In case of iOS, execute ios/Scripts/dart_define.sh from Xcode script execution settings, and change the xcconfig file according to your environment.
product, staging, review, develop
- Separate app name, ID, and Firebase configuration files for
productand others - In settings other than
product, the id is suffixed with.dev.
Divide responsibilities among the four roles of View, ViewModel, UseCase, and Repository.
UI display and control.
UI update notification to View and maintenance of status, bridging with UseCase.
Responsible for business logic.
Responsible for bridging with DB and other external parties.
The .di constructor defined for testing is used to increase testability.
@visibleForTesting
SampleClass.di(this._sample);
Since it is necessary to create a mock class by Mockito, set up @GenerateMocks and execute the following commands.
flutter pub run build_runner build --delete-conflicting-outputs
Classes used by multiple components.
Static definition file.
Dialog classes.
Data classes that are exchanged between APIs and objects.
Exception classes.
Mixin classes for Provider access in the State class.
Classes that interact with the outside.
Screen transition monitoring classes.
A screen classes that serves as a unit for screen transitions.
- Create a folder for each screen.