Giter Club home page Giter Club logo

flutter_mvvm_provider_template's Introduction

Flutter MVVM (Provider) Template

Simple template for MVVM with in Flutter with Provider pattern. This template is integrated with Mason.

Architecture

Flowcharts - Page 1

Overview

  • Notices
    1. Put important variables like API keys in the .env file.
    2. Basic retrofit & sqflite usage implemented in home_page.dart.
    3. Localization implemented with Flutter Intl Plugin.
  • Core Versions
dependencies:
  cupertino_icons: ^1.0.6
  path: ^1.9.0

  # Provider Pattern
  provider: ^6.0.5

  # Local DB
  sqflite: ^2.3.3
  shared_preferences: ^2.2.3
  flutter_dotenv: ^5.1.0

  # Dependency Injection
  get_it: ^7.7.0

  # Network
  retrofit: ^4.1.0
  json_annotation: ^4.8.1
  dio: ^5.4.3+1

  # Localization
  intl: ^0.19.0    

dev_dependencies:
  # Network
  retrofit_generator: '>=7.0.0 <8.0.0'
  build_runner: '>=2.3.0 <4.0.0'
  json_serializable: ^6.6.2

flutter:
  assets:
    - assets/images/
    - .env

Folder structure

Layer-first structure

lib/
├── constants/                                 (static constant values)
├── di/                                        (dependency injectors)
├── generated/                                 (generated l10n classes)
├── l10n/                                      (localization tables)
├── data
│   ├── data_source
│   │   ├── localdb/                           (SQLite components)
│   │   └── network/                           (Retrofit components)
│   ├── models/                                (data classes)
│   └── repositories/                          (repositories)
└── presentation
    ├── providers/                             (providers)
    └── views/                                 (pages including widget classes)
assets/
└── images/                                    (image asset files)
.env                                           (important variables such as API Key)

How to Make & Use Template

  1. Install Mason CLI ( If it's not installed )
    dart pub global activate mason_cli
    
  2. Git clone this repository
    git clone https://github.com/jhj0517/flutter_mvvm_provider_template.git
    
  3. Add the brick as the global (you can change the brick name in brick.yaml as you want. )
    mason add -g flutter_mvvm_provider --path ./
    
  4. Check that the brick is added correctly.
    mason ls -g
    ├── flutter_mvvm_provider 0.1.0  // it prints something like this
    
  5. You can now start a new project with your own template
    mason make flutter_mvvm_provider
    

flutter_mvvm_provider_template's People

Contributors

jhj0517 avatar

Watchers

 avatar

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.