Skip to content

Commit 3c7af92

Browse files
committed
feat(create-category): add create category events
- Define base CreateCategoryEvent - Add name and description events - Include icon URL
1 parent d083f59 commit 3c7af92

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
part of 'create_category_bloc.dart';
2+
3+
/// Base class for all events related to the [CreateCategoryBloc].
4+
sealed class CreateCategoryEvent extends Equatable {
5+
const CreateCategoryEvent();
6+
7+
@override
8+
List<Object> get props => [];
9+
}
10+
11+
/// Event for when the category's name is changed.
12+
final class CreateCategoryNameChanged extends CreateCategoryEvent {
13+
const CreateCategoryNameChanged(this.name);
14+
final String name;
15+
@override
16+
List<Object> get props => [name];
17+
}
18+
19+
/// Event for when the category's description is changed.
20+
final class CreateCategoryDescriptionChanged extends CreateCategoryEvent {
21+
const CreateCategoryDescriptionChanged(this.description);
22+
final String description;
23+
@override
24+
List<Object> get props => [description];
25+
}
26+
27+
/// Event for when the category's icon URL is changed.
28+
final class CreateCategoryIconUrlChanged extends CreateCategoryEvent {
29+
const CreateCategoryIconUrlChanged(this.iconUrl);
30+
final String iconUrl;
31+
@override
32+
List<Object> get props => [iconUrl];
33+
}
34+
35+
/// Event to signal that the form should be submitted.
36+
final class CreateCategorySubmitted extends CreateCategoryEvent {
37+
const CreateCategorySubmitted();
38+
}

0 commit comments

Comments
 (0)