Skip to content

anhdo9797/flutter_boiler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flutter boilerplate

The base project flutter flow design patterns MVVM

PreviewApp

Libraries:

Features

  • 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

Getting Started

Step 1:

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

Step 2: Config app

2. Languages

  • Add new file <lang>.json inside folder assets/lang/
  • Add new Language to supportedLanguages and locale in supportLocale inside file lib/share/constants/app_language.dart

3. Launcher_icon, splash

  • 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

4. Run debug app

Select environment and run app with Visual Studio Code or Android Studio and IntelliJ

MultipleEnv

Step 3: Deploy app

1. Create an upload keystore in side android/app

2. Replace content in file android/gradle.properties as file created in step 1

3. Config env inside file fastlane/.env.dev and fastlane/.env.dev flow: DIAWI_TOKEN fastlane env

4. Run your terminal

// 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)

6. Docker

/// 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published