|
| 1 | +part of 'entity_details_bloc.dart'; |
| 2 | + |
| 3 | +abstract class EntityDetailsEvent extends Equatable { |
| 4 | + const EntityDetailsEvent(); |
| 5 | + |
| 6 | + @override |
| 7 | + List<Object?> get props => []; |
| 8 | +} |
| 9 | + |
| 10 | +/// Event to load entity details and initial headlines. |
| 11 | +/// Can be triggered by passing an ID and type, or the full entity. |
| 12 | +class EntityDetailsLoadRequested extends EntityDetailsEvent { |
| 13 | + const EntityDetailsLoadRequested({ |
| 14 | + this.entityId, |
| 15 | + this.entityType, |
| 16 | + this.entity, |
| 17 | + }) : assert( |
| 18 | + (entityId != null && entityType != null) || entity != null, |
| 19 | + 'Either entityId/entityType or entity must be provided.', |
| 20 | + ); |
| 21 | + |
| 22 | + final String? entityId; |
| 23 | + final EntityType? entityType; |
| 24 | + final dynamic entity; // Category or Source |
| 25 | + |
| 26 | + @override |
| 27 | + List<Object?> get props => [entityId, entityType, entity]; |
| 28 | +} |
| 29 | + |
| 30 | +/// Event to toggle the follow status of the current entity. |
| 31 | +class EntityDetailsToggleFollowRequested extends EntityDetailsEvent { |
| 32 | + const EntityDetailsToggleFollowRequested(); |
| 33 | +} |
| 34 | + |
| 35 | +/// Event to load more headlines for pagination. |
| 36 | +class EntityDetailsLoadMoreHeadlinesRequested extends EntityDetailsEvent { |
| 37 | + const EntityDetailsLoadMoreHeadlinesRequested(); |
| 38 | +} |
| 39 | + |
| 40 | +/// Internal event to notify the BLoC that user preferences have changed. |
| 41 | +class _EntityDetailsUserPreferencesChanged extends EntityDetailsEvent { |
| 42 | + const _EntityDetailsUserPreferencesChanged(this.preferences); |
| 43 | + |
| 44 | + final UserContentPreferences preferences; |
| 45 | + |
| 46 | + @override |
| 47 | + List<Object?> get props => [preferences]; |
| 48 | +} |
0 commit comments