Camerash / flutter_scaffold

Custom scaffold for starting a Flutter mobile project quickly. Including common components and libraries.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flutter Scaffold πŸͺœ

License: MIT style: lint

This is a scaffold project, designed to kickstart Flutter mobile app development.

Supports two platforms:

  • iOS
  • Android

Initially generated by the Very Good CLI πŸ€–

Heavily modified to accostomed to personal practice πŸ‘¨πŸ»β€πŸ’»


What to expect πŸ€”

This project provides:

  • Multi-flavor app for both iOS and Android
  • API client generation according to endpoints
  • JWT Token support
  • State management with BLoC
  • Localization (i18n)
  • App icon generation
  • App splash screen generation
  • Navigation dependent on Auth state changes
  • Provided LoginPage and HomePage that are ready to be used

Minimum Targeting Versions:

  • Android: 21
  • iOS: 12.0

Thoughtout the projects, there are multiple TODOs to guide you through stuff that requires manual configurations.

Also, for iOS specific settings, there are some steps that requires you to perform in XCode for best compatibility:

  • Update bundle identifiers under each configurations
  • Update $(FLAVOR_APP_NAME) under "Build Settings"

Getting Started πŸš€

This project contains 2 flavors:

  • dev
  • prod

To run the desired flavor either use the launch configuration in VSCode or use the following commands:

# Dev
$ flutter run --flavor dev --target lib/main_dev.dart

# Prod
$ flutter run --flavor prod --target lib/main_prod.dart

Updating App Icons πŸ–Ό

This project uses flutter_launcher_icons to facilitate generation of app icons.

To update app icons:

  1. Edit flutter_icons configurations under pubspec.yaml and update icon files under assets/icons
  2. Run:
$ flutter pub run flutter_launcher_icons:main

Updating Native Splash Screen 🎨

This project uses flutter_native_splash to facilitate generation of native splash screens.

To update app icons:

  1. Edit flutter_native_splash.yaml for splash screen configurations and update icon files under assets/icons
  2. Run:
$ flutter pub run flutter_native_splash:create

Working with Translations 🌐

This project relies on slang for localizations.

Presumably, you should manage translations within the app with other stakeholders via a spreadsheet, with string for each row, and locale for each column.

After that:

  1. Generate a .csv file and update lib/i18n/translations.i18n.csv
  2. Run:
$ flutter pub run slang

You can update configuration of slang under slang.yaml


Routing between screens 🚦

This project relies on auto_route for routing control and navigation with parameters.

  1. Define your routes in lib/core/navigation/app_router.dart
  2. Run:
$ flutter pub run build_runner build

Generating data classes πŸ”£

This project recommends the usage of freezed for generating consistent data-classes that support union, cloning equality and much more.

After defining your Freezed class, run:

$ flutter pub run build_runner build

HTTP and API πŸ“‘

This projects uses Dio as the http client, and Retrofit for API route handling and generation.

Again, after defining your API routes under lib/core/api, run:

$ flutter pub run build_runner build

About

Custom scaffold for starting a Flutter mobile project quickly. Including common components and libraries.

License:MIT License


Languages

Language:Dart 97.1%Language:Ruby 2.0%Language:Swift 0.6%Language:Kotlin 0.2%Language:Objective-C 0.1%