Giter Site home page Giter Site logo

dahabit / provider_architecture_template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from victoruvarov/provider_architecture_template

1.0 1.0 0.0 1022 KB

A production ready flutter application template for the provider architecture.

Kotlin 0.43% Shell 0.15% Swift 0.40% Objective-C 0.04% Dart 98.98%

provider_architecture_template's Introduction

provider_start

A production ready flutter application template for the provider architecture.

Inspiration

  • This project is a starting point for a Flutter application using the provider architecture.
  • This project heavily uses the flutter tutorials and snippets of the filled stacks YouTube channel.
  • Feel free to send in Pull Requests to improve the application.

Filled Stacks Links:

Folder structure

.
├── core
│   ├── constant
│   ├── data_sources
│   ├── enums
│   ├── exceptions
│   ├── localization
│   ├── managers
│   ├── mixins
│   ├── models
│   ├── repositories
│   ├── services
│   ├── utils
│   └── view_models
└── ui
    ├── shared
    ├── views
    └── widgets

Features

Master branch

  • bottom navigation bar
  • intuitive UI router
  • script for auto formatting on commits
  • localization
  • validation mixin for forms
  • json serialization
  • auth service example
  • dialog service
  • connectivity service
  • hardware info service
  • http service
  • navigation service
  • key storage service
  • local storage service (NoSQL)
  • system light/dark theme support
  • platform adaptive widgets
  • life cycle manager to start/stop background services
  • app settings launcher
  • custom fonts
  • custom app icons
  • custom native splash screen
  • responsive views
  • unit tests

Geolocator branch

  • location service
  • location permission service

Example pages included

  • Home View (Renders a list of posts fetched from JSON place holder API)
  • Login View (Form that simulates user login and form validation)
  • Main View (View that handles tab navigation)
  • Splash View (Initial loading screen that uses flare animations)
  • Post Details (Dynamic view that loads the post's user information)
  • Settings View (Example view that launches app settings and signs out user)

Getting started

  • run chmod +x ./format.sh && ./format.sh to setup git pre commit formatting or
  • run chmod +x ./manual_format.sh and run ./manual_format.sh whenever you want to format the dart code
  • run flutter packages pub run build_runner build --delete-conflicting-outputs if you plan to add/change any serializers once
  • run flutter packages pub run build_runner watch --delete-conflicting-outputs if you plan to add/change any serializers multiple times

Adding support for another language

  • Find the language local code from here codes
  • Inside of lib/local_setup.dart add the local code to supportedLocalCodes
  • Add the local code to the CFBundleLocalizations array in ios/Runner/Info.plist
  • Create a <local>.json file under assets/lang/ and fill out every value for your language
  • Run flutter clean inside you lib apps directory if flutter complains
  • There is also a different way to implement locals using the intl package. An example on how to do so can be found here

Adding app icon

  • Change icon assets/images/logo.png to another image
  • If new icon has a different path update flutter_icons: in the pubspec.yaml file
  • Run flutter pub get and then flutter pub run flutter_launcher_icons:main

Adding another model

Simple model

  • Create a <YOUR_MODEL>.dart under core/models/<YOUR_MODEL>/<YOUR_MODEL>.dart
  • Copy the AlertRequest from core/models/alert_request/alert_request.dart and replace all the class model names with <YOUR_MODEL>
  • Add your own custom getter values.
  • Add a part file. Ex: <YOUR_MODEL>.g.dart above the class
  • Run flutter packages pub run build_runner build --delete-conflicting-outputs to build your new model

Serializable model

  • Create a <YOUR_MODEL>.dart under core/models/<YOUR_MODEL>/<YOUR_MODEL>.dart
  • Copy the User from core/models/user/user.dart and replace all the class model names with <YOUR_MODEL>
  • Add your own custom getter values.
  • Add <YOUR_MODEL> to the list in @SerializersFor class constructor found under core/models/serializer.dart
  • Run flutter packages pub run build_runner build --delete-conflicting-outputs to build your new model

provider_architecture_template's People

Contributors

ferrarafer avatar victoruvarov avatar

Stargazers

 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.