Giter VIP home page Giter VIP logo

bloc-architecture-flutter's Introduction

Example BLoC Architecture

Example project to explore the BLoC architecture and learn Flutter/Dart

What's about?

The aim of this project is to learn Flutter and BLoC architecture, as well as keeping things simple, secure while using good software development practices.

What I should know

If you want to clone this project and try it out, you should follow the next steps:

API KEY

Create an assets folder juts in the root of this project, and inside it, you would need to store the secrets.json file.

The IMDB API Key could be obtained from this link

secrets.json:

{
  "api_key": "YOUR_API_KEY"
}

How to generate the automatic JSON parsing code?

If the files inside models/ folder are changed, we would need to run:

$ flutter packages pub run build_runner watch

In order to automatically generate the .g files, that would contain the necessary code for JSON parsing given a model.

What's done & left to do?

  • BLoC (Business Logic Component) architecture
  • JSON Serialization
  • Load a list retrieved from a web service
  • Hide Secret API Key
  • Business models & Data models
  • Mapper between models
  • Open detail when clicking on an item
  • Unit tests
  • Widget tests
  • Code coverage report
  • Check that code style is following most of Dart/Flutter specs

Current dependencies added at pubspec.yaml:

dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^0.1.2
  rxdart: ^0.18.0
  http: ^0.12.0+1
  json_annotation: ^2.0.0

dev_dependencies:
  flutter_test:
    sdk: flutter
  build_runner: ^1.0.0
  json_serializable: ^2.0.0

Resources used:

In order to work with this project I will be following and merging these different articles:

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.