Giter Club home page Giter Club logo

flutter_redux_boilerplate's Introduction

flutter_redux_boilerplate

A Flutter application boilerplate, with Redux included.

Motivation

Coming from a React Native background, using Redux in dart feels rather awkward. This project's purpose is to provide a well-structured starter project, with an architeture that resembles Redux.js'.

This boilerplate includes:

Structure

This project is split into a few directories:

Store directory has only one file (store.dart), which is used to initialize the Store. It makes use of some middlewares, which are imported from midddleware directory. There, you will find middleware.dart. That file's purpose is to return an array of middlewares, as well as initializing a persistor (read redux_persist.dart docs for more info).

Models directory holds objects used across the app, such as State objects. app_state.dart defines the Store's main State, which has other State objects (like auth_state.dart) as its properties. This way, you will be able to access to State just like you would in Redux.js.

AppState{
    auth: AuthState {
        // AuthState props...   
    },
}

(you can then read that in your app with store.state.auth.{prop})

Reducers are built with redux.dart's helper functions. You can read about that here.

Screens, containers and presentation directories just hold widgets. They're separated for clarity matters.

Containers are widgets which access to State data via flutter_redux.dart connector widgets. Presentation widgets just receive and show props (usually coming from container widgets). Screens are presentation widgets too, with the difference they hold other widgets to form screens. They're rendered in main.dart routes.

Styles directory holds some Maps used to style the app consistently.

main.dart is the application's entry point. There you set up your StoreProvider and your routes.

Inspiration

This has been inspired by this delightful projects:

flutter_redux_boilerplate's People

Contributors

pitriq 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.