2023-03-06 00:57:39 +00:00
|
|
|
part of 'references_bloc.dart';
|
|
|
|
|
|
|
|
abstract class ReferencesState extends Equatable {
|
|
|
|
const ReferencesState();
|
2023-03-24 06:46:17 +00:00
|
|
|
|
2023-03-06 00:57:39 +00:00
|
|
|
@override
|
|
|
|
List<Object> get props => [];
|
|
|
|
}
|
|
|
|
|
|
|
|
class ReferencesInitial extends ReferencesState {}
|
|
|
|
|
2023-03-24 06:46:17 +00:00
|
|
|
class ReferencesLoadedState extends ReferencesState {
|
2023-03-06 00:57:39 +00:00
|
|
|
final List<PersonalReference> references;
|
|
|
|
const ReferencesLoadedState({required this.references});
|
2023-03-24 06:46:17 +00:00
|
|
|
|
2023-03-06 00:57:39 +00:00
|
|
|
@override
|
|
|
|
List<Object> get props => [references];
|
|
|
|
}
|
2023-03-24 06:46:17 +00:00
|
|
|
|
|
|
|
class ReferencesErrorState extends ReferencesState {
|
2023-03-06 00:57:39 +00:00
|
|
|
final String message;
|
|
|
|
const ReferencesErrorState({required this.message});
|
2023-03-24 06:46:17 +00:00
|
|
|
|
2023-03-06 00:57:39 +00:00
|
|
|
@override
|
|
|
|
List<Object> get props => [message];
|
|
|
|
}
|
2023-03-24 06:46:17 +00:00
|
|
|
|
|
|
|
class ReferencesLoadingState extends ReferencesState {}
|
|
|
|
|
|
|
|
class ReferencesAddedState extends ReferencesState {
|
|
|
|
final Map<dynamic, dynamic> response;
|
|
|
|
const ReferencesAddedState(
|
2023-04-11 01:27:53 +00:00
|
|
|
{ required this.response});
|
2023-03-24 06:46:17 +00:00
|
|
|
@override
|
2023-04-11 01:27:53 +00:00
|
|
|
List<Object> get props => [ response];
|
2023-03-24 06:46:17 +00:00
|
|
|
}
|
|
|
|
class ReferenceEditedState extends ReferencesState {
|
2023-04-11 01:27:53 +00:00
|
|
|
|
2023-03-24 06:46:17 +00:00
|
|
|
final Map<dynamic, dynamic> response;
|
|
|
|
const ReferenceEditedState(
|
2023-04-11 01:27:53 +00:00
|
|
|
{ required this.response});
|
2023-03-24 06:46:17 +00:00
|
|
|
@override
|
2023-04-11 01:27:53 +00:00
|
|
|
List<Object> get props => [ response];
|
2023-03-24 06:46:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class EditReferenceState extends ReferencesState {
|
|
|
|
final List<Region> regions;
|
|
|
|
final List<Country> countries;
|
|
|
|
final List<AddressCategory> categories;
|
|
|
|
final List<Province>? provinces;
|
|
|
|
final List<CityMunicipality>? cities;
|
|
|
|
final List<Barangay>? barangays;
|
|
|
|
final PersonalReference ref;
|
|
|
|
final bool isOverseas;
|
|
|
|
final Region? selectedRegion;
|
|
|
|
final Province? selectedProvince;
|
|
|
|
final CityMunicipality? selectedCity;
|
|
|
|
final AddressCategory selectedCategory;
|
|
|
|
final Barangay? selectedBarangay;
|
|
|
|
final Country? selectedCountry;
|
|
|
|
const EditReferenceState(
|
|
|
|
{ this.barangays,
|
|
|
|
this.selectedBarangay,
|
|
|
|
required this.selectedCategory,
|
|
|
|
this.cities,
|
|
|
|
this.selectedCity,
|
|
|
|
this.provinces,
|
|
|
|
this.selectedProvince,
|
|
|
|
this.selectedRegion,
|
|
|
|
this.selectedCountry,
|
|
|
|
required this.isOverseas,
|
|
|
|
required this.ref,
|
|
|
|
required this.categories,
|
|
|
|
required this.countries,
|
|
|
|
required this.regions});
|
|
|
|
@override
|
|
|
|
List<Object> get props => [regions, countries, categories, isOverseas];
|
|
|
|
}
|
|
|
|
|
|
|
|
class AddReferenceState extends ReferencesState {
|
|
|
|
final List<Region> regions;
|
|
|
|
final List<Country> countries;
|
|
|
|
final List<AddressCategory> categories;
|
|
|
|
const AddReferenceState(
|
|
|
|
{required this.categories,
|
|
|
|
required this.countries,
|
|
|
|
required this.regions});
|
|
|
|
}
|
|
|
|
|
|
|
|
class DeleteReferenceState extends ReferencesState {
|
|
|
|
final bool success;
|
2023-04-11 01:27:53 +00:00
|
|
|
const DeleteReferenceState({ required this.success});
|
2023-03-06 00:57:39 +00:00
|
|
|
}
|