Skip to content

Commit 2ed1df0

Browse files
authored
Revert "update to flutter_bloc 0.14.0 override rxdart version"
1 parent c851b31 commit 2ed1df0

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

bloc_library/lib/blocs/simple_bloc_delegate.dart

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import 'package:bloc/bloc.dart';
88
// in order to handle transitions and errors from all Blocs.
99
class SimpleBlocDelegate extends BlocDelegate {
1010
@override
11-
void onTransition(Bloc bloc, Transition transition) {
12-
super.onTransition(bloc, transition);
11+
void onTransition(Transition transition) {
12+
super.onTransition(transition);
1313
print(transition);
1414
}
1515

1616
@override
17-
void onError(Bloc bloc, Object error, StackTrace stacktrace) {
18-
super.onError(bloc, error, stacktrace);
17+
void onError(Object error, StackTrace stacktrace) {
18+
super.onError(error, stacktrace);
1919
print(error);
2020
}
2121
}

bloc_library/lib/main.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ void main() {
1717
// BlocSupervisor oversees Blocs and delegates to BlocDelegate.
1818
// We can set the BlocSupervisor's delegate to an instance of `SimpleBlocDelegate`.
1919
// This will allow us to handle all transitions and errors in SimpleBlocDelegate.
20-
BlocSupervisor.delegate = SimpleBlocDelegate();
20+
BlocSupervisor().delegate = SimpleBlocDelegate();
2121
runApp(BlocApp());
2222
}
2323

bloc_library/pubspec.yaml

+13-7
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,24 @@ environment:
77
dependencies:
88
meta: ">=1.1.0 <2.0.0"
99
equatable: ^0.2.0
10-
flutter_bloc: ^0.14.0
11-
todos_app_core:
12-
path: ../todos_app_core
13-
todos_repository_simple:
14-
path: ../todos_repository_simple
10+
flutter_bloc: ^0.10.0
1511
flutter:
1612
sdk: flutter
1713

1814
dependency_overrides:
19-
rxdart: ^0.22.0
20-
15+
todos_app_core:
16+
git:
17+
url: https://github.com/felangel/flutter_architecture_samples
18+
path: todos_app_core
19+
ref: expose-repositories
20+
todos_repository_simple:
21+
git:
22+
url: https://github.com/felangel/flutter_architecture_samples
23+
path: todos_repository_simple
24+
ref: expose-repositories
25+
rxdart: '0.21.0'
2126
dev_dependencies:
27+
test: ^1.3.0
2228
mockito: ^3.0.0
2329
flutter_driver:
2430
sdk: flutter

bloc_library/test/blocs/simple_bloc_delegate_test.dart

+1-7
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,23 @@
33
// in the LICENSE file.
44

55
import 'package:flutter_test/flutter_test.dart';
6-
import 'package:mockito/mockito.dart';
76
import 'package:bloc_library/blocs/simple_bloc_delegate.dart';
87
import 'package:bloc/bloc.dart';
98
import 'dart:async';
109

11-
class MockBloc extends Mock implements Bloc {}
12-
1310
var printLog;
1411

1512
main() {
1613
group('SimpleBlocDelegate', () {
1714
SimpleBlocDelegate delegate;
18-
MockBloc bloc;
1915

2016
setUp(() {
2117
delegate = SimpleBlocDelegate();
22-
bloc = MockBloc();
2318
printLog = [];
2419
});
2520

2621
test('onTransition prints Transition', overridePrint(() {
2722
delegate.onTransition(
28-
bloc,
2923
Transition(currentState: 'A', event: 'E', nextState: 'B'),
3024
);
3125
expect(
@@ -35,7 +29,7 @@ main() {
3529
}));
3630

3731
test('onError prints Error', overridePrint(() {
38-
delegate.onError(bloc, 'whoops', null);
32+
delegate.onError('whoops', null);
3933
expect(
4034
printLog[0],
4135
'whoops',

0 commit comments

Comments
 (0)