The base project flutter flow design patterns MVVM
- provider (state manager)
- go_router (navigation)
- dio (rest api)
- skeletons (more loading)
- ...more libraries
- Design patterns MVVM
- Multiple env (prod/dev)
- Theme config (light/dark mode)
- Multiple language
- Rest api with dio
- Onboard screen
- UI authentication
- Auto deploy DIAWI using fastlane
Download or clone this repo by using the link below:
git clone https://github.com/anhdo9797/Flutter_boiler.git
cd Flutter_boiler
// clean git and preview folder
rm -rf .git
rm -rf preview
1. Change bundleId, appName
- Add new file
<lang>.json
inside folderassets/lang/
- Add new Language to
supportedLanguages
and locale insupportLocale
inside filelib/share/constants/app_language.dart
- Replace your logo (dev, production) inside folder
assets/launcher_icon/
- Run your terminal:
flutter pub get
/// create icon launcher (read more: https://pub.dev/packages/flutter_launcher_icons)
/// run file flutter_launcher_icons-dev.yaml and flutter_launcher_icons-prod.yaml
flutter pub run flutter_launcher_icons:main -f flutter_launcher_icons*
// create native splash screen (read more: https://pub.dev/packages/flutter_native_splash)
/// generate splash for android prod (change more option in file flutter_native_splash-prod)
flutter pub run flutter_native_splash:create --flavor prod
/// generate splash for android dev (change more option in file flutter_native_splash-dev)
flutter pub run flutter_native_splash:create --flavor dev
/// iOS:
/// replace LauncherImage in Assets.xcassets
Select environment and run app with Visual Studio Code or Android Studio and IntelliJ
1. Create an upload keystore in side android/app
3. Config env inside file fastlane/.env.dev
and fastlane/.env.dev
flow: DIAWI_TOKEN
fastlane env
// build apk android production
fastlane android build --env prod
// build apk android development
fastlane android build --env dev
// deploy android to diawi
fastlane android deploy --env prod
// -----or---------
fastlane android deploy --env dev
// deploy ios diawi
fastlane ios deploy --env prod
// -----or---------
fastlane ios deploy --env dev
/// read more config: http://docs.fastlane.tools/
5. CI/CD with github action (only android)
- Adding env:
DIAWI_TOKEN
andEMAIL_CALLBACK
with secrets for a repository - Commit and push to branch main
/// 1. Add Dockerfile
/// 2. build image
// docker buildx build --build-arg <ARG in DockerFile ex: FLUTTER_VERSION, JDK_VERSION, BUILD_TOOL_VERSION... > -t <docker name> . --progress=plain --no-cache
docker buildx build --build-arg FLUTTER_VERSION=3.3.9 -t docker_flutter . --progress=plain --no-cache
/// 3. run container
docker run -d \
-it \
--name workspace \
--mount type=bind,source="$(pwd)",target=/workspace \
docker_flutter