mirror of
https://gitlab.com/nkming2/nc-photos.git
synced 2025-01-23 17:26:18 +01:00
61 lines
1.2 KiB
Dart
61 lines
1.2 KiB
Dart
|
part of '../places_browser.dart';
|
||
|
|
||
|
@genCopyWith
|
||
|
@toString
|
||
|
class _State {
|
||
|
const _State({
|
||
|
required this.places,
|
||
|
required this.isLoading,
|
||
|
required this.transformedPlaceItems,
|
||
|
required this.transformedCountryItems,
|
||
|
this.error,
|
||
|
});
|
||
|
|
||
|
factory _State.init() => const _State(
|
||
|
places: LocationGroupResult([], [], [], []),
|
||
|
isLoading: false,
|
||
|
transformedPlaceItems: [],
|
||
|
transformedCountryItems: [],
|
||
|
);
|
||
|
|
||
|
@override
|
||
|
String toString() => _$toString();
|
||
|
|
||
|
final LocationGroupResult places;
|
||
|
final bool isLoading;
|
||
|
final List<_Item> transformedPlaceItems;
|
||
|
final List<_Item> transformedCountryItems;
|
||
|
|
||
|
final ExceptionEvent? error;
|
||
|
}
|
||
|
|
||
|
abstract class _Event {}
|
||
|
|
||
|
/// Load the location groups belonging to this account
|
||
|
@toString
|
||
|
class _LoadPlaces implements _Event {
|
||
|
const _LoadPlaces();
|
||
|
|
||
|
@override
|
||
|
String toString() => _$toString();
|
||
|
}
|
||
|
|
||
|
@toString
|
||
|
class _Reload implements _Event {
|
||
|
const _Reload();
|
||
|
|
||
|
@override
|
||
|
String toString() => _$toString();
|
||
|
}
|
||
|
|
||
|
/// Transform the location groups (e.g., filtering, sorting, etc)
|
||
|
@toString
|
||
|
class _TransformItems implements _Event {
|
||
|
const _TransformItems(this.places);
|
||
|
|
||
|
@override
|
||
|
String toString() => _$toString();
|
||
|
|
||
|
final LocationGroupResult places;
|
||
|
}
|