Coder Social home page Coder Social logo

alazzurri / flutter-clean-architecture-demo-w-realtime-database Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rohankandwal/flutter-clean-architecture-demo-w-realtime-database

0.0 0.0 0.0 75 KB

Flutter Clean Architecture using BLoC, Get_It, & Hive Db

Shell 1.15% Ruby 2.91% Objective-C 3.09% Kotlin 0.30% Dart 91.67% Swift 0.87%

flutter-clean-architecture-demo-w-realtime-database's Introduction

Flutter Clean Architecture w/ BLoC, Get_It & Hive

App to showcase demo for how to have Clean Architecture in Flutter with Get_It for dependency injection, BLoC for state maintainence and Hive for persisting data into database.

Getting Started

This project is to showcase how we can use Clean Architure in Flutter App. The architecture of the app is as follows -

Clean Architecture design

The existing folder structure of the project is as belows -

image

Stream<List<FeedModel>> getFeedPostsDatabaseStream() {
  if (_feedBox == null) {
    _initializeHiveBox();
  }
  return _feedBox!.watch().map((event) => List<FeedModel>.generate(
      _feedBox!.values.length, (index) => _feedBox!.getAt(index)!));
}

Above function will create a Stream to listen for all the changes in the database. This then can be used to update the values automatically on feed_screen.dart.

Run Project

flutter pub get

flutter pub run build_runner build --delete-conflicting-outputs 

Then you can run the project as usual

flutter-clean-architecture-demo-w-realtime-database's People

Contributors

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