Skip to content

Commit 0af84e1

Browse files
committed
feat(edit_category): add EditCategory events
- Define events for the edit category bloc - Loaded, NameChanged, DescriptionChanged, etc
1 parent 99a69be commit 0af84e1

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
part of 'edit_category_bloc.dart';
2+
3+
/// Base class for all events related to the [EditCategoryBloc].
4+
sealed class EditCategoryEvent extends Equatable {
5+
const EditCategoryEvent();
6+
7+
@override
8+
List<Object> get props => [];
9+
}
10+
11+
/// Event to load the initial category data for editing.
12+
final class EditCategoryLoaded extends EditCategoryEvent {
13+
const EditCategoryLoaded();
14+
}
15+
16+
/// Event triggered when the category name input changes.
17+
final class EditCategoryNameChanged extends EditCategoryEvent {
18+
const EditCategoryNameChanged(this.name);
19+
20+
final String name;
21+
22+
@override
23+
List<Object> get props => [name];
24+
}
25+
26+
/// Event triggered when the category description input changes.
27+
final class EditCategoryDescriptionChanged extends EditCategoryEvent {
28+
const EditCategoryDescriptionChanged(this.description);
29+
30+
final String description;
31+
32+
@override
33+
List<Object> get props => [description];
34+
}
35+
36+
/// Event triggered when the category icon URL input changes.
37+
final class EditCategoryIconUrlChanged extends EditCategoryEvent {
38+
const EditCategoryIconUrlChanged(this.iconUrl);
39+
40+
final String iconUrl;
41+
42+
@override
43+
List<Object> get props => [iconUrl];
44+
}
45+
46+
/// Event to submit the edited category data.
47+
final class EditCategorySubmitted extends EditCategoryEvent {
48+
const EditCategorySubmitted();
49+
}

0 commit comments

Comments
 (0)