Giter Site home page Giter Site logo

insurdao / flutter-boilerplate Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 99 KB

Extreme minimalist flutter state framework, inspired by fish-redux from Alibaba

Makefile 0.27% Kotlin 0.26% Swift 0.85% Objective-C 0.08% Dart 29.46% HTML 7.81% CMake 16.83% C++ 42.93% C 1.51%

flutter-boilerplate's Introduction

insur

Architecture

See simple state article in the resources section. The widgets that listen to the state and rebuild on a change are generally called builder widgets. We can hide futures behind a ValueNotifier, but can be done with streams as well.

If the UI needs to listen to state that’s in a ValueNotifier, then you should use a ValueListenableBuilder widget. The long name is rather unfortunate because it’s job is quite simple. Just rebuild a little section of the UI with the new value.

  • getit: to access the state
  • config.dart: it contains all we need in most of the application.
  • base.dart: all we need for our state framework :)
  • every page is a class that contains effect, reducer and state, and we
  • register pages in the app.dart
  • so from any component can access other pages state we also can have a global common state
  • views access 'page' using getit
  • state only function is 'apply' to change for a new copy of the state, that is in the 'value' variable from the
  • access to database, API, etc... only in effect.
  • effects, reducers and actions only contain functions, but the state is indeed a class, once it's the only part that we need to keep data in the memory. Following this pattern we go for a more functional approach.
  • to change the state we have ONLY one function, 'apply', and business logic is concentrated only on reducers.

Graphql

Use the graphqlbin to play. You can point to https://graphql.bitquery.io .

File Structure

  • config:
    • boot.dart: all the initalizations needed when the application starts

Resources

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.