Skip to content

Commit 0cd75c1

Browse files
committed
Format top level files
1 parent 6d42853 commit 0cd75c1

File tree

3 files changed

+28
-9
lines changed

3 files changed

+28
-9
lines changed

lib/common/result/result.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ final class Success<T> extends Result<T> {
9191

9292
@override
9393
bool operator ==(Object other) {
94-
return identical(this, other) || other is Success<T> && runtimeType == other.runtimeType && value == other.value;
94+
return identical(this, other) ||
95+
other is Success<T> &&
96+
runtimeType == other.runtimeType &&
97+
value == other.value;
9598
}
9699

97100
@override
@@ -109,7 +112,10 @@ final class Failure<T> extends Result<T> {
109112

110113
@override
111114
bool operator ==(Object other) {
112-
return identical(this, other) || other is Failure<T> && runtimeType == other.runtimeType && other.error == error;
115+
return identical(this, other) ||
116+
other is Failure<T> &&
117+
runtimeType == other.runtimeType &&
118+
other.error == error;
113119
}
114120

115121
@override

lib/ui/blocful_widget.dart

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import 'package:flutter_bloc/flutter_bloc.dart';
1111
/// child: SomeWidget(),
1212
/// )
1313
/// ```dart
14-
abstract class BlocfulWidget<BLOC extends BlocPresentationMixin<STATE, EVENT>, STATE, EVENT> extends StatelessWidget {
14+
abstract class BlocfulWidget<BLOC extends BlocPresentationMixin<STATE, EVENT>,
15+
STATE, EVENT> extends StatelessWidget {
1516
/// Creates a [BlocfulWidget]
1617
const BlocfulWidget({this.onCreateBloc, super.key});
1718

@@ -27,17 +28,21 @@ abstract class BlocfulWidget<BLOC extends BlocPresentationMixin<STATE, EVENT>, S
2728
listener: onPresentationEvent,
2829
child: BlocConsumer<BLOC, STATE>(
2930
listenWhen: (previous, current) => previous != current,
30-
listener: (context, state) => listener(context, context.read<BLOC>(), state),
31-
builder: (context, state) => builder(context, context.read<BLOC>(), state),
31+
listener: (context, state) =>
32+
listener(context, context.read<BLOC>(), state),
33+
builder: (context, state) =>
34+
builder(context, context.read<BLOC>(), state),
3235
),
3336
),
3437
)
3538
: BlocPresentationListener<BLOC, EVENT>(
3639
listener: onPresentationEvent,
3740
child: BlocConsumer<BLOC, STATE>(
3841
listenWhen: (previous, current) => previous != current,
39-
listener: (context, state) => listener(context, context.read<BLOC>(), state),
40-
builder: (context, state) => builder(context, context.read<BLOC>(), state),
42+
listener: (context, state) =>
43+
listener(context, context.read<BLOC>(), state),
44+
builder: (context, state) =>
45+
builder(context, context.read<BLOC>(), state),
4146
),
4247
);
4348
}

test/common/result/try_call_test.dart

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,16 @@ void main() {
7171
parameterizedTest('Different exceptions result in different errors', [
7272
[Exception('woepsie'), const UnknownError()],
7373
[const FormatException('woepsie'), const UnknownError()],
74-
[c.ChopperHttpException(c.Response(http.Response('woepsie', 401), 'woepsie')), const AuthenticationFailedError()],
75-
[c.ChopperHttpException(c.Response(http.Response('woepsie', 500), 'woepsie')), const ServerError()],
74+
[
75+
c.ChopperHttpException(
76+
c.Response(http.Response('woepsie', 401), 'woepsie')),
77+
const AuthenticationFailedError()
78+
],
79+
[
80+
c.ChopperHttpException(
81+
c.Response(http.Response('woepsie', 500), 'woepsie')),
82+
const ServerError()
83+
],
7684
[ClientException('woepsie'), const NoInternetError()],
7785
[CheckedFromJsonException({}, null, 'woepsie', null), const ServerError()],
7886
], (Exception exception, BaseError expectedError) async {

0 commit comments

Comments
 (0)