Create Events authored by Nicholas Sarian's avatar Nicholas Sarian
Events are used to trigger state transitions in Bloc instances. When the UI adds an event to the Bloc, the Bloc's event listener gets triggered, which then emits state changes. These state transitions are used in the UI to change the page according to the action that was performed.
Events are simple classes with instance variables, a constructor, and a toString() method. Below is the source code from `create_player_event.dart`:
```dart
part of 'create_player_bloc.dart';
@immutable
abstract class CreatePlayerEvent {}
class SendCreatePlayerEvent extends CreatePlayerEvent {
final String name;
final String password;
final num crew;
final num major;
final num section;
SendCreatePlayerEvent(this.name, this.password, this.crew, this.major, this
.section);
@override
String toString() {
return 'SendCreatePlayerEvent(name: $name, '
'password: $password, crew: $crew, major: $major, section: $section)';
}
}
```
\ No newline at end of file