Skip to content

khanhuitse05/flutter-boilerplate

Repository files navigation

Flutter Boilerplate

Logo

Fork this project then start you project with a lot of stuck prepare
Base project made with much ❤️ . Contains CRUD, patterns, and much more!

Report bug · Request feature

Table of contents


Prerequisites


How to Run

  1. Clone the repo:

    git clone https://github.com/khanhuitse05/flutter-boilerplate.git
  2. Install dependencies:

    flutter pub get
  3. Generate code:

    flutter packages pub run build_runner build
  4. Run the app (Staging):

    flutter run --flavor staging --target lib/main_staging.dart
  5. Run the app (Production):

    flutter run --flavor production --target lib/main_production.dart

Using This Template

  1. Clone this repo:

    git clone https://github.com/khanhuitse05/flutter-boilerplate.git
  2. Customize the package name:

    sudo sh ./customizer.sh your.package.name

    ✅ This will:

    • Remove the existing git history
    • Update the README
    • Change your bundle ID
  3. Update your Firebase config:

    • Android
      • android/app/src/staging/google-services.json
      • android/app/src/production/google-services.json
    • iOS
      • ios/config/GoogleService-Info.plist (staging & production)
    • Update:
      • firebase_options_stg.dart
      • firebase_options_prod.dart
      • REVERSED_CLIENT_ID in Info.plist
  4. Regenerate Firebase options:

    flutterfire config      --project={YOUR_FIREBASE_PROJECT_ID}      --out={PATH_TO_SAVE/firebase_options.dart}      --ios-bundle-id={BUNDLE_ID_APP}      --android-app-id={APP_ID}

    Read More in the Wiki

  5. Run the app: Follow steps here


Code Conventions

Best Practices:

  • Modularize widgets to be as independent and reusable as possible.
  • Follow naming conventions:
    • Models: start with MMUser, MProduct, MGroup
    • Common Widgets: start with XXButton, XText, XAppBar (stored in lib/widgets/)
    • App Constants/Services: start with AppAppStyles, AppColor, AppRouter, AppCoordinator, UserPrefs

Dependencies

Dependencies

Helpers

HTTP / API

  • http – HTTP requests

Firebase

  • FlutterFire – Auth, Analytics, Crashlytics, Storage, Firestore

State Management

Assets / Code Generation

Localization

Widgets

Image & Cache


Code Structure

Default Flutter Structure

flutter-app/
|- android
|- ios
|- web
|- lib
|- modules
|- test

Project Structure Used

lib/
|- packages/
|- src/
  |- data/
  |- services/
  |- feature/
    |- dashboard/
      |- widget/
      |- controller/
      |- dashboard_screen.dart
    |- home/
    |- login/
  |- plugins/
  |- routing/
|- widgets/
  |- button/
  |- image/
  |- view/
|- main.dart
|- modules/

Navigation Stack

Navigation Stack


Wiki

Check out the Wiki for more detailed guides.


Screenshots

Account Profile Login

About

🦅🦅Start new project with Flutter🐷

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •