GithubHelp home page GithubHelp logo

flutter-boilerplate's Introduction

Flutter Boilerplate

A scalable boilerplate for flutter apps.

Note:

  1. Create your own .env.production and .env.development files.
  2. You'll need your own google-services.json and GoogleServices-info.plist? files from firebase.

Features:

  • A layered architecture
  • BLoC pattern via flutter_bloc
  • Routing via Fluro (Deeplinking supported)
  • ENV variables via envify
  • TextStyle management
  • Firebase Analytics
  • Firebase Messaging
    • Android
    • iOS
  • Themes
  • Common Components
    • Button
    • Alerts
    • Progress Indicators
    • Bottom Sheets
  • Fluid transitions between components
  • JSON Serialization

Navigation with Fluro:

  1. Define the route in routes.dart
  2. Handle the route in handlers.dart
  3. Use Application singleton's navigateTo method for navigation. i.e. App.navigateTo() instead of App.router.navigateTo().
  4. Can be used for deeplinking.

Environment Variables:

  1. Define .env.production and .env.development in the root of the project.
  2. Run flutter pub run build_runner build after creation and every change made to the env files.
  3. Add the ENV variables in both the .env files and then the abstraction class.
  4. ENV variables can then be accessed after importing the environment file. For example: Env.key

Toast Alerts:

  1. No need to pass context to display the toast alerts.
  2. Use App.notifySuccess(message) to display a success message.
  3. Use App.notifyWarning(message) to display a warning message.
  4. Use App.notifyError(message) to display a error message.
  5. You can customize these toasts in the app.dart file.

Font management:

  1. All the font styles i.e. TextStyle should be maintained in the core/presentation/common/fonts directory.
  2. A font family will translate to being the primary, secondary or the tertiary font in the project.
  3. Each font family must have it's own separate file which follows the conventions laid out in primary_font.dart.

JSON Serialization:

  1. Use quicktype.io to create the model classes. Go to the website, select dart and paste the JSON respone.

Firebase messaging

  1. Both foreground and background messages are handled in firebase.dart.
  2. Add your google-services.json and GoogleServices-info.plist files. This repo does not contain either.
  3. Check out the JSON structure at the bottom of firebase.dart file that needs to be followed for Heads-up notifications on background messages (Android).

flutter-boilerplate's People

Contributors

sarthakjha889 avatar

Watchers

James Cloos avatar  avatar

Forkers

gurubalan-git

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.