News app in Flutter with BLOC pattern

Related tags

Templates NewsDaily
Overview

NewsApp

News app in Flutter with BLOC pattern

This example uses a CustomScrollView, JSON Rest API, BottonNavigationBar,SliverList, ClipRRect, Card, Progress Indicator, NetworkImage, Card, Column, Row, Container, InkWell, BoxDecoration.

Library

Bloc pattern

I used this pattern to design this application.

class NewsBloc {
  final _repository = Repository();
  final _newsFetcher = PublishSubject<NewsModel>();
  final _newsSearchFetcher = PublishSubject<NewsModel>();
  final _newsLikeFetcher = PublishSubject<NewsModel>();

  Observable<NewsModel> get allNews => _newsFetcher.stream;
  Observable<NewsModel> get searchNews => _newsSearchFetcher.stream;
  Observable<NewsModel> get likeNews => _newsLikeFetcher.stream;

  fetchLikedNews() async {
    NewsModel newsModel = await _repository.fetchLikedNews();
    _newsLikeFetcher.sink.add(newsModel);
  }

  fetchAllNews() async {
    NewsModel newsModel = await _repository.fetchAllNews();
    _newsFetcher.sink.add(newsModel);
  }

  fetchSearchNews() async {
    NewsModel newsModel = await _repository.fetchSearchNews();
    _newsSearchFetcher.sink.add(newsModel);
  }

  // Set and delete from Firestore liked
  addFavorit(val) async => _repository.addFavorit(val);
  deliteFavorit(val) async => _repository.deliteFavorit(val);

  dispose() {
    _newsLikeFetcher.close();
    _newsFetcher.close();
    _newsSearchFetcher.close();
  }
}

final bloc = NewsBloc();

Screenshots

Built With

  • Flutter - Crossplatform App Development Framework

License

Released under the MIT license

Author

Adeshchenko Kirill (Cyrill) (@kaparray)

You might also like...

A reference app in flutter using the BLoC pattern.

A reference app in flutter using the BLoC pattern.

flutter_dice A sample Flutter app that shows how to manage responsive state using the provider pattern. Concepts Illustrated Provider pattern Using a

Nov 18, 2022

A shopper Flutter app that use BloC pattern and CRUD operations with different ways(memory/sqlite/http)

A shopper Flutter app that use BloC pattern and CRUD operations with different ways(memory/sqlite/http)

The project is maintained by a non-profit organisation, along with an amazing collections of Flutter samples. We're trying to make continuous commits

Nov 10, 2022

Small Flutter app / social network / bloc pattern

azapp A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this is

Jun 9, 2022

Weather app using Bloc architecture pattern & generic HTTP client with interface implementation and much more for more detail read Readme

Weather app using Bloc architecture pattern & generic HTTP client with interface implementation and much more for more detail read Readme

weather Weather application for current weather, hourly forecast for 48 hours, Daily forecast for 7 days and national weather alerts. How to Run Insta

Oct 29, 2022

Bloc Pattern based weather app.

flutter_weather_app A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you star

Dec 29, 2021

A simple pair game made with Flutter, a custom library, BLoC and tunnel pattern.

A simple pair game made with Flutter, a custom library, BLoC and tunnel pattern.

Pair game A simple pair game created with Flutter. Article on Medium here: https://medium.com/@frmineoapps/a-simple-pair-game-made-with-flutter-a-cust

Jun 28, 2022

Demonstrates BLoC pattern in Flutter

Demonstrates BLoC pattern in Flutter

bloc_test A real-world example of using the BLoC pattern in Flutter. This app features a searchable list of users and demonstrates an elegant way to k

Jul 1, 2019

Clonning TIX ID with flutter with BLoC Pattern and RxDart

Clonning TIX ID with flutter with BLoC Pattern and RxDart

tix_app Cloning TIX ID in Flutter (Currently design only, next i will grab the movies from IMDB api for free) Feature Movies Movies Detail Ticket List

Aug 23, 2021
Comments
Owner
Kirill
Right now write code on Flutter. Mobile engineer. iOS/Android developer.
Kirill
News app in Flutter with BLOC pattern

NewsApp News app in Flutter with BLOC pattern This example uses a CustomScrollView, JSON Rest API, BottonNavigationBar,SliverList, ClipRRect, Card, Pr

Kirill 298 Dec 25, 2022
Flutter bloc example - An app for State management using BLoC pattern in Flutter

Flutter BLoC My first app for State management using BLoC pattern in Flutter Col

Harshil Patel 1 Jun 16, 2022
Google-news-app-redesign - Redesigned the ui of google news app with flutter

News app like Google news! ScreenShots If you face any problem with this project

Munem Sarker 3 Jun 23, 2022
Readky is a Free Flutter News App Starter Template that can help you develop a News application much faster.

Readky. Introduction Readky is a Free Flutter News App Starter Template that can help you develop a News application much faster. You just need to add

Muhammad Rezky Sulihin 54 Nov 26, 2022
News Reader App to fetch Articles from different news channels using Flutter.

News Reader This app is made using the Flutter framework. Its an mobile app to browse the News from different channels. This app uses an API provided

Sahil Kumar 84 Apr 13, 2022
Wall-street-news - News App work with HttpClient in Flutter

Flutter News App Demo This project is to showcase how to work with HttpClient in

TrαΊ§n VΔƒn NguyΓͺn 6 Oct 16, 2022
News App using News Api.

newsapp A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this

Shripad Joshi 0 Jan 6, 2022
News-Flutter - News Api with flutter

News App This app use News Api. If you want to run this code, please use your ow

Brandon Rojas 2 Apr 29, 2022
Zone is yet another Hacker News client, built with Flutter, Slidy, and Hacker News API.

Zone for Hacker News Zone is yet another Hacker News client, built with Flutter, Slidy, and Hacker News API. Setup Clone this repo to your machine Req

null 11 Feb 27, 2022
A starter kit for beginner learns with Bloc pattern, RxDart, sqflite, Fluro and Dio to architect a flutter project. This starter kit build an App Store app as a example

Flutter Starter Kit - App Store Example A starter kit for beginner learns with Bloc pattern, RxDart, sqflite, Fluro and Dio to architect a flutter pro

kw101 678 Jan 8, 2023