This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import '../resources/repository.dart'; | |
| import 'package:rxdart/rxdart.dart'; | |
| import '../models/item_model.dart'; | |
| import 'package:inject/inject.dart'; | |
| import 'bloc_base.dart'; | |
| class MoviesBloc extends BlocBase { | |
| final Repository _repository; | |
| PublishSubject<ItemModel> _moviesFetcher; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:async'; | |
| import 'package:rxdart/rxdart.dart'; | |
| import '../models/trailer_model.dart'; | |
| import '../resources/repository.dart'; | |
| import 'bloc_base.dart'; | |
| import 'package:inject/inject.dart'; | |
| class MovieDetailBloc extends BlocBase { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| abstract class BlocBase{ | |
| void dispose(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:inject/inject.dart'; | |
| import 'bloc_injector.inject.dart' as g; | |
| import '../app.dart'; | |
| import 'bloc_module.dart'; | |
| @Injector(const [BlocModule]) | |
| abstract class BlocInjector{ | |
| @provide | |
| App get app; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:inject/inject.dart'; | |
| import '../blocs/movies_bloc.dart'; | |
| import '../blocs/movie_detail_bloc.dart'; | |
| import '../blocs/bloc_base.dart'; | |
| import '../resources/repository.dart'; | |
| import '../resources/movie_api_provider.dart'; | |
| import 'package:http/http.dart' show Client; | |
| @module | |
| class BlocModule{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:flutter/material.dart'; | |
| import 'ui/login.dart'; | |
| import 'blocs/goals_bloc_provider.dart'; | |
| import 'blocs/login_bloc_provider.dart'; | |
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return LoginBlocProvider( | |
| child: GoalsBlocProvider( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:async'; | |
| class Bloc { | |
| //Our pizza house | |
| final order = StreamController<String>(); | |
| //Our order office | |
| Stream<String> get orderOffice => order.stream.transform(validateOrder); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @override | |
| void dispose() { | |
| bloc.dispose(); | |
| super.dispose(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @override | |
| void didChangeDependencies() { | |
| bloc = MovieDetailBlocProvider.of(context); | |
| bloc.fetchTrailersById(movieId); | |
| super.didChangeDependencies(); | |
| } |