Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

flutter flutter logo news app

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

flutter news app w/bloc pattern
flutter news app -dark
flutter news app – light

download the full project for this post from the following button

this source is fully free for all time

download as zip


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

Comments are closed.