Skip to content

Commit c1dfc5c

Browse files
committed
Fix feedback and pipeline
1 parent 67cca76 commit c1dfc5c

File tree

5 files changed

+22
-44
lines changed

5 files changed

+22
-44
lines changed

example/test/widget_test.dart

Lines changed: 0 additions & 30 deletions
This file was deleted.

lib/ui/blocful_widget.dart

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,20 @@ import 'package:flutter_bloc/flutter_bloc.dart';
66
///
77
/// Example:
88
/// /// ```dart
9-
/// BlocfulWidget<MyBloc, MyState, MyEvent>(
10-
/// onPresentationEvent: (context, event) => showSomeUIChange(),
11-
/// child: SomeWidget(),
12-
/// )
9+
/// class SomePage extends BlocfulWidget<SomeCubit, SomeState, SomeEvent> {
10+
/// const SomePage({super.key})
11+
/// : super(onCreateBloc: SomeCubit());
12+
13+
/// @override
14+
/// void onPresentationEvent(BuildContext context, SomeEvent event) {
15+
/// SomeFunction();
16+
/// }
17+
18+
/// @override
19+
/// Widget builder(BuildContext context, SomeCubit bloc, SomeState state) {
20+
/// return SomeWidget();
21+
/// }
22+
/// }
1323
/// ```dart
1424
abstract class BlocfulWidget<BLOC extends BlocPresentationMixin<STATE, EVENT>,
1525
STATE, EVENT> extends StatelessWidget {
@@ -27,7 +37,6 @@ abstract class BlocfulWidget<BLOC extends BlocPresentationMixin<STATE, EVENT>,
2737
child: BlocPresentationListener<BLOC, EVENT>(
2838
listener: onPresentationEvent,
2939
child: BlocConsumer<BLOC, STATE>(
30-
listenWhen: (previous, current) => previous != current,
3140
listener: (context, state) =>
3241
listener(context, context.read<BLOC>(), state),
3342
builder: (context, state) =>
@@ -38,7 +47,6 @@ abstract class BlocfulWidget<BLOC extends BlocPresentationMixin<STATE, EVENT>,
3847
: BlocPresentationListener<BLOC, EVENT>(
3948
listener: onPresentationEvent,
4049
child: BlocConsumer<BLOC, STATE>(
41-
listenWhen: (previous, current) => previous != current,
4250
listener: (context, state) =>
4351
listener(context, context.read<BLOC>(), state),
4452
builder: (context, state) =>

pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,5 +606,5 @@ packages:
606606
source: hosted
607607
version: "3.1.2"
608608
sdks:
609-
dart: ">=3.4.0 <4.0.0"
609+
dart: ">=3.5.0 <4.0.0"
610610
flutter: ">=3.22.0"

pubspec.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ homepage: https://dutchcodingcompany.com
55
repository: https://github.com/DutchCodingCompany/dcc_toolkit
66

77
environment:
8-
sdk: '>=3.4.0 <4.0.0'
8+
sdk: ">=3.5.0 <4.0.0"
99
flutter: ">=3.22.0"
1010

1111
dependencies:
@@ -27,7 +27,5 @@ dev_dependencies:
2727
parameterized_test: ^2.0.0
2828
very_good_analysis: ^6.0.0
2929

30-
3130
flutter:
3231
uses-material-design: true
33-

test/common/result/try_call_test.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,15 @@ void main() {
7373
[const FormatException('woepsie'), const UnknownError()],
7474
[
7575
c.ChopperHttpException(
76-
c.Response(http.Response('woepsie', 401), 'woepsie')),
77-
const AuthenticationFailedError()
76+
c.Response(http.Response('woepsie', 401), 'woepsie'),
77+
),
78+
const AuthenticationFailedError(),
7879
],
7980
[
8081
c.ChopperHttpException(
81-
c.Response(http.Response('woepsie', 500), 'woepsie')),
82-
const ServerError()
82+
c.Response(http.Response('woepsie', 500), 'woepsie'),
83+
),
84+
const ServerError(),
8385
],
8486
[ClientException('woepsie'), const NoInternetError()],
8587
[CheckedFromJsonException({}, null, 'woepsie', null), const ServerError()],

0 commit comments

Comments
 (0)