GithubHelp home page GithubHelp logo

bloc_pattern's Introduction

BLOC - State Mangement Flutter

This project base on bloc implementation in your project.Call data from web Api an parse it respective model and use it on UI.

Geting Started

So before dive deep in this project , first we need to understand what Bloc is , why use it & how to use it.

What is Bloc & why use it?

accessibility text

Bloc component takes event as input, analyse it inside Bloc, and based on business logic it produces the corresponding state as output.

Think Bloc as a vending machine where you put the money and detail of product you want as input, and vending machine after analyzing and applying logic the business logic, like verifying whether the money is enough for the required item or not, it gives you the item you want as output

What are basic bloc component?

Event : Input from UI .

State : Output mean show data on UI

accessibility text

In our project lib folder , we have different layer Provider, Bloc, Model and Ui . Provider is repsonsible to provide data to application via api. In Model we have structure of our api repsonse , In Bloc we fire event get data from provider and provider it to ui.

When and event fire form ui it fetch call provider to provider data . In Bloc floder when event TodoFetch initiate form TodoList initialser it goes to bloc and call mapEventToState function. This event call todoProvider of our provider type and call getlist() method of provider. Method (getlist) call getListOfUser from api .

Once result return form api , the state called FetchedTodoSuccessedState and data save it state.

#Project Dependancies:

bloc_pattern's People

Contributors

raonomanvd avatar

Watchers

James Cloos 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.