Skip to content

Commit

Permalink
Upgraded RxDart to 0.23.1
Browse files Browse the repository at this point in the history
  • Loading branch information
SAGARSURI authored and sagarsurigojek committed Feb 29, 2020
1 parent 9fd2515 commit efc60b3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion lib/src/blocs/movie_detail_bloc.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:async';

import 'package:rxdart/rxdart.dart';

import '../models/trailer_model.dart';
import '../resources/repository.dart';

Expand All @@ -10,7 +11,7 @@ class MovieDetailBloc {
final _trailers = BehaviorSubject<Future<TrailerModel>>();

Function(int) get fetchTrailersById => _movieId.sink.add;
Observable<Future<TrailerModel>> get movieTrailers => _trailers.stream;
Stream<Future<TrailerModel>> get movieTrailers => _trailers.stream;

MovieDetailBloc() {
_movieId.stream.transform(_itemTransformer()).pipe(_trailers);
Expand Down
5 changes: 3 additions & 2 deletions lib/src/blocs/movies_bloc.dart
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import '../resources/repository.dart';
import 'package:rxdart/rxdart.dart';

import '../models/item_model.dart';
import '../resources/repository.dart';

class MoviesBloc {
final _repository = Repository();
final _moviesFetcher = PublishSubject<ItemModel>();

Observable<ItemModel> get allMovies => _moviesFetcher.stream;
Stream<ItemModel> get allMovies => _moviesFetcher.stream;

fetchAllMovies() async {
ItemModel itemModel = await _repository.fetchAllMovies();
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ dependencies:
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.2
rxdart: ^0.18.0
http: ^0.12.0+1
rxdart: ^0.23.1
http: ^0.12.0+4

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit efc60b3

Please sign in to comment.