emsameen / flutter-sample

A fully working boilerplate sample Flutter app implementation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cíngulo Flutter Sample

Status develop
Travis CI Build Status
Coveralls Coverage Status

Check out a short demo video here.
Check out some screenshots here.

A fully working sample Flutter app implementation. Give this repo a Star if you like it :)

  • Layers separation (data, domain, logic, ui)
  • Network calls and very simple caching and concurrency mechanism
  • Generic error handling
  • Forms validation
  • Generic bloc structure
  • RxDart
  • Dependency injection
  • Authentication with JWT and daily renewal
  • Themes
  • Multiple languages
  • Named routes
  • Named routes with parameters
  • Names routes with simple permission control
  • Analytics and pushes skeleton
  • We have published the API so that you can test the app
  • Looks good but... it is still missing tests (TODO) :(

Dependency Injection

This project uses inject.dart. We only had to fork it from Google in order to bump a version dependency. You will have to clone it under vendor/inject.dart:

    $ cd <repository-root>
    $ git clone https://github.com/cingulo/inject.dart.git vendor/inject.dart

Use the commands below to build the dependency injection:

    $ flutter packages pub run build_runner build --build-filter "lib/data/*/*.dart" --delete-conflicting-outputs
    $ flutter packages pub run build_runner build --build-filter "lib/app/*.dart" --delete-conflicting-outputs
  • Done, you should now be good to run the app.

Structure

  • app/ Where the starting MaterialApp resides.
  • common/ Abstract app-wide base classes.
  • data/ Data handling.
  • data/*_repository.dart Frontier between app models and data storage.
  • errors/ Custom app errors.
  • models/ App models, independent of how data/*_repository.dart handles it (db, api, file, in memory, etc).
  • screens/ App screens, may also have screen-specific sub widgets.
  • screens/*_bloc.dart Screen/widget business logic.
  • services/ App-wide logic like analytics, crashes, l10n, pushes, refresh and routes.
  • themes/ App themes.
  • widgets/ App-wide widgets. Design system components would reside here, for example.
  • env.dart Envs.
  • main.dart Entry point.

Routes

Routes must be instantiated here to be available for nacigation.

L10n

L10n delegates must be listed here to be available.

API Docs

Open the docs URL in your browser. You can also check the API GitHub repository.

About

A fully working boilerplate sample Flutter app implementation.

License:MIT License


Languages

Language:Dart 96.7%Language:Ruby 2.1%Language:Shell 0.5%Language:Swift 0.4%Language:Kotlin 0.3%Language:Objective-C 0.0%