nc-photos/app/lib/widget/people_browser/state_event.dart

58 lines
1 KiB
Dart
Raw Normal View History

2023-07-03 19:23:42 +02:00
part of '../people_browser.dart';
@genCopyWith
@toString
class _State {
const _State({
required this.persons,
required this.isLoading,
required this.transformedItems,
this.error,
});
factory _State.init() => const _State(
persons: [],
isLoading: false,
transformedItems: [],
);
@override
String toString() => _$toString();
final List<Person> persons;
final bool isLoading;
final List<_Item> transformedItems;
final ExceptionEvent? error;
}
abstract class _Event {}
/// Load the list of [Person]s belonging to this account
@toString
class _LoadPersons implements _Event {
const _LoadPersons();
@override
String toString() => _$toString();
}
2023-12-13 16:05:40 +01:00
@toString
class _Reload implements _Event {
const _Reload();
@override
String toString() => _$toString();
}
2023-07-03 19:23:42 +02:00
/// Transform the [Person] list (e.g., filtering, sorting, etc)
@toString
class _TransformItems implements _Event {
const _TransformItems(this.persons);
@override
String toString() => _$toString();
final List<Person> persons;
}