-
Notifications
You must be signed in to change notification settings - Fork 1
/
bloc_new.dart
50 lines (37 loc) · 1.29 KB
/
bloc_new.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import 'dart:async';
import 'package:fantasypl/features/leagues/presentation/bloc/administer/administer_league_event.dart';
import 'package:fantasypl/features/leagues/presentation/bloc/administer/administer_league_state.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
export 'package:fantasypl/features/leagues/presentation/bloc/administer/administer_league_event.dart';
export 'package:fantasypl/features/leagues/presentation/bloc/administer/administer_league_state.dart';
class $NAME$Bloc extends Bloc<$NAME$Event, $NAME$State> {
$NAME$Bloc() : super($NAME$State()) {
on<$NAME$PageCreatedEvent>(_on$NAME$PageCreatedEvent);
}
FutureOr<void> _on$NAME$PageCreatedEvent(event, Emitter<$NAME$State> emit) {
// TODO: Continue here
}
}
// TODO: Move the events to another file
$END$abstract class $NAME$Event {}
class $NAME$PageCreatedEvent extends $NAME$Event {}
// TODO: Move the state to another file
import 'package:meta/meta.dart';
@immutable
class $NAME$State {
final bool isLoading;
final bool isError;
$NAME$State({
this.isLoading = false,
this.isError = false,
});
$NAME$State copyWith({
bool? isLoading,
bool? isError,
}) {
return $NAME$State(
isLoading: isLoading ?? this.isLoading,
isError: isError ?? this.isError,
);
}
}