Skip to content

Commit e320fbe

Browse files
committed
feat(create_source): add events for managing source creation
1 parent 27e4d58 commit e320fbe

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
part of 'create_source_bloc.dart';
2+
3+
/// Base class for all events related to the [CreateSourceBloc].
4+
sealed class CreateSourceEvent extends Equatable {
5+
const CreateSourceEvent();
6+
7+
@override
8+
List<Object?> get props => [];
9+
}
10+
11+
/// Event to signal that the data for dropdowns should be loaded.
12+
final class CreateSourceDataLoaded extends CreateSourceEvent {
13+
const CreateSourceDataLoaded();
14+
}
15+
16+
/// Event for when the source's name is changed.
17+
final class CreateSourceNameChanged extends CreateSourceEvent {
18+
const CreateSourceNameChanged(this.name);
19+
final String name;
20+
@override
21+
List<Object> get props => [name];
22+
}
23+
24+
/// Event for when the source's description is changed.
25+
final class CreateSourceDescriptionChanged extends CreateSourceEvent {
26+
const CreateSourceDescriptionChanged(this.description);
27+
final String description;
28+
@override
29+
List<Object> get props => [description];
30+
}
31+
32+
/// Event for when the source's URL is changed.
33+
final class CreateSourceUrlChanged extends CreateSourceEvent {
34+
const CreateSourceUrlChanged(this.url);
35+
final String url;
36+
@override
37+
List<Object> get props => [url];
38+
}
39+
40+
/// Event for when the source's type is changed.
41+
final class CreateSourceTypeChanged extends CreateSourceEvent {
42+
const CreateSourceTypeChanged(this.sourceType);
43+
final SourceType? sourceType;
44+
@override
45+
List<Object?> get props => [sourceType];
46+
}
47+
48+
/// Event for when the source's language is changed.
49+
final class CreateSourceLanguageChanged extends CreateSourceEvent {
50+
const CreateSourceLanguageChanged(this.language);
51+
final String language;
52+
@override
53+
List<Object> get props => [language];
54+
}
55+
56+
/// Event for when the source's headquarters is changed.
57+
final class CreateSourceHeadquartersChanged extends CreateSourceEvent {
58+
const CreateSourceHeadquartersChanged(this.headquarters);
59+
final Country? headquarters;
60+
@override
61+
List<Object?> get props => [headquarters];
62+
}
63+
64+
/// Event to signal that the form should be submitted.
65+
final class CreateSourceSubmitted extends CreateSourceEvent {
66+
const CreateSourceSubmitted();
67+
}

0 commit comments

Comments
 (0)