felangel / sealed_flutter_bloc
Showing 9 of 92 files from the diff.
Other files ignored by Codecov
pubspec.yaml has changed.
CHANGELOG.md has changed.
scripts/run_ci.sh was deleted.
README.md has changed.

@@ -4,6 +4,7 @@
Loading
4 4
import 'package:flutter_bloc/flutter_bloc.dart';
5 5
import 'package:sealed_unions/sealed_unions.dart';
6 6
7 +
/// {@macro sealedblocwidgetbuilder}
7 8
typedef WidgetSealedJoin6<A, B, C, D, E, F> = Widget Function(
8 9
  Widget Function(A) mapFirst,
9 10
  Widget Function(B) mapSecond,
@@ -13,6 +14,7 @@
Loading
13 14
  Widget Function(F) mapSixth,
14 15
);
15 16
17 +
/// {@macro sealedblocwidgetbuilder}
16 18
typedef SealedBlocWidgetBuilder6<S extends Union6<A, B, C, D, E, F>, A, B, C, D,
17 19
        E, F>
18 20
    = Widget Function(
@@ -22,22 +24,21 @@
Loading
22 24
23 25
/// {@macro sealedblocbuilder}
24 26
class SealedBlocBuilder6<
25 -
    Cubit extends bloc.Cubit<State>,
27 +
    Bloc extends bloc.BlocBase<State>,
26 28
    State extends Union6<A, B, C, D, E, F>,
27 29
    A,
28 30
    B,
29 31
    C,
30 32
    D,
31 33
    E,
32 -
    F> extends BlocBuilderBase<Cubit, State> {
34 +
    F> extends BlocBuilderBase<Bloc, State> {
33 35
  /// {@macro sealedblocbuilder}
34 36
  const SealedBlocBuilder6({
35 -
    Key key,
36 -
    @required this.builder,
37 -
    Cubit cubit,
38 -
    BlocBuilderCondition<State> buildWhen,
39 -
  })  : assert(builder != null),
40 -
        super(key: key, cubit: cubit, buildWhen: buildWhen);
37 +
    Key? key,
38 +
    required this.builder,
39 +
    Bloc? bloc,
40 +
    BlocBuilderCondition<State>? buildWhen,
41 +
  }) : super(key: key, bloc: bloc, buildWhen: buildWhen);
41 42
42 43
  /// {@macro sealedblocwidgetbuilder}
43 44
  final SealedBlocWidgetBuilder6<State, A, B, C, D, E, F> builder;

@@ -4,10 +4,12 @@
Loading
4 4
import 'package:flutter_bloc/flutter_bloc.dart';
5 5
import 'package:sealed_unions/sealed_unions.dart';
6 6
7 +
/// {@macro sealedblocwidgetbuilder}
7 8
typedef WidgetSealedJoin1<A> = Widget Function(
8 9
  Widget Function(A) mapFirst,
9 10
);
10 11
12 +
/// {@macro sealedblocwidgetbuilder}
11 13
typedef SealedBlocWidgetBuilder1<S extends Union0<A>, A> = Widget Function(
12 14
  BuildContext context,
13 15
  WidgetSealedJoin1<A>,
@@ -15,7 +17,7 @@
Loading
15 17
16 18
/// {@template sealedblocbuilder}
17 19
/// `SealedBlocBuilder` is a special type of [BlocBuilder] which
18 -
/// ensures that every possible [Cubit] state has a corresponding [Widget].
20 +
/// ensures that every possible [Bloc] state has a corresponding [Widget].
19 21
/// ```dart
20 22
/// SealedBlocBuilder3<MyBloc, MyState, Loading, Success, Failure>(
21 23
///   builder: (context, states) => states(
@@ -26,20 +28,19 @@
Loading
26 28
/// )
27 29
/// ```
28 30
/// {@endtemplate}
29 -
class SealedBlocBuilder1<Cubit extends bloc.Cubit<State>,
30 -
    State extends Union0<A>, A> extends BlocBuilderBase<Cubit, State> {
31 +
class SealedBlocBuilder1<Bloc extends bloc.BlocBase<State>,
32 +
    State extends Union0<A>, A> extends BlocBuilderBase<Bloc, State> {
31 33
  /// {@macro sealedblocbuilder}
32 34
  const SealedBlocBuilder1({
33 -
    Key key,
34 -
    @required this.builder,
35 -
    Cubit cubit,
36 -
    BlocBuilderCondition<State> buildWhen,
37 -
  })  : assert(builder != null),
38 -
        super(key: key, cubit: cubit, buildWhen: buildWhen);
35 +
    Key? key,
36 +
    required this.builder,
37 +
    Bloc? bloc,
38 +
    BlocBuilderCondition<State>? buildWhen,
39 +
  }) : super(key: key, bloc: bloc, buildWhen: buildWhen);
39 40
40 41
  /// {@template sealedblocwidgetbuilder}
41 42
  /// [builder] will be called with a [BuildContext] and the
42 -
  /// union of all [Cubit] states and must return a [Widget]
43 +
  /// union of all [Bloc] states and must return a [Widget]
43 44
  /// for each possible state.
44 45
  /// {@endtemplate}
45 46
  final SealedBlocWidgetBuilder1<State, A> builder;

@@ -4,11 +4,13 @@
Loading
4 4
import 'package:flutter_bloc/flutter_bloc.dart';
5 5
import 'package:sealed_unions/sealed_unions.dart';
6 6
7 +
/// {@macro sealedblocwidgetbuilder}
7 8
typedef WidgetSealedJoin2<A, B> = Widget Function(
8 9
  Widget Function(A) mapFirst,
9 10
  Widget Function(B) mapSecond,
10 11
);
11 12
13 +
/// {@macro sealedblocwidgetbuilder}
12 14
typedef SealedBlocWidgetBuilder2<S extends Union2<A, B>, A, B> = Widget
13 15
    Function(
14 16
  BuildContext context,
@@ -16,18 +18,17 @@
Loading
16 18
);
17 19
18 20
/// {@macro sealedblocbuilder}
19 -
class SealedBlocBuilder2<Cubit extends bloc.Cubit<State>,
20 -
    State extends Union2<A, B>, A, B> extends BlocBuilderBase<Cubit, State> {
21 +
class SealedBlocBuilder2<Bloc extends bloc.BlocBase<State>,
22 +
    State extends Union2<A, B>, A, B> extends BlocBuilderBase<Bloc, State> {
21 23
  /// {@macro sealedblocbuilder}
22 24
  const SealedBlocBuilder2({
23 -
    Key key,
24 -
    @required this.builder,
25 -
    Cubit cubit,
26 -
    BlocBuilderCondition<State> buildWhen,
27 -
  })  : assert(builder != null),
28 -
        super(key: key, cubit: cubit, buildWhen: buildWhen);
25 +
    Key? key,
26 +
    required this.builder,
27 +
    Bloc? bloc,
28 +
    BlocBuilderCondition<State>? buildWhen,
29 +
  }) : super(key: key, bloc: bloc, buildWhen: buildWhen);
29 30
30 -
  /// {@macro sealedblocwidgetbuilder}
31 +
  /// {@m?acro sealedblocwidgetbuilder}
31 32
  final SealedBlocWidgetBuilder2<State, A, B> builder;
32 33
33 34
  @override

@@ -4,6 +4,7 @@
Loading
4 4
import 'package:flutter_bloc/flutter_bloc.dart';
5 5
import 'package:sealed_unions/sealed_unions.dart';
6 6
7 +
/// {@macro sealedblocwidgetbuilder}
7 8
typedef WidgetSealedJoin4<A, B, C, D> = Widget Function(
8 9
  Widget Function(A) mapFirst,
9 10
  Widget Function(B) mapSecond,
@@ -11,6 +12,7 @@
Loading
11 12
  Widget Function(D) mapFourth,
12 13
);
13 14
15 +
/// {@macro sealedblocwidgetbuilder}
14 16
typedef SealedBlocWidgetBuilder4<S extends Union4<A, B, C, D>, A, B, C, D>
15 17
    = Widget Function(
16 18
  BuildContext context,
@@ -19,20 +21,19 @@
Loading
19 21
20 22
/// {@macro sealedblocbuilder}
21 23
class SealedBlocBuilder4<
22 -
    Cubit extends bloc.Cubit<State>,
24 +
    Bloc extends bloc.BlocBase<State>,
23 25
    State extends Union4<A, B, C, D>,
24 26
    A,
25 27
    B,
26 28
    C,
27 -
    D> extends BlocBuilderBase<Cubit, State> {
29 +
    D> extends BlocBuilderBase<Bloc, State> {
28 30
  /// {@macro sealedblocbuilder}
29 31
  const SealedBlocBuilder4({
30 -
    Key key,
31 -
    @required this.builder,
32 -
    Cubit cubit,
33 -
    BlocBuilderCondition<State> buildWhen,
34 -
  })  : assert(builder != null),
35 -
        super(key: key, cubit: cubit, buildWhen: buildWhen);
32 +
    Key? key,
33 +
    required this.builder,
34 +
    Bloc? bloc,
35 +
    BlocBuilderCondition<State>? buildWhen,
36 +
  }) : super(key: key, bloc: bloc, buildWhen: buildWhen);
36 37
37 38
  /// {@macro sealedblocwidgetbuilder}
38 39
  final SealedBlocWidgetBuilder4<State, A, B, C, D> builder;

@@ -4,6 +4,7 @@
Loading
4 4
import 'package:flutter_bloc/flutter_bloc.dart';
5 5
import 'package:sealed_unions/sealed_unions.dart';
6 6
7 +
/// {@macro sealedblocwidgetbuilder}
7 8
typedef WidgetSealedJoin9<A, B, C, D, E, F, G, H, I> = Widget Function(
8 9
  Widget Function(A) mapFirst,
9 10
  Widget Function(B) mapSecond,
@@ -16,6 +17,7 @@
Loading
16 17
  Widget Function(I) mapNinth,
17 18
);
18 19
20 +
/// {@macro sealedblocwidgetbuilder}
19 21
typedef SealedBlocWidgetBuilder9<S extends Union9<A, B, C, D, E, F, G, H, I>, A,
20 22
        B, C, D, E, F, G, H, I>
21 23
    = Widget Function(
@@ -25,7 +27,7 @@
Loading
25 27
26 28
/// {@macro sealedblocbuilder}
27 29
class SealedBlocBuilder9<
28 -
    Cubit extends bloc.Cubit<State>,
30 +
    Bloc extends bloc.BlocBase<State>,
29 31
    State extends Union9<A, B, C, D, E, F, G, H, I>,
30 32
    A,
31 33
    B,
@@ -35,15 +37,14 @@
Loading
35 37
    F,
36 38
    G,
37 39
    H,
38 -
    I> extends BlocBuilderBase<Cubit, State> {
40 +
    I> extends BlocBuilderBase<Bloc, State> {
39 41
  /// {@macro sealedblocbuilder}
40 42
  const SealedBlocBuilder9({
41 -
    Key key,
42 -
    @required this.builder,
43 -
    Cubit cubit,
44 -
    BlocBuilderCondition<State> buildWhen,
45 -
  })  : assert(builder != null),
46 -
        super(key: key, cubit: cubit, buildWhen: buildWhen);
43 +
    Key? key,
44 +
    required this.builder,
45 +
    Bloc? bloc,
46 +
    BlocBuilderCondition<State>? buildWhen,
47 +
  }) : super(key: key, bloc: bloc, buildWhen: buildWhen);
47 48
48 49
  /// {@macro sealedblocwidgetbuilder}
49 50
  final SealedBlocWidgetBuilder9<State, A, B, C, D, E, F, G, H, I> builder;

@@ -4,6 +4,7 @@
Loading
4 4
import 'package:flutter_bloc/flutter_bloc.dart';
5 5
import 'package:sealed_unions/sealed_unions.dart';
6 6
7 +
/// {@macro sealedblocwidgetbuilder}
7 8
typedef WidgetSealedJoin5<A, B, C, D, E> = Widget Function(
8 9
  Widget Function(A) mapFirst,
9 10
  Widget Function(B) mapSecond,
@@ -12,6 +13,7 @@
Loading
12 13
  Widget Function(E) mapFifth,
13 14
);
14 15
16 +
/// {@macro sealedblocwidgetbuilder}
15 17
typedef SealedBlocWidgetBuilder5<S extends Union5<A, B, C, D, E>, A, B, C, D, E>
16 18
    = Widget Function(
17 19
  BuildContext context,
@@ -20,21 +22,20 @@
Loading
20 22
21 23
/// {@macro sealedblocbuilder}
22 24
class SealedBlocBuilder5<
23 -
    Cubit extends bloc.Cubit<State>,
25 +
    Bloc extends bloc.BlocBase<State>,
24 26
    State extends Union5<A, B, C, D, E>,
25 27
    A,
26 28
    B,
27 29
    C,
28 30
    D,
29 -
    E> extends BlocBuilderBase<Cubit, State> {
31 +
    E> extends BlocBuilderBase<Bloc, State> {
30 32
  /// {@macro sealedblocbuilder}
31 33
  const SealedBlocBuilder5({
32 -
    Key key,
33 -
    @required this.builder,
34 -
    Cubit cubit,
35 -
    BlocBuilderCondition<State> buildWhen,
36 -
  })  : assert(builder != null),
37 -
        super(key: key, cubit: cubit, buildWhen: buildWhen);
34 +
    Key? key,
35 +
    required this.builder,
36 +
    Bloc? bloc,
37 +
    BlocBuilderCondition<State>? buildWhen,
38 +
  }) : super(key: key, bloc: bloc, buildWhen: buildWhen);
38 39
39 40
  /// {@macro sealedblocwidgetbuilder}
40 41
  final SealedBlocWidgetBuilder5<State, A, B, C, D, E> builder;

@@ -4,6 +4,7 @@
Loading
4 4
import 'package:flutter_bloc/flutter_bloc.dart';
5 5
import 'package:sealed_unions/sealed_unions.dart';
6 6
7 +
/// {@macro sealedblocwidgetbuilder}
7 8
typedef WidgetSealedJoin8<A, B, C, D, E, F, G, H> = Widget Function(
8 9
  Widget Function(A) mapFirst,
9 10
  Widget Function(B) mapSecond,
@@ -15,6 +16,7 @@
Loading
15 16
  Widget Function(H) mapEighth,
16 17
);
17 18
19 +
/// {@macro sealedblocwidgetbuilder}
18 20
typedef SealedBlocWidgetBuilder8<S extends Union8<A, B, C, D, E, F, G, H>, A, B,
19 21
        C, D, E, F, G, H>
20 22
    = Widget Function(
@@ -24,7 +26,7 @@
Loading
24 26
25 27
/// {@macro sealedblocbuilder}
26 28
class SealedBlocBuilder8<
27 -
    Cubit extends bloc.Cubit<State>,
29 +
    Bloc extends bloc.BlocBase<State>,
28 30
    State extends Union8<A, B, C, D, E, F, G, H>,
29 31
    A,
30 32
    B,
@@ -33,15 +35,14 @@
Loading
33 35
    E,
34 36
    F,
35 37
    G,
36 -
    H> extends BlocBuilderBase<Cubit, State> {
38 +
    H> extends BlocBuilderBase<Bloc, State> {
37 39
  /// {@macro sealedblocbuilder}
38 40
  const SealedBlocBuilder8({
39 -
    Key key,
40 -
    @required this.builder,
41 -
    Cubit cubit,
42 -
    BlocBuilderCondition<State> buildWhen,
43 -
  })  : assert(builder != null),
44 -
        super(key: key, cubit: cubit, buildWhen: buildWhen);
41 +
    Key? key,
42 +
    required this.builder,
43 +
    Bloc? bloc,
44 +
    BlocBuilderCondition<State>? buildWhen,
45 +
  }) : super(key: key, bloc: bloc, buildWhen: buildWhen);
45 46
46 47
  /// {@macro sealedblocwidgetbuilder}
47 48
  final SealedBlocWidgetBuilder8<State, A, B, C, D, E, F, G, H> builder;

@@ -4,6 +4,7 @@
Loading
4 4
import 'package:flutter_bloc/flutter_bloc.dart';
5 5
import 'package:sealed_unions/sealed_unions.dart';
6 6
7 +
/// {@macro sealedblocwidgetbuilder}
7 8
typedef WidgetSealedJoin7<A, B, C, D, E, F, G> = Widget Function(
8 9
  Widget Function(A) mapFirst,
9 10
  Widget Function(B) mapSecond,
@@ -14,6 +15,7 @@
Loading
14 15
  Widget Function(G) mapSeventh,
15 16
);
16 17
18 +
/// {@macro sealedblocwidgetbuilder}
17 19
typedef SealedBlocWidgetBuilder7<S extends Union7<A, B, C, D, E, F, G>, A, B, C,
18 20
        D, E, F, G>
19 21
    = Widget Function(
@@ -23,7 +25,7 @@
Loading
23 25
24 26
/// {@macro sealedblocbuilder}
25 27
class SealedBlocBuilder7<
26 -
    Cubit extends bloc.Cubit<State>,
28 +
    Bloc extends bloc.BlocBase<State>,
27 29
    State extends Union7<A, B, C, D, E, F, G>,
28 30
    A,
29 31
    B,
@@ -31,15 +33,14 @@
Loading
31 33
    D,
32 34
    E,
33 35
    F,
34 -
    G> extends BlocBuilderBase<Cubit, State> {
36 +
    G> extends BlocBuilderBase<Bloc, State> {
35 37
  /// {@macro sealedblocbuilder}
36 38
  const SealedBlocBuilder7({
37 -
    Key key,
38 -
    @required this.builder,
39 -
    Cubit cubit,
40 -
    BlocBuilderCondition<State> buildWhen,
41 -
  })  : assert(builder != null),
42 -
        super(key: key, cubit: cubit, buildWhen: buildWhen);
39 +
    Key? key,
40 +
    required this.builder,
41 +
    Bloc? bloc,
42 +
    BlocBuilderCondition<State>? buildWhen,
43 +
  }) : super(key: key, bloc: bloc, buildWhen: buildWhen);
43 44
44 45
  /// {@macro sealedblocwidgetbuilder}
45 46
  final SealedBlocWidgetBuilder7<State, A, B, C, D, E, F, G> builder;

@@ -4,12 +4,14 @@
Loading
4 4
import 'package:flutter_bloc/flutter_bloc.dart';
5 5
import 'package:sealed_unions/sealed_unions.dart';
6 6
7 +
/// {@macro sealedblocwidgetbuilder}
7 8
typedef WidgetSealedJoin3<A, B, C> = Widget Function(
8 9
  Widget Function(A) mapFirst,
9 10
  Widget Function(B) mapSecond,
10 11
  Widget Function(C) mapThird,
11 12
);
12 13
14 +
/// {@macro sealedblocwidgetbuilder}
13 15
typedef SealedBlocWidgetBuilder3<S extends Union3<A, B, C>, A, B, C> = Widget
14 16
    Function(
15 17
  BuildContext context,
@@ -18,19 +20,18 @@
Loading
18 20
19 21
/// {@macro sealedblocbuilder}
20 22
class SealedBlocBuilder3<
21 -
    Cubit extends bloc.Cubit<State>,
23 +
    Bloc extends bloc.BlocBase<State>,
22 24
    State extends Union3<A, B, C>,
23 25
    A,
24 26
    B,
25 -
    C> extends BlocBuilderBase<Cubit, State> {
27 +
    C> extends BlocBuilderBase<Bloc, State> {
26 28
  /// {@macro sealedblocbuilder}
27 29
  const SealedBlocBuilder3({
28 -
    Key key,
29 -
    @required this.builder,
30 -
    Cubit cubit,
31 -
    BlocBuilderCondition<State> buildWhen,
32 -
  })  : assert(builder != null),
33 -
        super(key: key, cubit: cubit, buildWhen: buildWhen);
30 +
    Key? key,
31 +
    required this.builder,
32 +
    Bloc? bloc,
33 +
    BlocBuilderCondition<State>? buildWhen,
34 +
  }) : super(key: key, bloc: bloc, buildWhen: buildWhen);
34 35
35 36
  /// {@macro sealedblocwidgetbuilder}
36 37
  final SealedBlocWidgetBuilder3<State, A, B, C> builder;
Files Coverage
lib/src/sealed_bloc_builder 100.00%
Project Totals (9 files) 100.00%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading