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

  • Flutter: >=3.7.0 <7.0.0

How to Use

  1. Download or clone this repo by using the link below:
https://github.com/j1mmyto9/flutter-boilerplate.git
  1. Go to project root and execute the following command in console to get the required dependencies:
flutter pub get 
  1. Now run the generator
flutter packages pub run build_runner build

Code Conventions

  • analysis_options.yaml

  • About code analytics flutter

    In Flutter, Modularization will be done at a file level. While building widgets, we have to make sure they stay independent and re-usable as maximum. Ideally, widgets should be easily extractable into an independent project.

Dependencies

Helper

  • logger: Small, easy to use and extensible logger which prints beautiful logs.

  • url_launcher: A Flutter plugin for launching a URL in the mobile platform. Supports iOS, Android, web, Windows, macOS, and Linux.

  • auto_route: Auto route generator, Manager router

  • get_it: This is a simple Service Locator

  • intl: This package provides internationalization and localization facilities, including message translation, plurals and genders, date/number formatting and parsing, and bidirectional text.

  • shared_preferences: Flutter plugin for reading and writing simple key-value pairs. Wraps NSUserDefaults on iOS and SharedPreferences on Android.

  • package_info_plus: This Flutter plugin provides an API for querying information about an application package.

  • device_info_plus: Get current device information from within the Flutter application.

  • permission_handler: Permission plugin for Flutter. This plugin provides a cross-platform (iOS, Android) API to request and check permissions.

HTTP, API

  • http: A composable, Future-based library for making HTTP requests.

Flutter Fire

The official Firebase plugins for Flutter. sign_in, analytics, crashlytics, storage, firestore

State Management

State Management is still the hottest topic in Flutter Community. There are tons of choices available and it’s super intimidating for a beginner to choose one. Also, all of them have their pros and cons. So, what’s the best approach

A recommended approach

Other favorite package

  • provider: A wrapper around InheritedWidget to make them easier to use and more reusable.

  • rxdart: RxDart adds additional capabilities to Dart Streams and StreamControllers. Using as bloc pattens

  • RiverPod: This project can be considered as a rewrite of provider to make improvements that would be otherwise impossible.

  • stacked: This architecture was initially a version of MVVM.

  • get: GetX Ecosystem (State, Router, Dependency management, Theme, Utils)

  • More about state management

Flutter Gen

  • flutter_gen: The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs.

Widget

Image

Other favorite package

  • DIO: A powerful Http client for Dart
  • hive, sqflite: Flutter plugin for reading and locale data

Code structure

Here is the core folder structure which flutter provides.

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

Here is the folder structure we have been using in this project

lib/
|- _dev/
  |- mock/
  |- view/
  |- widget/

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

Navigation Stack

Wiki

Checkout wiki for more info

About

🦅🦅Start new project with Flutter🐷

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published