|
| 1 | +part of 'create_headline_bloc.dart'; |
| 2 | + |
| 3 | +/// Base class for all events related to the [CreateHeadlineBloc]. |
| 4 | +abstract class CreateHeadlineEvent extends Equatable { |
| 5 | + const CreateHeadlineEvent(); |
| 6 | + |
| 7 | + @override |
| 8 | + List<Object?> get props => []; |
| 9 | +} |
| 10 | + |
| 11 | +/// Event to signal that the data for dropdowns should be loaded. |
| 12 | +class CreateHeadlineDataLoaded extends CreateHeadlineEvent { |
| 13 | + const CreateHeadlineDataLoaded(); |
| 14 | +} |
| 15 | + |
| 16 | +/// Event for when the headline's title is changed. |
| 17 | +class CreateHeadlineTitleChanged extends CreateHeadlineEvent { |
| 18 | + const CreateHeadlineTitleChanged(this.title); |
| 19 | + final String title; |
| 20 | + @override |
| 21 | + List<Object> get props => [title]; |
| 22 | +} |
| 23 | + |
| 24 | +/// Event for when the headline's description is changed. |
| 25 | +class CreateHeadlineDescriptionChanged extends CreateHeadlineEvent { |
| 26 | + const CreateHeadlineDescriptionChanged(this.description); |
| 27 | + final String description; |
| 28 | + @override |
| 29 | + List<Object> get props => [description]; |
| 30 | +} |
| 31 | + |
| 32 | +/// Event for when the headline's URL is changed. |
| 33 | +class CreateHeadlineUrlChanged extends CreateHeadlineEvent { |
| 34 | + const CreateHeadlineUrlChanged(this.url); |
| 35 | + final String url; |
| 36 | + @override |
| 37 | + List<Object> get props => [url]; |
| 38 | +} |
| 39 | + |
| 40 | +/// Event for when the headline's image URL is changed. |
| 41 | +class CreateHeadlineImageUrlChanged extends CreateHeadlineEvent { |
| 42 | + const CreateHeadlineImageUrlChanged(this.imageUrl); |
| 43 | + final String imageUrl; |
| 44 | + @override |
| 45 | + List<Object> get props => [imageUrl]; |
| 46 | +} |
| 47 | + |
| 48 | +/// Event for when the headline's source is changed. |
| 49 | +class CreateHeadlineSourceChanged extends CreateHeadlineEvent { |
| 50 | + const CreateHeadlineSourceChanged(this.source); |
| 51 | + final Source? source; |
| 52 | + @override |
| 53 | + List<Object?> get props => [source]; |
| 54 | +} |
| 55 | + |
| 56 | +/// Event for when the headline's category is changed. |
| 57 | +class CreateHeadlineCategoryChanged extends CreateHeadlineEvent { |
| 58 | + const CreateHeadlineCategoryChanged(this.category); |
| 59 | + final Category? category; |
| 60 | + @override |
| 61 | + List<Object?> get props => [category]; |
| 62 | +} |
| 63 | + |
| 64 | +/// Event to signal that the form should be submitted. |
| 65 | +class CreateHeadlineSubmitted extends CreateHeadlineEvent { |
| 66 | + const CreateHeadlineSubmitted(); |
| 67 | +} |
| 68 | + |
0 commit comments