feat: type device settings and capabilities, centralize device updates, and improve error handling
- Type device.settings and device.capabilities from untyped maps to Freezed models - Centralize all device settings updates through shared DeviceSettingsUpdateDatasource - Add frequency selectors for location and heart rate, pedometer toggle, and health measurement countdown with Lottie animation - Replace raw backend error messages with typed i18n error events across location, health, and activity meter - Fix silent error swallowing in commands datasource and stuck dialog in locate device
This commit is contained in:
@@ -7,6 +7,6 @@
|
||||
<versions>
|
||||
<version>2.6.4</version>
|
||||
</versions>
|
||||
<lastUpdated>20260322000000</lastUpdated>
|
||||
<lastUpdated>20260325000000</lastUpdated>
|
||||
</versioning>
|
||||
</metadata>
|
||||
|
||||
@@ -1 +1 @@
|
||||
ec3c2e29f6fe8ca84eadd369212dff2b
|
||||
afdf53af75a016d3a59635398d34f60d
|
||||
@@ -1 +1 @@
|
||||
df5c1d0c2331a0f608264e4d5f14b9492f5eb2aa
|
||||
bf02df387eb61f33404881f4a9a3c80dfa29e6d1
|
||||
@@ -631,5 +631,35 @@
|
||||
"callHistoryEmpty": "Keine Anrufe aufgezeichnet",
|
||||
"callIncoming": "Eingehend",
|
||||
"callOutgoing": "Ausgehend",
|
||||
"callMissed": "Verpasst"
|
||||
"callMissed": "Verpasst",
|
||||
"healthFrequency": "Frequenz",
|
||||
"healthMeasuring": "Messung läuft...",
|
||||
"geofenceCreated": "Geofence erstellt",
|
||||
"geofenceUpdated": "Geofence aktualisiert",
|
||||
"geofenceDeleted": "Geofence gelöscht",
|
||||
"frequentPlaceCreated": "Häufiger Ort erstellt",
|
||||
"frequentPlaceUpdated": "Häufiger Ort aktualisiert",
|
||||
"frequentPlaceDeleted": "Häufiger Ort gelöscht",
|
||||
"errorGeneric": "Etwas ist schiefgelaufen. Bitte versuchen Sie es erneut.",
|
||||
"errorGeofenceCreate": "Die Sicherheitszone konnte nicht erstellt werden",
|
||||
"errorGeofenceUpdate": "Die Sicherheitszone konnte nicht aktualisiert werden",
|
||||
"errorGeofenceDelete": "Die Sicherheitszone konnte nicht gelöscht werden",
|
||||
"errorFrequentPlaceCreate": "Der häufige Ort konnte nicht erstellt werden",
|
||||
"errorFrequentPlaceUpdate": "Der häufige Ort konnte nicht aktualisiert werden",
|
||||
"errorFrequentPlaceDelete": "Der häufige Ort konnte nicht gelöscht werden",
|
||||
"errorPositionHistory": "Der Positionsverlauf konnte nicht geladen werden",
|
||||
"errorLocationFrequency": "Die Standortfrequenz konnte nicht aktualisiert werden",
|
||||
"errorRefreshPosition": "Die Position konnte nicht aktualisiert werden",
|
||||
"errorHealthData": "Die Gesundheitsdaten konnten nicht geladen werden",
|
||||
"errorHealthMeasure": "Der Messbefehl konnte nicht gesendet werden",
|
||||
"errorHeartRateFrequency": "Die Herzfrequenz konnte nicht aktualisiert werden",
|
||||
"errorSoundMode": "Der Tonmodus konnte nicht aktualisiert werden",
|
||||
"errorVolumeControl": "Die Lautstärke konnte nicht aktualisiert werden",
|
||||
"errorLanguage": "Die Sprache konnte nicht aktualisiert werden",
|
||||
"locationFrequencyUpdated": "Frequenz auf {minutes} Min. aktualisiert",
|
||||
"activityMeterPedometer": "Schrittzähler",
|
||||
"activityMeterPedometerEnabled": "Schrittzähler aktiviert",
|
||||
"activityMeterPedometerDisabled": "Schrittzähler deaktiviert",
|
||||
"errorActivityData": "Aktivitätsdaten konnten nicht geladen werden",
|
||||
"errorPedometer": "Der Schrittzähler konnte nicht aktualisiert werden"
|
||||
}
|
||||
|
||||
@@ -763,5 +763,35 @@
|
||||
"callHistoryEmpty": "No calls recorded",
|
||||
"callIncoming": "Incoming",
|
||||
"callOutgoing": "Outgoing",
|
||||
"callMissed": "Missed"
|
||||
"callMissed": "Missed",
|
||||
"healthFrequency": "Frequency",
|
||||
"healthMeasuring": "Measuring...",
|
||||
"geofenceCreated": "Geofence created",
|
||||
"geofenceUpdated": "Geofence updated",
|
||||
"geofenceDeleted": "Geofence deleted",
|
||||
"frequentPlaceCreated": "Frequent place created",
|
||||
"frequentPlaceUpdated": "Frequent place updated",
|
||||
"frequentPlaceDeleted": "Frequent place deleted",
|
||||
"errorGeneric": "Something went wrong. Please try again.",
|
||||
"errorGeofenceCreate": "Could not create the safety zone",
|
||||
"errorGeofenceUpdate": "Could not update the safety zone",
|
||||
"errorGeofenceDelete": "Could not delete the safety zone",
|
||||
"errorFrequentPlaceCreate": "Could not create the frequent place",
|
||||
"errorFrequentPlaceUpdate": "Could not update the frequent place",
|
||||
"errorFrequentPlaceDelete": "Could not delete the frequent place",
|
||||
"errorPositionHistory": "Could not load position history",
|
||||
"errorLocationFrequency": "Could not update location frequency",
|
||||
"errorRefreshPosition": "Could not refresh position",
|
||||
"errorHealthData": "Could not load health data",
|
||||
"errorHealthMeasure": "Could not send measurement command",
|
||||
"errorHeartRateFrequency": "Could not update heart rate frequency",
|
||||
"errorSoundMode": "Could not update sound mode",
|
||||
"errorVolumeControl": "Could not update volume",
|
||||
"errorLanguage": "Could not update language",
|
||||
"locationFrequencyUpdated": "Frequency updated to {minutes} min",
|
||||
"activityMeterPedometer": "Pedometer",
|
||||
"activityMeterPedometerEnabled": "Pedometer enabled",
|
||||
"activityMeterPedometerDisabled": "Pedometer disabled",
|
||||
"errorActivityData": "Could not load activity data",
|
||||
"errorPedometer": "Could not update pedometer"
|
||||
}
|
||||
|
||||
@@ -761,5 +761,35 @@
|
||||
"callHistoryEmpty": "No hay llamadas registradas",
|
||||
"callIncoming": "Entrantes",
|
||||
"callOutgoing": "Salientes",
|
||||
"callMissed": "Perdidas"
|
||||
"callMissed": "Perdidas",
|
||||
"healthFrequency": "Frecuencia",
|
||||
"healthMeasuring": "Midiendo...",
|
||||
"geofenceCreated": "Zona de seguridad creada",
|
||||
"geofenceUpdated": "Zona de seguridad actualizada",
|
||||
"geofenceDeleted": "Zona de seguridad eliminada",
|
||||
"frequentPlaceCreated": "Lugar frecuente creado",
|
||||
"frequentPlaceUpdated": "Lugar frecuente actualizado",
|
||||
"frequentPlaceDeleted": "Lugar frecuente eliminado",
|
||||
"errorGeneric": "Algo salió mal. Inténtalo de nuevo.",
|
||||
"errorGeofenceCreate": "No se pudo crear la zona de seguridad",
|
||||
"errorGeofenceUpdate": "No se pudo actualizar la zona de seguridad",
|
||||
"errorGeofenceDelete": "No se pudo eliminar la zona de seguridad",
|
||||
"errorFrequentPlaceCreate": "No se pudo crear el lugar frecuente",
|
||||
"errorFrequentPlaceUpdate": "No se pudo actualizar el lugar frecuente",
|
||||
"errorFrequentPlaceDelete": "No se pudo eliminar el lugar frecuente",
|
||||
"errorPositionHistory": "No se pudo cargar el historial de posiciones",
|
||||
"errorLocationFrequency": "No se pudo actualizar la frecuencia de localización",
|
||||
"errorRefreshPosition": "No se pudo actualizar la posición",
|
||||
"errorHealthData": "No se pudieron cargar los datos de salud",
|
||||
"errorHealthMeasure": "No se pudo enviar el comando de medición",
|
||||
"errorHeartRateFrequency": "No se pudo actualizar la frecuencia cardíaca",
|
||||
"errorSoundMode": "No se pudo actualizar el modo de sonido",
|
||||
"errorVolumeControl": "No se pudo actualizar el volumen",
|
||||
"errorLanguage": "No se pudo actualizar el idioma",
|
||||
"locationFrequencyUpdated": "Frecuencia actualizada a {minutes} min",
|
||||
"activityMeterPedometer": "Podómetro",
|
||||
"activityMeterPedometerEnabled": "Podómetro activado",
|
||||
"activityMeterPedometerDisabled": "Podómetro desactivado",
|
||||
"errorActivityData": "No se pudieron cargar los datos de actividad",
|
||||
"errorPedometer": "No se pudo actualizar el podómetro"
|
||||
}
|
||||
|
||||
@@ -631,5 +631,35 @@
|
||||
"callHistoryEmpty": "Aucun appel enregistré",
|
||||
"callIncoming": "Entrants",
|
||||
"callOutgoing": "Sortants",
|
||||
"callMissed": "Manqués"
|
||||
"callMissed": "Manqués",
|
||||
"healthFrequency": "Fréquence",
|
||||
"healthMeasuring": "Mesure en cours...",
|
||||
"geofenceCreated": "Géorepère créé",
|
||||
"geofenceUpdated": "Géorepère mis à jour",
|
||||
"geofenceDeleted": "Géorepère supprimé",
|
||||
"frequentPlaceCreated": "Lieu fréquent créé",
|
||||
"frequentPlaceUpdated": "Lieu fréquent mis à jour",
|
||||
"frequentPlaceDeleted": "Lieu fréquent supprimé",
|
||||
"errorGeneric": "Une erreur est survenue. Veuillez réessayer.",
|
||||
"errorGeofenceCreate": "Impossible de créer la zone de sécurité",
|
||||
"errorGeofenceUpdate": "Impossible de mettre à jour la zone de sécurité",
|
||||
"errorGeofenceDelete": "Impossible de supprimer la zone de sécurité",
|
||||
"errorFrequentPlaceCreate": "Impossible de créer le lieu fréquent",
|
||||
"errorFrequentPlaceUpdate": "Impossible de mettre à jour le lieu fréquent",
|
||||
"errorFrequentPlaceDelete": "Impossible de supprimer le lieu fréquent",
|
||||
"errorPositionHistory": "Impossible de charger l'historique des positions",
|
||||
"errorLocationFrequency": "Impossible de mettre à jour la fréquence de localisation",
|
||||
"errorRefreshPosition": "Impossible de rafraîchir la position",
|
||||
"errorHealthData": "Impossible de charger les données de santé",
|
||||
"errorHealthMeasure": "Impossible d'envoyer la commande de mesure",
|
||||
"errorHeartRateFrequency": "Impossible de mettre à jour la fréquence cardiaque",
|
||||
"errorSoundMode": "Impossible de mettre à jour le mode sonore",
|
||||
"errorVolumeControl": "Impossible de mettre à jour le volume",
|
||||
"errorLanguage": "Impossible de mettre à jour la langue",
|
||||
"locationFrequencyUpdated": "Fréquence mise à jour à {minutes} min",
|
||||
"activityMeterPedometer": "Podomètre",
|
||||
"activityMeterPedometerEnabled": "Podomètre activé",
|
||||
"activityMeterPedometerDisabled": "Podomètre désactivé",
|
||||
"errorActivityData": "Impossible de charger les données d'activité",
|
||||
"errorPedometer": "Impossible de mettre à jour le podomètre"
|
||||
}
|
||||
|
||||
@@ -631,5 +631,35 @@
|
||||
"callHistoryEmpty": "Nessuna chiamata registrata",
|
||||
"callIncoming": "In arrivo",
|
||||
"callOutgoing": "In uscita",
|
||||
"callMissed": "Perse"
|
||||
"callMissed": "Perse",
|
||||
"healthFrequency": "Frequenza",
|
||||
"healthMeasuring": "Misurazione in corso...",
|
||||
"geofenceCreated": "Geofence creato",
|
||||
"geofenceUpdated": "Geofence aggiornato",
|
||||
"geofenceDeleted": "Geofence eliminato",
|
||||
"frequentPlaceCreated": "Luogo frequente creato",
|
||||
"frequentPlaceUpdated": "Luogo frequente aggiornato",
|
||||
"frequentPlaceDeleted": "Luogo frequente eliminato",
|
||||
"errorGeneric": "Qualcosa è andato storto. Riprova.",
|
||||
"errorGeofenceCreate": "Impossibile creare la zona di sicurezza",
|
||||
"errorGeofenceUpdate": "Impossibile aggiornare la zona di sicurezza",
|
||||
"errorGeofenceDelete": "Impossibile eliminare la zona di sicurezza",
|
||||
"errorFrequentPlaceCreate": "Impossibile creare il luogo frequente",
|
||||
"errorFrequentPlaceUpdate": "Impossibile aggiornare il luogo frequente",
|
||||
"errorFrequentPlaceDelete": "Impossibile eliminare il luogo frequente",
|
||||
"errorPositionHistory": "Impossibile caricare la cronologia delle posizioni",
|
||||
"errorLocationFrequency": "Impossibile aggiornare la frequenza di localizzazione",
|
||||
"errorRefreshPosition": "Impossibile aggiornare la posizione",
|
||||
"errorHealthData": "Impossibile caricare i dati sanitari",
|
||||
"errorHealthMeasure": "Impossibile inviare il comando di misurazione",
|
||||
"errorHeartRateFrequency": "Impossibile aggiornare la frequenza cardiaca",
|
||||
"errorSoundMode": "Impossibile aggiornare la modalità audio",
|
||||
"errorVolumeControl": "Impossibile aggiornare il volume",
|
||||
"errorLanguage": "Impossibile aggiornare la lingua",
|
||||
"locationFrequencyUpdated": "Frequenza aggiornata a {minutes} min",
|
||||
"activityMeterPedometer": "Contapassi",
|
||||
"activityMeterPedometerEnabled": "Contapassi attivato",
|
||||
"activityMeterPedometerDisabled": "Contapassi disattivato",
|
||||
"errorActivityData": "Impossibile caricare i dati di attività",
|
||||
"errorPedometer": "Impossibile aggiornare il contapassi"
|
||||
}
|
||||
|
||||
@@ -631,5 +631,35 @@
|
||||
"callHistoryEmpty": "Nenhuma chamada registrada",
|
||||
"callIncoming": "Recebidas",
|
||||
"callOutgoing": "Efetuadas",
|
||||
"callMissed": "Perdidas"
|
||||
"callMissed": "Perdidas",
|
||||
"healthFrequency": "Frequência",
|
||||
"healthMeasuring": "Medindo...",
|
||||
"geofenceCreated": "Geocerca criada",
|
||||
"geofenceUpdated": "Geocerca atualizada",
|
||||
"geofenceDeleted": "Geocerca eliminada",
|
||||
"frequentPlaceCreated": "Local frequente criado",
|
||||
"frequentPlaceUpdated": "Local frequente atualizado",
|
||||
"frequentPlaceDeleted": "Local frequente eliminado",
|
||||
"errorGeneric": "Algo correu mal. Tente novamente.",
|
||||
"errorGeofenceCreate": "Não foi possível criar a zona de segurança",
|
||||
"errorGeofenceUpdate": "Não foi possível atualizar a zona de segurança",
|
||||
"errorGeofenceDelete": "Não foi possível eliminar a zona de segurança",
|
||||
"errorFrequentPlaceCreate": "Não foi possível criar o local frequente",
|
||||
"errorFrequentPlaceUpdate": "Não foi possível atualizar o local frequente",
|
||||
"errorFrequentPlaceDelete": "Não foi possível eliminar o local frequente",
|
||||
"errorPositionHistory": "Não foi possível carregar o histórico de posições",
|
||||
"errorLocationFrequency": "Não foi possível atualizar a frequência de localização",
|
||||
"errorRefreshPosition": "Não foi possível atualizar a posição",
|
||||
"errorHealthData": "Não foi possível carregar os dados de saúde",
|
||||
"errorHealthMeasure": "Não foi possível enviar o comando de medição",
|
||||
"errorHeartRateFrequency": "Não foi possível atualizar a frequência cardíaca",
|
||||
"errorSoundMode": "Não foi possível atualizar o modo de som",
|
||||
"errorVolumeControl": "Não foi possível atualizar o volume",
|
||||
"errorLanguage": "Não foi possível atualizar o idioma",
|
||||
"locationFrequencyUpdated": "Frequência atualizada para {minutes} min",
|
||||
"activityMeterPedometer": "Pedómetro",
|
||||
"activityMeterPedometerEnabled": "Pedómetro ativado",
|
||||
"activityMeterPedometerDisabled": "Pedómetro desativado",
|
||||
"errorActivityData": "Não foi possível carregar os dados de atividade",
|
||||
"errorPedometer": "Não foi possível atualizar o pedómetro"
|
||||
}
|
||||
|
||||
@@ -768,4 +768,34 @@ class I18n {
|
||||
static const String noPhotosAvailable = 'noPhotosAvailable';
|
||||
static const String yesterday = 'yesterday';
|
||||
static const String measure = 'measure';
|
||||
static const String healthFrequency = 'healthFrequency';
|
||||
static const String healthMeasuring = 'healthMeasuring';
|
||||
static const String geofenceCreated = 'geofenceCreated';
|
||||
static const String geofenceUpdated = 'geofenceUpdated';
|
||||
static const String geofenceDeleted = 'geofenceDeleted';
|
||||
static const String frequentPlaceCreated = 'frequentPlaceCreated';
|
||||
static const String frequentPlaceUpdated = 'frequentPlaceUpdated';
|
||||
static const String frequentPlaceDeleted = 'frequentPlaceDeleted';
|
||||
static const String errorGeneric = 'errorGeneric';
|
||||
static const String errorGeofenceCreate = 'errorGeofenceCreate';
|
||||
static const String errorGeofenceUpdate = 'errorGeofenceUpdate';
|
||||
static const String errorGeofenceDelete = 'errorGeofenceDelete';
|
||||
static const String errorFrequentPlaceCreate = 'errorFrequentPlaceCreate';
|
||||
static const String errorFrequentPlaceUpdate = 'errorFrequentPlaceUpdate';
|
||||
static const String errorFrequentPlaceDelete = 'errorFrequentPlaceDelete';
|
||||
static const String errorPositionHistory = 'errorPositionHistory';
|
||||
static const String errorLocationFrequency = 'errorLocationFrequency';
|
||||
static const String errorRefreshPosition = 'errorRefreshPosition';
|
||||
static const String errorHealthData = 'errorHealthData';
|
||||
static const String errorHealthMeasure = 'errorHealthMeasure';
|
||||
static const String errorHeartRateFrequency = 'errorHeartRateFrequency';
|
||||
static const String errorSoundMode = 'errorSoundMode';
|
||||
static const String errorVolumeControl = 'errorVolumeControl';
|
||||
static const String errorLanguage = 'errorLanguage';
|
||||
static const String locationFrequencyUpdated = 'locationFrequencyUpdated';
|
||||
static const String activityMeterPedometer = 'activityMeterPedometer';
|
||||
static const String activityMeterPedometerEnabled = 'activityMeterPedometerEnabled';
|
||||
static const String activityMeterPedometerDisabled = 'activityMeterPedometerDisabled';
|
||||
static const String errorActivityData = 'errorActivityData';
|
||||
static const String errorPedometer = 'errorPedometer';
|
||||
}
|
||||
|
||||
@@ -34,7 +34,11 @@ export 'src/domain/entities/transaction_beneficiary_entity.dart';
|
||||
export 'src/data/models/payout_beneficiary_model.dart';
|
||||
export 'src/domain/entities/payout_beneficiary_entity.dart';
|
||||
export 'src/data/models/device_model.dart';
|
||||
export 'src/data/models/device_settings_model.dart';
|
||||
export 'src/data/models/device_capabilities_model.dart';
|
||||
export 'src/domain/entities/device_entity.dart';
|
||||
export 'src/domain/entities/device_settings_entity.dart';
|
||||
export 'src/domain/entities/device_capabilities_entity.dart';
|
||||
export 'src/data/models/child_wallet_model.dart';
|
||||
export 'src/domain/entities/child_wallet_entity.dart';
|
||||
export 'src/providers/wallet_refresh_provider.dart';
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
// ignore_for_file: invalid_annotation_target
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:sf_shared/src/domain/entities/device_capabilities_entity.dart';
|
||||
|
||||
part 'device_capabilities_model.freezed.dart';
|
||||
part 'device_capabilities_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class DeviceCapabilitiesModel with _$DeviceCapabilitiesModel {
|
||||
const factory DeviceCapabilitiesModel({
|
||||
DeviceCapabilityOptionModel? heartbeats,
|
||||
DeviceCapabilityEnabledModel? bloodPressure,
|
||||
DeviceCapabilityAlertsModel? alerts,
|
||||
DeviceCapabilityEnabledModel? podometer,
|
||||
DeviceCapabilityContactsModel? contacts,
|
||||
DeviceCapabilitySettingsModel? settings,
|
||||
DeviceCapabilityCommandsModel? commands,
|
||||
DeviceCapabilityTakepillsModel? takepills,
|
||||
DeviceCapabilityOptionModel? location,
|
||||
DeviceCapabilityCameraModel? camera,
|
||||
}) = _DeviceCapabilitiesModel;
|
||||
|
||||
factory DeviceCapabilitiesModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$DeviceCapabilitiesModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class DeviceCapabilityEnabledModel with _$DeviceCapabilityEnabledModel {
|
||||
const factory DeviceCapabilityEnabledModel({
|
||||
@Default(false) bool enabled,
|
||||
}) = _DeviceCapabilityEnabledModel;
|
||||
|
||||
factory DeviceCapabilityEnabledModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$DeviceCapabilityEnabledModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class DeviceCapabilityOptionModel with _$DeviceCapabilityOptionModel {
|
||||
const factory DeviceCapabilityOptionModel({
|
||||
@JsonKey(name: 'default') @Default(0) int defaultValue,
|
||||
@Default(false) bool enabled,
|
||||
@Default([]) List<int> options,
|
||||
}) = _DeviceCapabilityOptionModel;
|
||||
|
||||
factory DeviceCapabilityOptionModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$DeviceCapabilityOptionModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class DeviceCapabilityAlertsModel with _$DeviceCapabilityAlertsModel {
|
||||
const factory DeviceCapabilityAlertsModel({
|
||||
@Default(false) bool enabled,
|
||||
@Default([]) List<String> types,
|
||||
}) = _DeviceCapabilityAlertsModel;
|
||||
|
||||
factory DeviceCapabilityAlertsModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$DeviceCapabilityAlertsModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class DeviceCapabilityContactsModel with _$DeviceCapabilityContactsModel {
|
||||
const factory DeviceCapabilityContactsModel({
|
||||
@Default(false) bool enabled,
|
||||
@Default([]) List<DeviceCapabilityContactTypeModel> types,
|
||||
@Default(false) bool isPhonebookWithPhoto,
|
||||
}) = _DeviceCapabilityContactsModel;
|
||||
|
||||
factory DeviceCapabilityContactsModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$DeviceCapabilityContactsModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class DeviceCapabilityContactTypeModel with _$DeviceCapabilityContactTypeModel {
|
||||
const factory DeviceCapabilityContactTypeModel({
|
||||
@Default('') String type,
|
||||
@Default(0) int amount,
|
||||
}) = _DeviceCapabilityContactTypeModel;
|
||||
|
||||
factory DeviceCapabilityContactTypeModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$DeviceCapabilityContactTypeModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class DeviceCapabilitySettingsModel with _$DeviceCapabilitySettingsModel {
|
||||
const factory DeviceCapabilitySettingsModel({
|
||||
@Default(false) bool language,
|
||||
@Default(false) bool timezone,
|
||||
@Default([]) List<String> soundModes,
|
||||
}) = _DeviceCapabilitySettingsModel;
|
||||
|
||||
factory DeviceCapabilitySettingsModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$DeviceCapabilitySettingsModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class DeviceCapabilityCommandsModel with _$DeviceCapabilityCommandsModel {
|
||||
const factory DeviceCapabilityCommandsModel({
|
||||
@Default(false) bool enabled,
|
||||
@Default([]) List<String> types,
|
||||
}) = _DeviceCapabilityCommandsModel;
|
||||
|
||||
factory DeviceCapabilityCommandsModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$DeviceCapabilityCommandsModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class DeviceCapabilityTakepillsModel with _$DeviceCapabilityTakepillsModel {
|
||||
const factory DeviceCapabilityTakepillsModel({
|
||||
@Default(false) bool enabled,
|
||||
@Default(0) int maxReminders,
|
||||
}) = _DeviceCapabilityTakepillsModel;
|
||||
|
||||
factory DeviceCapabilityTakepillsModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$DeviceCapabilityTakepillsModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class DeviceCapabilityCameraModel with _$DeviceCapabilityCameraModel {
|
||||
const factory DeviceCapabilityCameraModel({
|
||||
@Default('') String format,
|
||||
@Default(false) bool enabled,
|
||||
}) = _DeviceCapabilityCameraModel;
|
||||
|
||||
factory DeviceCapabilityCameraModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$DeviceCapabilityCameraModelFromJson(json);
|
||||
}
|
||||
|
||||
extension DeviceCapabilitiesModelMapper on DeviceCapabilitiesModel {
|
||||
DeviceCapabilitiesEntity toEntity() => DeviceCapabilitiesEntity(
|
||||
heartbeats: heartbeats != null
|
||||
? DeviceCapabilityOptionEntity(
|
||||
defaultValue: heartbeats!.defaultValue,
|
||||
enabled: heartbeats!.enabled,
|
||||
options: heartbeats!.options,
|
||||
)
|
||||
: null,
|
||||
bloodPressure: bloodPressure != null
|
||||
? DeviceCapabilityEnabledEntity(enabled: bloodPressure!.enabled)
|
||||
: null,
|
||||
alerts: alerts != null
|
||||
? DeviceCapabilityAlertsEntity(
|
||||
enabled: alerts!.enabled,
|
||||
types: alerts!.types,
|
||||
)
|
||||
: null,
|
||||
podometer: podometer != null
|
||||
? DeviceCapabilityEnabledEntity(enabled: podometer!.enabled)
|
||||
: null,
|
||||
contacts: contacts != null
|
||||
? DeviceCapabilityContactsEntity(
|
||||
enabled: contacts!.enabled,
|
||||
types: contacts!.types
|
||||
.map((t) => DeviceCapabilityContactTypeEntity(
|
||||
type: t.type,
|
||||
amount: t.amount,
|
||||
))
|
||||
.toList(),
|
||||
isPhonebookWithPhoto: contacts!.isPhonebookWithPhoto,
|
||||
)
|
||||
: null,
|
||||
settings: settings != null
|
||||
? DeviceCapabilitySettingsEntity(
|
||||
language: settings!.language,
|
||||
timezone: settings!.timezone,
|
||||
soundModes: settings!.soundModes,
|
||||
)
|
||||
: null,
|
||||
commands: commands != null
|
||||
? DeviceCapabilityCommandsEntity(
|
||||
enabled: commands!.enabled,
|
||||
types: commands!.types,
|
||||
)
|
||||
: null,
|
||||
takepills: takepills != null
|
||||
? DeviceCapabilityTakepillsEntity(
|
||||
enabled: takepills!.enabled,
|
||||
maxReminders: takepills!.maxReminders,
|
||||
)
|
||||
: null,
|
||||
location: location != null
|
||||
? DeviceCapabilityOptionEntity(
|
||||
defaultValue: location!.defaultValue,
|
||||
enabled: location!.enabled,
|
||||
options: location!.options,
|
||||
)
|
||||
: null,
|
||||
camera: camera != null
|
||||
? DeviceCapabilityCameraEntity(
|
||||
format: camera!.format,
|
||||
enabled: camera!.enabled,
|
||||
)
|
||||
: null,
|
||||
);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,211 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'device_capabilities_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_DeviceCapabilitiesModel _$DeviceCapabilitiesModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _DeviceCapabilitiesModel(
|
||||
heartbeats: json['heartbeats'] == null
|
||||
? null
|
||||
: DeviceCapabilityOptionModel.fromJson(
|
||||
json['heartbeats'] as Map<String, dynamic>,
|
||||
),
|
||||
bloodPressure: json['bloodPressure'] == null
|
||||
? null
|
||||
: DeviceCapabilityEnabledModel.fromJson(
|
||||
json['bloodPressure'] as Map<String, dynamic>,
|
||||
),
|
||||
alerts: json['alerts'] == null
|
||||
? null
|
||||
: DeviceCapabilityAlertsModel.fromJson(
|
||||
json['alerts'] as Map<String, dynamic>,
|
||||
),
|
||||
podometer: json['podometer'] == null
|
||||
? null
|
||||
: DeviceCapabilityEnabledModel.fromJson(
|
||||
json['podometer'] as Map<String, dynamic>,
|
||||
),
|
||||
contacts: json['contacts'] == null
|
||||
? null
|
||||
: DeviceCapabilityContactsModel.fromJson(
|
||||
json['contacts'] as Map<String, dynamic>,
|
||||
),
|
||||
settings: json['settings'] == null
|
||||
? null
|
||||
: DeviceCapabilitySettingsModel.fromJson(
|
||||
json['settings'] as Map<String, dynamic>,
|
||||
),
|
||||
commands: json['commands'] == null
|
||||
? null
|
||||
: DeviceCapabilityCommandsModel.fromJson(
|
||||
json['commands'] as Map<String, dynamic>,
|
||||
),
|
||||
takepills: json['takepills'] == null
|
||||
? null
|
||||
: DeviceCapabilityTakepillsModel.fromJson(
|
||||
json['takepills'] as Map<String, dynamic>,
|
||||
),
|
||||
location: json['location'] == null
|
||||
? null
|
||||
: DeviceCapabilityOptionModel.fromJson(
|
||||
json['location'] as Map<String, dynamic>,
|
||||
),
|
||||
camera: json['camera'] == null
|
||||
? null
|
||||
: DeviceCapabilityCameraModel.fromJson(
|
||||
json['camera'] as Map<String, dynamic>,
|
||||
),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$DeviceCapabilitiesModelToJson(
|
||||
_DeviceCapabilitiesModel instance,
|
||||
) => <String, dynamic>{
|
||||
'heartbeats': instance.heartbeats,
|
||||
'bloodPressure': instance.bloodPressure,
|
||||
'alerts': instance.alerts,
|
||||
'podometer': instance.podometer,
|
||||
'contacts': instance.contacts,
|
||||
'settings': instance.settings,
|
||||
'commands': instance.commands,
|
||||
'takepills': instance.takepills,
|
||||
'location': instance.location,
|
||||
'camera': instance.camera,
|
||||
};
|
||||
|
||||
_DeviceCapabilityEnabledModel _$DeviceCapabilityEnabledModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _DeviceCapabilityEnabledModel(enabled: json['enabled'] as bool? ?? false);
|
||||
|
||||
Map<String, dynamic> _$DeviceCapabilityEnabledModelToJson(
|
||||
_DeviceCapabilityEnabledModel instance,
|
||||
) => <String, dynamic>{'enabled': instance.enabled};
|
||||
|
||||
_DeviceCapabilityOptionModel _$DeviceCapabilityOptionModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _DeviceCapabilityOptionModel(
|
||||
defaultValue: (json['default'] as num?)?.toInt() ?? 0,
|
||||
enabled: json['enabled'] as bool? ?? false,
|
||||
options:
|
||||
(json['options'] as List<dynamic>?)
|
||||
?.map((e) => (e as num).toInt())
|
||||
.toList() ??
|
||||
const [],
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$DeviceCapabilityOptionModelToJson(
|
||||
_DeviceCapabilityOptionModel instance,
|
||||
) => <String, dynamic>{
|
||||
'default': instance.defaultValue,
|
||||
'enabled': instance.enabled,
|
||||
'options': instance.options,
|
||||
};
|
||||
|
||||
_DeviceCapabilityAlertsModel _$DeviceCapabilityAlertsModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _DeviceCapabilityAlertsModel(
|
||||
enabled: json['enabled'] as bool? ?? false,
|
||||
types:
|
||||
(json['types'] as List<dynamic>?)?.map((e) => e as String).toList() ??
|
||||
const [],
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$DeviceCapabilityAlertsModelToJson(
|
||||
_DeviceCapabilityAlertsModel instance,
|
||||
) => <String, dynamic>{'enabled': instance.enabled, 'types': instance.types};
|
||||
|
||||
_DeviceCapabilityContactsModel _$DeviceCapabilityContactsModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _DeviceCapabilityContactsModel(
|
||||
enabled: json['enabled'] as bool? ?? false,
|
||||
types:
|
||||
(json['types'] as List<dynamic>?)
|
||||
?.map(
|
||||
(e) => DeviceCapabilityContactTypeModel.fromJson(
|
||||
e as Map<String, dynamic>,
|
||||
),
|
||||
)
|
||||
.toList() ??
|
||||
const [],
|
||||
isPhonebookWithPhoto: json['isPhonebookWithPhoto'] as bool? ?? false,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$DeviceCapabilityContactsModelToJson(
|
||||
_DeviceCapabilityContactsModel instance,
|
||||
) => <String, dynamic>{
|
||||
'enabled': instance.enabled,
|
||||
'types': instance.types,
|
||||
'isPhonebookWithPhoto': instance.isPhonebookWithPhoto,
|
||||
};
|
||||
|
||||
_DeviceCapabilityContactTypeModel _$DeviceCapabilityContactTypeModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _DeviceCapabilityContactTypeModel(
|
||||
type: json['type'] as String? ?? '',
|
||||
amount: (json['amount'] as num?)?.toInt() ?? 0,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$DeviceCapabilityContactTypeModelToJson(
|
||||
_DeviceCapabilityContactTypeModel instance,
|
||||
) => <String, dynamic>{'type': instance.type, 'amount': instance.amount};
|
||||
|
||||
_DeviceCapabilitySettingsModel _$DeviceCapabilitySettingsModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _DeviceCapabilitySettingsModel(
|
||||
language: json['language'] as bool? ?? false,
|
||||
timezone: json['timezone'] as bool? ?? false,
|
||||
soundModes:
|
||||
(json['soundModes'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList() ??
|
||||
const [],
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$DeviceCapabilitySettingsModelToJson(
|
||||
_DeviceCapabilitySettingsModel instance,
|
||||
) => <String, dynamic>{
|
||||
'language': instance.language,
|
||||
'timezone': instance.timezone,
|
||||
'soundModes': instance.soundModes,
|
||||
};
|
||||
|
||||
_DeviceCapabilityCommandsModel _$DeviceCapabilityCommandsModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _DeviceCapabilityCommandsModel(
|
||||
enabled: json['enabled'] as bool? ?? false,
|
||||
types:
|
||||
(json['types'] as List<dynamic>?)?.map((e) => e as String).toList() ??
|
||||
const [],
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$DeviceCapabilityCommandsModelToJson(
|
||||
_DeviceCapabilityCommandsModel instance,
|
||||
) => <String, dynamic>{'enabled': instance.enabled, 'types': instance.types};
|
||||
|
||||
_DeviceCapabilityTakepillsModel _$DeviceCapabilityTakepillsModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _DeviceCapabilityTakepillsModel(
|
||||
enabled: json['enabled'] as bool? ?? false,
|
||||
maxReminders: (json['maxReminders'] as num?)?.toInt() ?? 0,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$DeviceCapabilityTakepillsModelToJson(
|
||||
_DeviceCapabilityTakepillsModel instance,
|
||||
) => <String, dynamic>{
|
||||
'enabled': instance.enabled,
|
||||
'maxReminders': instance.maxReminders,
|
||||
};
|
||||
|
||||
_DeviceCapabilityCameraModel _$DeviceCapabilityCameraModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _DeviceCapabilityCameraModel(
|
||||
format: json['format'] as String? ?? '',
|
||||
enabled: json['enabled'] as bool? ?? false,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$DeviceCapabilityCameraModelToJson(
|
||||
_DeviceCapabilityCameraModel instance,
|
||||
) => <String, dynamic>{'format': instance.format, 'enabled': instance.enabled};
|
||||
@@ -2,6 +2,9 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:sf_shared/src/domain/entities/device_entity.dart';
|
||||
|
||||
import 'device_capabilities_model.dart';
|
||||
import 'device_settings_model.dart';
|
||||
|
||||
part 'device_model.freezed.dart';
|
||||
part 'device_model.g.dart';
|
||||
|
||||
@@ -41,11 +44,11 @@ abstract class DeviceModel with _$DeviceModel {
|
||||
@Default(null) String? phone,
|
||||
@Default(null) String? simId,
|
||||
@Default(null) Map<String, dynamic>? paymentOptions,
|
||||
@Default({}) Map<String, dynamic> settings,
|
||||
@Default(DeviceSettingsModel()) DeviceSettingsModel settings,
|
||||
@Default('') String connectionServer,
|
||||
@Default('') String protocol,
|
||||
@Default('') String type,
|
||||
@Default(null) Map<String, dynamic>? capabilities,
|
||||
@Default(null) DeviceCapabilitiesModel? capabilities,
|
||||
@JsonKey(fromJson: _toString) @Default('') String createdAt,
|
||||
@JsonKey(fromJson: _toNullableString) @Default(null) String? updatedAt,
|
||||
}) = _DeviceModel;
|
||||
@@ -75,11 +78,11 @@ extension DeviceModelMapper on DeviceModel {
|
||||
phone: phone,
|
||||
simId: simId,
|
||||
paymentOptions: paymentOptions,
|
||||
settings: settings,
|
||||
settings: settings.toEntity(),
|
||||
connectionServer: connectionServer,
|
||||
protocol: protocol,
|
||||
type: type,
|
||||
capabilities: capabilities,
|
||||
capabilities: capabilities?.toEntity(),
|
||||
createdAt: createdAt,
|
||||
updatedAt: updatedAt,
|
||||
);
|
||||
|
||||
@@ -296,7 +296,7 @@ $DeviceModelCopyWith<$Res> get item {
|
||||
/// @nodoc
|
||||
mixin _$DeviceModel {
|
||||
|
||||
String get id;@JsonKey(fromJson: _toString) String get identificator; int? get battery; String? get userId; String? get companyId; String? get delegationId; String? get groupId; Map<String, dynamic> get flags; List<String>? get tags; String? get lastConnection; String? get carrierGenre;@JsonKey(fromJson: _toNullableString) String? get carrierBirthday; int? get carrierWeight; int? get carrierStepLength; String? get carrierName; String? get comment; String? get phone; String? get simId; Map<String, dynamic>? get paymentOptions; Map<String, dynamic> get settings; String get connectionServer; String get protocol; String get type; Map<String, dynamic>? get capabilities;@JsonKey(fromJson: _toString) String get createdAt;@JsonKey(fromJson: _toNullableString) String? get updatedAt;
|
||||
String get id;@JsonKey(fromJson: _toString) String get identificator; int? get battery; String? get userId; String? get companyId; String? get delegationId; String? get groupId; Map<String, dynamic> get flags; List<String>? get tags; String? get lastConnection; String? get carrierGenre;@JsonKey(fromJson: _toNullableString) String? get carrierBirthday; int? get carrierWeight; int? get carrierStepLength; String? get carrierName; String? get comment; String? get phone; String? get simId; Map<String, dynamic>? get paymentOptions; DeviceSettingsModel get settings; String get connectionServer; String get protocol; String get type; DeviceCapabilitiesModel? get capabilities;@JsonKey(fromJson: _toString) String get createdAt;@JsonKey(fromJson: _toNullableString) String? get updatedAt;
|
||||
/// Create a copy of DeviceModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@@ -309,12 +309,12 @@ $DeviceModelCopyWith<DeviceModel> get copyWith => _$DeviceModelCopyWithImpl<Devi
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceModel&&(identical(other.id, id) || other.id == id)&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.battery, battery) || other.battery == battery)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.delegationId, delegationId) || other.delegationId == delegationId)&&(identical(other.groupId, groupId) || other.groupId == groupId)&&const DeepCollectionEquality().equals(other.flags, flags)&&const DeepCollectionEquality().equals(other.tags, tags)&&(identical(other.lastConnection, lastConnection) || other.lastConnection == lastConnection)&&(identical(other.carrierGenre, carrierGenre) || other.carrierGenre == carrierGenre)&&(identical(other.carrierBirthday, carrierBirthday) || other.carrierBirthday == carrierBirthday)&&(identical(other.carrierWeight, carrierWeight) || other.carrierWeight == carrierWeight)&&(identical(other.carrierStepLength, carrierStepLength) || other.carrierStepLength == carrierStepLength)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName)&&(identical(other.comment, comment) || other.comment == comment)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.simId, simId) || other.simId == simId)&&const DeepCollectionEquality().equals(other.paymentOptions, paymentOptions)&&const DeepCollectionEquality().equals(other.settings, settings)&&(identical(other.connectionServer, connectionServer) || other.connectionServer == connectionServer)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other.capabilities, capabilities)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceModel&&(identical(other.id, id) || other.id == id)&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.battery, battery) || other.battery == battery)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.delegationId, delegationId) || other.delegationId == delegationId)&&(identical(other.groupId, groupId) || other.groupId == groupId)&&const DeepCollectionEquality().equals(other.flags, flags)&&const DeepCollectionEquality().equals(other.tags, tags)&&(identical(other.lastConnection, lastConnection) || other.lastConnection == lastConnection)&&(identical(other.carrierGenre, carrierGenre) || other.carrierGenre == carrierGenre)&&(identical(other.carrierBirthday, carrierBirthday) || other.carrierBirthday == carrierBirthday)&&(identical(other.carrierWeight, carrierWeight) || other.carrierWeight == carrierWeight)&&(identical(other.carrierStepLength, carrierStepLength) || other.carrierStepLength == carrierStepLength)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName)&&(identical(other.comment, comment) || other.comment == comment)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.simId, simId) || other.simId == simId)&&const DeepCollectionEquality().equals(other.paymentOptions, paymentOptions)&&(identical(other.settings, settings) || other.settings == settings)&&(identical(other.connectionServer, connectionServer) || other.connectionServer == connectionServer)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.type, type) || other.type == type)&&(identical(other.capabilities, capabilities) || other.capabilities == capabilities)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hashAll([runtimeType,id,identificator,battery,userId,companyId,delegationId,groupId,const DeepCollectionEquality().hash(flags),const DeepCollectionEquality().hash(tags),lastConnection,carrierGenre,carrierBirthday,carrierWeight,carrierStepLength,carrierName,comment,phone,simId,const DeepCollectionEquality().hash(paymentOptions),const DeepCollectionEquality().hash(settings),connectionServer,protocol,type,const DeepCollectionEquality().hash(capabilities),createdAt,updatedAt]);
|
||||
int get hashCode => Object.hashAll([runtimeType,id,identificator,battery,userId,companyId,delegationId,groupId,const DeepCollectionEquality().hash(flags),const DeepCollectionEquality().hash(tags),lastConnection,carrierGenre,carrierBirthday,carrierWeight,carrierStepLength,carrierName,comment,phone,simId,const DeepCollectionEquality().hash(paymentOptions),settings,connectionServer,protocol,type,capabilities,createdAt,updatedAt]);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
@@ -329,11 +329,11 @@ abstract mixin class $DeviceModelCopyWith<$Res> {
|
||||
factory $DeviceModelCopyWith(DeviceModel value, $Res Function(DeviceModel) _then) = _$DeviceModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String id,@JsonKey(fromJson: _toString) String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre,@JsonKey(fromJson: _toNullableString) String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, Map<String, dynamic> settings, String connectionServer, String protocol, String type, Map<String, dynamic>? capabilities,@JsonKey(fromJson: _toString) String createdAt,@JsonKey(fromJson: _toNullableString) String? updatedAt
|
||||
String id,@JsonKey(fromJson: _toString) String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre,@JsonKey(fromJson: _toNullableString) String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, DeviceSettingsModel settings, String connectionServer, String protocol, String type, DeviceCapabilitiesModel? capabilities,@JsonKey(fromJson: _toString) String createdAt,@JsonKey(fromJson: _toNullableString) String? updatedAt
|
||||
});
|
||||
|
||||
|
||||
|
||||
$DeviceSettingsModelCopyWith<$Res> get settings;$DeviceCapabilitiesModelCopyWith<$Res>? get capabilities;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
@@ -368,16 +368,37 @@ as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullabl
|
||||
as String?,simId: freezed == simId ? _self.simId : simId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,paymentOptions: freezed == paymentOptions ? _self.paymentOptions : paymentOptions // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, dynamic>?,settings: null == settings ? _self.settings : settings // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, dynamic>,connectionServer: null == connectionServer ? _self.connectionServer : connectionServer // ignore: cast_nullable_to_non_nullable
|
||||
as DeviceSettingsModel,connectionServer: null == connectionServer ? _self.connectionServer : connectionServer // ignore: cast_nullable_to_non_nullable
|
||||
as String,protocol: null == protocol ? _self.protocol : protocol // ignore: cast_nullable_to_non_nullable
|
||||
as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
||||
as String,capabilities: freezed == capabilities ? _self.capabilities : capabilities // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, dynamic>?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DeviceCapabilitiesModel?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as String,updatedAt: freezed == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
/// Create a copy of DeviceModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$DeviceSettingsModelCopyWith<$Res> get settings {
|
||||
|
||||
return $DeviceSettingsModelCopyWith<$Res>(_self.settings, (value) {
|
||||
return _then(_self.copyWith(settings: value));
|
||||
});
|
||||
}/// Create a copy of DeviceModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$DeviceCapabilitiesModelCopyWith<$Res>? get capabilities {
|
||||
if (_self.capabilities == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $DeviceCapabilitiesModelCopyWith<$Res>(_self.capabilities!, (value) {
|
||||
return _then(_self.copyWith(capabilities: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -459,7 +480,7 @@ return $default(_that);case _:
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, @JsonKey(fromJson: _toString) String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, @JsonKey(fromJson: _toNullableString) String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, Map<String, dynamic> settings, String connectionServer, String protocol, String type, Map<String, dynamic>? capabilities, @JsonKey(fromJson: _toString) String createdAt, @JsonKey(fromJson: _toNullableString) String? updatedAt)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, @JsonKey(fromJson: _toString) String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, @JsonKey(fromJson: _toNullableString) String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, DeviceSettingsModel settings, String connectionServer, String protocol, String type, DeviceCapabilitiesModel? capabilities, @JsonKey(fromJson: _toString) String createdAt, @JsonKey(fromJson: _toNullableString) String? updatedAt)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceModel() when $default != null:
|
||||
return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.companyId,_that.delegationId,_that.groupId,_that.flags,_that.tags,_that.lastConnection,_that.carrierGenre,_that.carrierBirthday,_that.carrierWeight,_that.carrierStepLength,_that.carrierName,_that.comment,_that.phone,_that.simId,_that.paymentOptions,_that.settings,_that.connectionServer,_that.protocol,_that.type,_that.capabilities,_that.createdAt,_that.updatedAt);case _:
|
||||
@@ -480,7 +501,7 @@ return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.co
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, @JsonKey(fromJson: _toString) String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, @JsonKey(fromJson: _toNullableString) String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, Map<String, dynamic> settings, String connectionServer, String protocol, String type, Map<String, dynamic>? capabilities, @JsonKey(fromJson: _toString) String createdAt, @JsonKey(fromJson: _toNullableString) String? updatedAt) $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, @JsonKey(fromJson: _toString) String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, @JsonKey(fromJson: _toNullableString) String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, DeviceSettingsModel settings, String connectionServer, String protocol, String type, DeviceCapabilitiesModel? capabilities, @JsonKey(fromJson: _toString) String createdAt, @JsonKey(fromJson: _toNullableString) String? updatedAt) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceModel():
|
||||
return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.companyId,_that.delegationId,_that.groupId,_that.flags,_that.tags,_that.lastConnection,_that.carrierGenre,_that.carrierBirthday,_that.carrierWeight,_that.carrierStepLength,_that.carrierName,_that.comment,_that.phone,_that.simId,_that.paymentOptions,_that.settings,_that.connectionServer,_that.protocol,_that.type,_that.capabilities,_that.createdAt,_that.updatedAt);case _:
|
||||
@@ -500,7 +521,7 @@ return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.co
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, @JsonKey(fromJson: _toString) String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, @JsonKey(fromJson: _toNullableString) String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, Map<String, dynamic> settings, String connectionServer, String protocol, String type, Map<String, dynamic>? capabilities, @JsonKey(fromJson: _toString) String createdAt, @JsonKey(fromJson: _toNullableString) String? updatedAt)? $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, @JsonKey(fromJson: _toString) String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, @JsonKey(fromJson: _toNullableString) String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, DeviceSettingsModel settings, String connectionServer, String protocol, String type, DeviceCapabilitiesModel? capabilities, @JsonKey(fromJson: _toString) String createdAt, @JsonKey(fromJson: _toNullableString) String? updatedAt)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceModel() when $default != null:
|
||||
return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.companyId,_that.delegationId,_that.groupId,_that.flags,_that.tags,_that.lastConnection,_that.carrierGenre,_that.carrierBirthday,_that.carrierWeight,_that.carrierStepLength,_that.carrierName,_that.comment,_that.phone,_that.simId,_that.paymentOptions,_that.settings,_that.connectionServer,_that.protocol,_that.type,_that.capabilities,_that.createdAt,_that.updatedAt);case _:
|
||||
@@ -515,7 +536,7 @@ return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.co
|
||||
@JsonSerializable()
|
||||
|
||||
class _DeviceModel extends DeviceModel {
|
||||
const _DeviceModel({required this.id, @JsonKey(fromJson: _toString) required this.identificator, this.battery = null, this.userId = null, this.companyId = null, this.delegationId = null, this.groupId = null, final Map<String, dynamic> flags = const {}, final List<String>? tags = null, this.lastConnection = null, this.carrierGenre = null, @JsonKey(fromJson: _toNullableString) this.carrierBirthday = null, this.carrierWeight = null, this.carrierStepLength = null, this.carrierName = null, this.comment = null, this.phone = null, this.simId = null, final Map<String, dynamic>? paymentOptions = null, final Map<String, dynamic> settings = const {}, this.connectionServer = '', this.protocol = '', this.type = '', final Map<String, dynamic>? capabilities = null, @JsonKey(fromJson: _toString) this.createdAt = '', @JsonKey(fromJson: _toNullableString) this.updatedAt = null}): _flags = flags,_tags = tags,_paymentOptions = paymentOptions,_settings = settings,_capabilities = capabilities,super._();
|
||||
const _DeviceModel({required this.id, @JsonKey(fromJson: _toString) required this.identificator, this.battery = null, this.userId = null, this.companyId = null, this.delegationId = null, this.groupId = null, final Map<String, dynamic> flags = const {}, final List<String>? tags = null, this.lastConnection = null, this.carrierGenre = null, @JsonKey(fromJson: _toNullableString) this.carrierBirthday = null, this.carrierWeight = null, this.carrierStepLength = null, this.carrierName = null, this.comment = null, this.phone = null, this.simId = null, final Map<String, dynamic>? paymentOptions = null, this.settings = const DeviceSettingsModel(), this.connectionServer = '', this.protocol = '', this.type = '', this.capabilities = null, @JsonKey(fromJson: _toString) this.createdAt = '', @JsonKey(fromJson: _toNullableString) this.updatedAt = null}): _flags = flags,_tags = tags,_paymentOptions = paymentOptions,super._();
|
||||
factory _DeviceModel.fromJson(Map<String, dynamic> json) => _$DeviceModelFromJson(json);
|
||||
|
||||
@override final String id;
|
||||
@@ -559,25 +580,11 @@ class _DeviceModel extends DeviceModel {
|
||||
return EqualUnmodifiableMapView(value);
|
||||
}
|
||||
|
||||
final Map<String, dynamic> _settings;
|
||||
@override@JsonKey() Map<String, dynamic> get settings {
|
||||
if (_settings is EqualUnmodifiableMapView) return _settings;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableMapView(_settings);
|
||||
}
|
||||
|
||||
@override@JsonKey() final DeviceSettingsModel settings;
|
||||
@override@JsonKey() final String connectionServer;
|
||||
@override@JsonKey() final String protocol;
|
||||
@override@JsonKey() final String type;
|
||||
final Map<String, dynamic>? _capabilities;
|
||||
@override@JsonKey() Map<String, dynamic>? get capabilities {
|
||||
final value = _capabilities;
|
||||
if (value == null) return null;
|
||||
if (_capabilities is EqualUnmodifiableMapView) return _capabilities;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableMapView(value);
|
||||
}
|
||||
|
||||
@override@JsonKey() final DeviceCapabilitiesModel? capabilities;
|
||||
@override@JsonKey(fromJson: _toString) final String createdAt;
|
||||
@override@JsonKey(fromJson: _toNullableString) final String? updatedAt;
|
||||
|
||||
@@ -594,12 +601,12 @@ Map<String, dynamic> toJson() {
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceModel&&(identical(other.id, id) || other.id == id)&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.battery, battery) || other.battery == battery)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.delegationId, delegationId) || other.delegationId == delegationId)&&(identical(other.groupId, groupId) || other.groupId == groupId)&&const DeepCollectionEquality().equals(other._flags, _flags)&&const DeepCollectionEquality().equals(other._tags, _tags)&&(identical(other.lastConnection, lastConnection) || other.lastConnection == lastConnection)&&(identical(other.carrierGenre, carrierGenre) || other.carrierGenre == carrierGenre)&&(identical(other.carrierBirthday, carrierBirthday) || other.carrierBirthday == carrierBirthday)&&(identical(other.carrierWeight, carrierWeight) || other.carrierWeight == carrierWeight)&&(identical(other.carrierStepLength, carrierStepLength) || other.carrierStepLength == carrierStepLength)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName)&&(identical(other.comment, comment) || other.comment == comment)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.simId, simId) || other.simId == simId)&&const DeepCollectionEquality().equals(other._paymentOptions, _paymentOptions)&&const DeepCollectionEquality().equals(other._settings, _settings)&&(identical(other.connectionServer, connectionServer) || other.connectionServer == connectionServer)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other._capabilities, _capabilities)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceModel&&(identical(other.id, id) || other.id == id)&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.battery, battery) || other.battery == battery)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.delegationId, delegationId) || other.delegationId == delegationId)&&(identical(other.groupId, groupId) || other.groupId == groupId)&&const DeepCollectionEquality().equals(other._flags, _flags)&&const DeepCollectionEquality().equals(other._tags, _tags)&&(identical(other.lastConnection, lastConnection) || other.lastConnection == lastConnection)&&(identical(other.carrierGenre, carrierGenre) || other.carrierGenre == carrierGenre)&&(identical(other.carrierBirthday, carrierBirthday) || other.carrierBirthday == carrierBirthday)&&(identical(other.carrierWeight, carrierWeight) || other.carrierWeight == carrierWeight)&&(identical(other.carrierStepLength, carrierStepLength) || other.carrierStepLength == carrierStepLength)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName)&&(identical(other.comment, comment) || other.comment == comment)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.simId, simId) || other.simId == simId)&&const DeepCollectionEquality().equals(other._paymentOptions, _paymentOptions)&&(identical(other.settings, settings) || other.settings == settings)&&(identical(other.connectionServer, connectionServer) || other.connectionServer == connectionServer)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.type, type) || other.type == type)&&(identical(other.capabilities, capabilities) || other.capabilities == capabilities)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hashAll([runtimeType,id,identificator,battery,userId,companyId,delegationId,groupId,const DeepCollectionEquality().hash(_flags),const DeepCollectionEquality().hash(_tags),lastConnection,carrierGenre,carrierBirthday,carrierWeight,carrierStepLength,carrierName,comment,phone,simId,const DeepCollectionEquality().hash(_paymentOptions),const DeepCollectionEquality().hash(_settings),connectionServer,protocol,type,const DeepCollectionEquality().hash(_capabilities),createdAt,updatedAt]);
|
||||
int get hashCode => Object.hashAll([runtimeType,id,identificator,battery,userId,companyId,delegationId,groupId,const DeepCollectionEquality().hash(_flags),const DeepCollectionEquality().hash(_tags),lastConnection,carrierGenre,carrierBirthday,carrierWeight,carrierStepLength,carrierName,comment,phone,simId,const DeepCollectionEquality().hash(_paymentOptions),settings,connectionServer,protocol,type,capabilities,createdAt,updatedAt]);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
@@ -614,11 +621,11 @@ abstract mixin class _$DeviceModelCopyWith<$Res> implements $DeviceModelCopyWith
|
||||
factory _$DeviceModelCopyWith(_DeviceModel value, $Res Function(_DeviceModel) _then) = __$DeviceModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String id,@JsonKey(fromJson: _toString) String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre,@JsonKey(fromJson: _toNullableString) String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, Map<String, dynamic> settings, String connectionServer, String protocol, String type, Map<String, dynamic>? capabilities,@JsonKey(fromJson: _toString) String createdAt,@JsonKey(fromJson: _toNullableString) String? updatedAt
|
||||
String id,@JsonKey(fromJson: _toString) String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre,@JsonKey(fromJson: _toNullableString) String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, DeviceSettingsModel settings, String connectionServer, String protocol, String type, DeviceCapabilitiesModel? capabilities,@JsonKey(fromJson: _toString) String createdAt,@JsonKey(fromJson: _toNullableString) String? updatedAt
|
||||
});
|
||||
|
||||
|
||||
|
||||
@override $DeviceSettingsModelCopyWith<$Res> get settings;@override $DeviceCapabilitiesModelCopyWith<$Res>? get capabilities;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
@@ -652,18 +659,39 @@ as String?,comment: freezed == comment ? _self.comment : comment // ignore: cast
|
||||
as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable
|
||||
as String?,simId: freezed == simId ? _self.simId : simId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,paymentOptions: freezed == paymentOptions ? _self._paymentOptions : paymentOptions // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, dynamic>?,settings: null == settings ? _self._settings : settings // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, dynamic>,connectionServer: null == connectionServer ? _self.connectionServer : connectionServer // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, dynamic>?,settings: null == settings ? _self.settings : settings // ignore: cast_nullable_to_non_nullable
|
||||
as DeviceSettingsModel,connectionServer: null == connectionServer ? _self.connectionServer : connectionServer // ignore: cast_nullable_to_non_nullable
|
||||
as String,protocol: null == protocol ? _self.protocol : protocol // ignore: cast_nullable_to_non_nullable
|
||||
as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
||||
as String,capabilities: freezed == capabilities ? _self._capabilities : capabilities // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, dynamic>?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as String,capabilities: freezed == capabilities ? _self.capabilities : capabilities // ignore: cast_nullable_to_non_nullable
|
||||
as DeviceCapabilitiesModel?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as String,updatedAt: freezed == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of DeviceModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$DeviceSettingsModelCopyWith<$Res> get settings {
|
||||
|
||||
return $DeviceSettingsModelCopyWith<$Res>(_self.settings, (value) {
|
||||
return _then(_self.copyWith(settings: value));
|
||||
});
|
||||
}/// Create a copy of DeviceModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$DeviceCapabilitiesModelCopyWith<$Res>? get capabilities {
|
||||
if (_self.capabilities == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $DeviceCapabilitiesModelCopyWith<$Res>(_self.capabilities!, (value) {
|
||||
return _then(_self.copyWith(capabilities: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// dart format on
|
||||
|
||||
@@ -39,11 +39,17 @@ _DeviceModel _$DeviceModelFromJson(Map<String, dynamic> json) => _DeviceModel(
|
||||
phone: json['phone'] as String? ?? null,
|
||||
simId: json['simId'] as String? ?? null,
|
||||
paymentOptions: json['paymentOptions'] as Map<String, dynamic>? ?? null,
|
||||
settings: json['settings'] as Map<String, dynamic>? ?? const {},
|
||||
settings: json['settings'] == null
|
||||
? const DeviceSettingsModel()
|
||||
: DeviceSettingsModel.fromJson(json['settings'] as Map<String, dynamic>),
|
||||
connectionServer: json['connectionServer'] as String? ?? '',
|
||||
protocol: json['protocol'] as String? ?? '',
|
||||
type: json['type'] as String? ?? '',
|
||||
capabilities: json['capabilities'] as Map<String, dynamic>? ?? null,
|
||||
capabilities: json['capabilities'] == null
|
||||
? null
|
||||
: DeviceCapabilitiesModel.fromJson(
|
||||
json['capabilities'] as Map<String, dynamic>,
|
||||
),
|
||||
createdAt: json['createdAt'] == null ? '' : _toString(json['createdAt']),
|
||||
updatedAt: json['updatedAt'] == null
|
||||
? null
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:sf_shared/src/domain/entities/device_settings_entity.dart';
|
||||
|
||||
part 'device_settings_model.freezed.dart';
|
||||
part 'device_settings_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class DeviceSettingsModel with _$DeviceSettingsModel {
|
||||
const factory DeviceSettingsModel({
|
||||
@Default(60) int frequency,
|
||||
@Default(120) int frequencyHeartRate,
|
||||
@Default(0) int timezone,
|
||||
@Default(false) bool pedometer,
|
||||
@Default('es') String language,
|
||||
@Default([]) List<String> alerts,
|
||||
@Default(DeviceVolumeModel()) DeviceVolumeModel volume,
|
||||
String? soundMode,
|
||||
}) = _DeviceSettingsModel;
|
||||
|
||||
factory DeviceSettingsModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$DeviceSettingsModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class DeviceVolumeModel with _$DeviceVolumeModel {
|
||||
const factory DeviceVolumeModel({
|
||||
@Default(50) int media,
|
||||
@Default(50) int ringtone,
|
||||
@Default(50) int alarm,
|
||||
}) = _DeviceVolumeModel;
|
||||
|
||||
factory DeviceVolumeModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$DeviceVolumeModelFromJson(json);
|
||||
}
|
||||
|
||||
extension DeviceSettingsModelMapper on DeviceSettingsModel {
|
||||
DeviceSettingsEntity toEntity() => DeviceSettingsEntity(
|
||||
frequency: frequency,
|
||||
frequencyHeartRate: frequencyHeartRate,
|
||||
timezone: timezone,
|
||||
pedometer: pedometer,
|
||||
language: language,
|
||||
alerts: alerts,
|
||||
volume: DeviceVolumeEntity(
|
||||
media: volume.media,
|
||||
ringtone: volume.ringtone,
|
||||
alarm: volume.alarm,
|
||||
),
|
||||
soundMode: soundMode,
|
||||
);
|
||||
}
|
||||
|
||||
extension DeviceSettingsEntityMapper on DeviceSettingsEntity {
|
||||
Map<String, dynamic> toMap() => {
|
||||
'frequency': frequency,
|
||||
'frequencyHeartRate': frequencyHeartRate,
|
||||
'timezone': timezone,
|
||||
'pedometer': pedometer,
|
||||
'language': language,
|
||||
'alerts': alerts,
|
||||
'volume': {
|
||||
'media': volume.media,
|
||||
'ringtone': volume.ringtone,
|
||||
'alarm': volume.alarm,
|
||||
},
|
||||
'soundMode': soundMode ?? 'VIBRATION',
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,591 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'device_settings_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$DeviceSettingsModel {
|
||||
|
||||
int get frequency; int get frequencyHeartRate; int get timezone; bool get pedometer; String get language; List<String> get alerts; DeviceVolumeModel get volume; String? get soundMode;
|
||||
/// Create a copy of DeviceSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$DeviceSettingsModelCopyWith<DeviceSettingsModel> get copyWith => _$DeviceSettingsModelCopyWithImpl<DeviceSettingsModel>(this as DeviceSettingsModel, _$identity);
|
||||
|
||||
/// Serializes this DeviceSettingsModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceSettingsModel&&(identical(other.frequency, frequency) || other.frequency == frequency)&&(identical(other.frequencyHeartRate, frequencyHeartRate) || other.frequencyHeartRate == frequencyHeartRate)&&(identical(other.timezone, timezone) || other.timezone == timezone)&&(identical(other.pedometer, pedometer) || other.pedometer == pedometer)&&(identical(other.language, language) || other.language == language)&&const DeepCollectionEquality().equals(other.alerts, alerts)&&(identical(other.volume, volume) || other.volume == volume)&&(identical(other.soundMode, soundMode) || other.soundMode == soundMode));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(alerts),volume,soundMode);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DeviceSettingsModel(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts, volume: $volume, soundMode: $soundMode)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $DeviceSettingsModelCopyWith<$Res> {
|
||||
factory $DeviceSettingsModelCopyWith(DeviceSettingsModel value, $Res Function(DeviceSettingsModel) _then) = _$DeviceSettingsModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeModel volume, String? soundMode
|
||||
});
|
||||
|
||||
|
||||
$DeviceVolumeModelCopyWith<$Res> get volume;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$DeviceSettingsModelCopyWithImpl<$Res>
|
||||
implements $DeviceSettingsModelCopyWith<$Res> {
|
||||
_$DeviceSettingsModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final DeviceSettingsModel _self;
|
||||
final $Res Function(DeviceSettingsModel) _then;
|
||||
|
||||
/// Create a copy of DeviceSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? frequency = null,Object? frequencyHeartRate = null,Object? timezone = null,Object? pedometer = null,Object? language = null,Object? alerts = null,Object? volume = null,Object? soundMode = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
frequency: null == frequency ? _self.frequency : frequency // ignore: cast_nullable_to_non_nullable
|
||||
as int,frequencyHeartRate: null == frequencyHeartRate ? _self.frequencyHeartRate : frequencyHeartRate // ignore: cast_nullable_to_non_nullable
|
||||
as int,timezone: null == timezone ? _self.timezone : timezone // ignore: cast_nullable_to_non_nullable
|
||||
as int,pedometer: null == pedometer ? _self.pedometer : pedometer // ignore: cast_nullable_to_non_nullable
|
||||
as bool,language: null == language ? _self.language : language // ignore: cast_nullable_to_non_nullable
|
||||
as String,alerts: null == alerts ? _self.alerts : alerts // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>,volume: null == volume ? _self.volume : volume // ignore: cast_nullable_to_non_nullable
|
||||
as DeviceVolumeModel,soundMode: freezed == soundMode ? _self.soundMode : soundMode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
/// Create a copy of DeviceSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$DeviceVolumeModelCopyWith<$Res> get volume {
|
||||
|
||||
return $DeviceVolumeModelCopyWith<$Res>(_self.volume, (value) {
|
||||
return _then(_self.copyWith(volume: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [DeviceSettingsModel].
|
||||
extension DeviceSettingsModelPatterns on DeviceSettingsModel {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _DeviceSettingsModel value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceSettingsModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _DeviceSettingsModel value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceSettingsModel():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _DeviceSettingsModel value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceSettingsModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeModel volume, String? soundMode)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceSettingsModel() when $default != null:
|
||||
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeModel volume, String? soundMode) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceSettingsModel():
|
||||
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeModel volume, String? soundMode)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceSettingsModel() when $default != null:
|
||||
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _DeviceSettingsModel implements DeviceSettingsModel {
|
||||
const _DeviceSettingsModel({this.frequency = 60, this.frequencyHeartRate = 120, this.timezone = 0, this.pedometer = false, this.language = 'es', final List<String> alerts = const [], this.volume = const DeviceVolumeModel(), this.soundMode}): _alerts = alerts;
|
||||
factory _DeviceSettingsModel.fromJson(Map<String, dynamic> json) => _$DeviceSettingsModelFromJson(json);
|
||||
|
||||
@override@JsonKey() final int frequency;
|
||||
@override@JsonKey() final int frequencyHeartRate;
|
||||
@override@JsonKey() final int timezone;
|
||||
@override@JsonKey() final bool pedometer;
|
||||
@override@JsonKey() final String language;
|
||||
final List<String> _alerts;
|
||||
@override@JsonKey() List<String> get alerts {
|
||||
if (_alerts is EqualUnmodifiableListView) return _alerts;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_alerts);
|
||||
}
|
||||
|
||||
@override@JsonKey() final DeviceVolumeModel volume;
|
||||
@override final String? soundMode;
|
||||
|
||||
/// Create a copy of DeviceSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$DeviceSettingsModelCopyWith<_DeviceSettingsModel> get copyWith => __$DeviceSettingsModelCopyWithImpl<_DeviceSettingsModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$DeviceSettingsModelToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceSettingsModel&&(identical(other.frequency, frequency) || other.frequency == frequency)&&(identical(other.frequencyHeartRate, frequencyHeartRate) || other.frequencyHeartRate == frequencyHeartRate)&&(identical(other.timezone, timezone) || other.timezone == timezone)&&(identical(other.pedometer, pedometer) || other.pedometer == pedometer)&&(identical(other.language, language) || other.language == language)&&const DeepCollectionEquality().equals(other._alerts, _alerts)&&(identical(other.volume, volume) || other.volume == volume)&&(identical(other.soundMode, soundMode) || other.soundMode == soundMode));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(_alerts),volume,soundMode);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DeviceSettingsModel(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts, volume: $volume, soundMode: $soundMode)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$DeviceSettingsModelCopyWith<$Res> implements $DeviceSettingsModelCopyWith<$Res> {
|
||||
factory _$DeviceSettingsModelCopyWith(_DeviceSettingsModel value, $Res Function(_DeviceSettingsModel) _then) = __$DeviceSettingsModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeModel volume, String? soundMode
|
||||
});
|
||||
|
||||
|
||||
@override $DeviceVolumeModelCopyWith<$Res> get volume;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$DeviceSettingsModelCopyWithImpl<$Res>
|
||||
implements _$DeviceSettingsModelCopyWith<$Res> {
|
||||
__$DeviceSettingsModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _DeviceSettingsModel _self;
|
||||
final $Res Function(_DeviceSettingsModel) _then;
|
||||
|
||||
/// Create a copy of DeviceSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? frequency = null,Object? frequencyHeartRate = null,Object? timezone = null,Object? pedometer = null,Object? language = null,Object? alerts = null,Object? volume = null,Object? soundMode = freezed,}) {
|
||||
return _then(_DeviceSettingsModel(
|
||||
frequency: null == frequency ? _self.frequency : frequency // ignore: cast_nullable_to_non_nullable
|
||||
as int,frequencyHeartRate: null == frequencyHeartRate ? _self.frequencyHeartRate : frequencyHeartRate // ignore: cast_nullable_to_non_nullable
|
||||
as int,timezone: null == timezone ? _self.timezone : timezone // ignore: cast_nullable_to_non_nullable
|
||||
as int,pedometer: null == pedometer ? _self.pedometer : pedometer // ignore: cast_nullable_to_non_nullable
|
||||
as bool,language: null == language ? _self.language : language // ignore: cast_nullable_to_non_nullable
|
||||
as String,alerts: null == alerts ? _self._alerts : alerts // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>,volume: null == volume ? _self.volume : volume // ignore: cast_nullable_to_non_nullable
|
||||
as DeviceVolumeModel,soundMode: freezed == soundMode ? _self.soundMode : soundMode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of DeviceSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$DeviceVolumeModelCopyWith<$Res> get volume {
|
||||
|
||||
return $DeviceVolumeModelCopyWith<$Res>(_self.volume, (value) {
|
||||
return _then(_self.copyWith(volume: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// @nodoc
|
||||
mixin _$DeviceVolumeModel {
|
||||
|
||||
int get media; int get ringtone; int get alarm;
|
||||
/// Create a copy of DeviceVolumeModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$DeviceVolumeModelCopyWith<DeviceVolumeModel> get copyWith => _$DeviceVolumeModelCopyWithImpl<DeviceVolumeModel>(this as DeviceVolumeModel, _$identity);
|
||||
|
||||
/// Serializes this DeviceVolumeModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceVolumeModel&&(identical(other.media, media) || other.media == media)&&(identical(other.ringtone, ringtone) || other.ringtone == ringtone)&&(identical(other.alarm, alarm) || other.alarm == alarm));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,media,ringtone,alarm);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DeviceVolumeModel(media: $media, ringtone: $ringtone, alarm: $alarm)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $DeviceVolumeModelCopyWith<$Res> {
|
||||
factory $DeviceVolumeModelCopyWith(DeviceVolumeModel value, $Res Function(DeviceVolumeModel) _then) = _$DeviceVolumeModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
int media, int ringtone, int alarm
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$DeviceVolumeModelCopyWithImpl<$Res>
|
||||
implements $DeviceVolumeModelCopyWith<$Res> {
|
||||
_$DeviceVolumeModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final DeviceVolumeModel _self;
|
||||
final $Res Function(DeviceVolumeModel) _then;
|
||||
|
||||
/// Create a copy of DeviceVolumeModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? media = null,Object? ringtone = null,Object? alarm = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
media: null == media ? _self.media : media // ignore: cast_nullable_to_non_nullable
|
||||
as int,ringtone: null == ringtone ? _self.ringtone : ringtone // ignore: cast_nullable_to_non_nullable
|
||||
as int,alarm: null == alarm ? _self.alarm : alarm // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [DeviceVolumeModel].
|
||||
extension DeviceVolumeModelPatterns on DeviceVolumeModel {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _DeviceVolumeModel value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceVolumeModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _DeviceVolumeModel value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceVolumeModel():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _DeviceVolumeModel value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceVolumeModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int media, int ringtone, int alarm)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceVolumeModel() when $default != null:
|
||||
return $default(_that.media,_that.ringtone,_that.alarm);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int media, int ringtone, int alarm) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceVolumeModel():
|
||||
return $default(_that.media,_that.ringtone,_that.alarm);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int media, int ringtone, int alarm)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceVolumeModel() when $default != null:
|
||||
return $default(_that.media,_that.ringtone,_that.alarm);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _DeviceVolumeModel implements DeviceVolumeModel {
|
||||
const _DeviceVolumeModel({this.media = 50, this.ringtone = 50, this.alarm = 50});
|
||||
factory _DeviceVolumeModel.fromJson(Map<String, dynamic> json) => _$DeviceVolumeModelFromJson(json);
|
||||
|
||||
@override@JsonKey() final int media;
|
||||
@override@JsonKey() final int ringtone;
|
||||
@override@JsonKey() final int alarm;
|
||||
|
||||
/// Create a copy of DeviceVolumeModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$DeviceVolumeModelCopyWith<_DeviceVolumeModel> get copyWith => __$DeviceVolumeModelCopyWithImpl<_DeviceVolumeModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$DeviceVolumeModelToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceVolumeModel&&(identical(other.media, media) || other.media == media)&&(identical(other.ringtone, ringtone) || other.ringtone == ringtone)&&(identical(other.alarm, alarm) || other.alarm == alarm));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,media,ringtone,alarm);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DeviceVolumeModel(media: $media, ringtone: $ringtone, alarm: $alarm)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$DeviceVolumeModelCopyWith<$Res> implements $DeviceVolumeModelCopyWith<$Res> {
|
||||
factory _$DeviceVolumeModelCopyWith(_DeviceVolumeModel value, $Res Function(_DeviceVolumeModel) _then) = __$DeviceVolumeModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
int media, int ringtone, int alarm
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$DeviceVolumeModelCopyWithImpl<$Res>
|
||||
implements _$DeviceVolumeModelCopyWith<$Res> {
|
||||
__$DeviceVolumeModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _DeviceVolumeModel _self;
|
||||
final $Res Function(_DeviceVolumeModel) _then;
|
||||
|
||||
/// Create a copy of DeviceVolumeModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? media = null,Object? ringtone = null,Object? alarm = null,}) {
|
||||
return _then(_DeviceVolumeModel(
|
||||
media: null == media ? _self.media : media // ignore: cast_nullable_to_non_nullable
|
||||
as int,ringtone: null == ringtone ? _self.ringtone : ringtone // ignore: cast_nullable_to_non_nullable
|
||||
as int,alarm: null == alarm ? _self.alarm : alarm // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,52 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'device_settings_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_DeviceSettingsModel _$DeviceSettingsModelFromJson(Map<String, dynamic> json) =>
|
||||
_DeviceSettingsModel(
|
||||
frequency: (json['frequency'] as num?)?.toInt() ?? 60,
|
||||
frequencyHeartRate: (json['frequencyHeartRate'] as num?)?.toInt() ?? 120,
|
||||
timezone: (json['timezone'] as num?)?.toInt() ?? 0,
|
||||
pedometer: json['pedometer'] as bool? ?? false,
|
||||
language: json['language'] as String? ?? 'es',
|
||||
alerts:
|
||||
(json['alerts'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList() ??
|
||||
const [],
|
||||
volume: json['volume'] == null
|
||||
? const DeviceVolumeModel()
|
||||
: DeviceVolumeModel.fromJson(json['volume'] as Map<String, dynamic>),
|
||||
soundMode: json['soundMode'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$DeviceSettingsModelToJson(
|
||||
_DeviceSettingsModel instance,
|
||||
) => <String, dynamic>{
|
||||
'frequency': instance.frequency,
|
||||
'frequencyHeartRate': instance.frequencyHeartRate,
|
||||
'timezone': instance.timezone,
|
||||
'pedometer': instance.pedometer,
|
||||
'language': instance.language,
|
||||
'alerts': instance.alerts,
|
||||
'volume': instance.volume,
|
||||
'soundMode': instance.soundMode,
|
||||
};
|
||||
|
||||
_DeviceVolumeModel _$DeviceVolumeModelFromJson(Map<String, dynamic> json) =>
|
||||
_DeviceVolumeModel(
|
||||
media: (json['media'] as num?)?.toInt() ?? 50,
|
||||
ringtone: (json['ringtone'] as num?)?.toInt() ?? 50,
|
||||
alarm: (json['alarm'] as num?)?.toInt() ?? 50,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$DeviceVolumeModelToJson(_DeviceVolumeModel instance) =>
|
||||
<String, dynamic>{
|
||||
'media': instance.media,
|
||||
'ringtone': instance.ringtone,
|
||||
'alarm': instance.alarm,
|
||||
};
|
||||
@@ -0,0 +1,93 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'device_capabilities_entity.freezed.dart';
|
||||
|
||||
@freezed
|
||||
abstract class DeviceCapabilitiesEntity with _$DeviceCapabilitiesEntity {
|
||||
const factory DeviceCapabilitiesEntity({
|
||||
DeviceCapabilityOptionEntity? heartbeats,
|
||||
DeviceCapabilityEnabledEntity? bloodPressure,
|
||||
DeviceCapabilityAlertsEntity? alerts,
|
||||
DeviceCapabilityEnabledEntity? podometer,
|
||||
DeviceCapabilityContactsEntity? contacts,
|
||||
DeviceCapabilitySettingsEntity? settings,
|
||||
DeviceCapabilityCommandsEntity? commands,
|
||||
DeviceCapabilityTakepillsEntity? takepills,
|
||||
DeviceCapabilityOptionEntity? location,
|
||||
DeviceCapabilityCameraEntity? camera,
|
||||
}) = _DeviceCapabilitiesEntity;
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class DeviceCapabilityEnabledEntity with _$DeviceCapabilityEnabledEntity {
|
||||
const factory DeviceCapabilityEnabledEntity({
|
||||
@Default(false) bool enabled,
|
||||
}) = _DeviceCapabilityEnabledEntity;
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class DeviceCapabilityOptionEntity with _$DeviceCapabilityOptionEntity {
|
||||
const factory DeviceCapabilityOptionEntity({
|
||||
@Default(0) int defaultValue,
|
||||
@Default(false) bool enabled,
|
||||
@Default([]) List<int> options,
|
||||
}) = _DeviceCapabilityOptionEntity;
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class DeviceCapabilityAlertsEntity with _$DeviceCapabilityAlertsEntity {
|
||||
const factory DeviceCapabilityAlertsEntity({
|
||||
@Default(false) bool enabled,
|
||||
@Default([]) List<String> types,
|
||||
}) = _DeviceCapabilityAlertsEntity;
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class DeviceCapabilityContactsEntity with _$DeviceCapabilityContactsEntity {
|
||||
const factory DeviceCapabilityContactsEntity({
|
||||
@Default(false) bool enabled,
|
||||
@Default([]) List<DeviceCapabilityContactTypeEntity> types,
|
||||
@Default(false) bool isPhonebookWithPhoto,
|
||||
}) = _DeviceCapabilityContactsEntity;
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class DeviceCapabilityContactTypeEntity with _$DeviceCapabilityContactTypeEntity {
|
||||
const factory DeviceCapabilityContactTypeEntity({
|
||||
@Default('') String type,
|
||||
@Default(0) int amount,
|
||||
}) = _DeviceCapabilityContactTypeEntity;
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class DeviceCapabilitySettingsEntity with _$DeviceCapabilitySettingsEntity {
|
||||
const factory DeviceCapabilitySettingsEntity({
|
||||
@Default(false) bool language,
|
||||
@Default(false) bool timezone,
|
||||
@Default([]) List<String> soundModes,
|
||||
}) = _DeviceCapabilitySettingsEntity;
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class DeviceCapabilityCommandsEntity with _$DeviceCapabilityCommandsEntity {
|
||||
const factory DeviceCapabilityCommandsEntity({
|
||||
@Default(false) bool enabled,
|
||||
@Default([]) List<String> types,
|
||||
}) = _DeviceCapabilityCommandsEntity;
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class DeviceCapabilityTakepillsEntity with _$DeviceCapabilityTakepillsEntity {
|
||||
const factory DeviceCapabilityTakepillsEntity({
|
||||
@Default(false) bool enabled,
|
||||
@Default(0) int maxReminders,
|
||||
}) = _DeviceCapabilityTakepillsEntity;
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class DeviceCapabilityCameraEntity with _$DeviceCapabilityCameraEntity {
|
||||
const factory DeviceCapabilityCameraEntity({
|
||||
@Default('') String format,
|
||||
@Default(false) bool enabled,
|
||||
}) = _DeviceCapabilityCameraEntity;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,8 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
import 'device_capabilities_entity.dart';
|
||||
import 'device_settings_entity.dart';
|
||||
|
||||
part 'device_entity.freezed.dart';
|
||||
|
||||
@freezed
|
||||
@@ -24,11 +27,11 @@ abstract class DeviceEntity with _$DeviceEntity {
|
||||
String? phone,
|
||||
String? simId,
|
||||
Map<String, dynamic>? paymentOptions,
|
||||
@Default({}) Map<String, dynamic> settings,
|
||||
@Default(DeviceSettingsEntity()) DeviceSettingsEntity settings,
|
||||
@Default('') String connectionServer,
|
||||
@Default('') String protocol,
|
||||
@Default('') String type,
|
||||
Map<String, dynamic>? capabilities,
|
||||
DeviceCapabilitiesEntity? capabilities,
|
||||
@Default('') String createdAt,
|
||||
String? updatedAt,
|
||||
}) = _DeviceEntity;
|
||||
|
||||
@@ -14,7 +14,7 @@ T _$identity<T>(T value) => value;
|
||||
/// @nodoc
|
||||
mixin _$DeviceEntity {
|
||||
|
||||
String get id; String get identificator; int? get battery; String? get userId; String? get companyId; String? get delegationId; String? get groupId; Map<String, dynamic> get flags; List<String>? get tags; String? get lastConnection; String? get carrierGenre; String? get carrierBirthday; int? get carrierWeight; int? get carrierStepLength; String? get carrierName; String? get comment; String? get phone; String? get simId; Map<String, dynamic>? get paymentOptions; Map<String, dynamic> get settings; String get connectionServer; String get protocol; String get type; Map<String, dynamic>? get capabilities; String get createdAt; String? get updatedAt;
|
||||
String get id; String get identificator; int? get battery; String? get userId; String? get companyId; String? get delegationId; String? get groupId; Map<String, dynamic> get flags; List<String>? get tags; String? get lastConnection; String? get carrierGenre; String? get carrierBirthday; int? get carrierWeight; int? get carrierStepLength; String? get carrierName; String? get comment; String? get phone; String? get simId; Map<String, dynamic>? get paymentOptions; DeviceSettingsEntity get settings; String get connectionServer; String get protocol; String get type; DeviceCapabilitiesEntity? get capabilities; String get createdAt; String? get updatedAt;
|
||||
/// Create a copy of DeviceEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@@ -25,12 +25,12 @@ $DeviceEntityCopyWith<DeviceEntity> get copyWith => _$DeviceEntityCopyWithImpl<D
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceEntity&&(identical(other.id, id) || other.id == id)&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.battery, battery) || other.battery == battery)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.delegationId, delegationId) || other.delegationId == delegationId)&&(identical(other.groupId, groupId) || other.groupId == groupId)&&const DeepCollectionEquality().equals(other.flags, flags)&&const DeepCollectionEquality().equals(other.tags, tags)&&(identical(other.lastConnection, lastConnection) || other.lastConnection == lastConnection)&&(identical(other.carrierGenre, carrierGenre) || other.carrierGenre == carrierGenre)&&(identical(other.carrierBirthday, carrierBirthday) || other.carrierBirthday == carrierBirthday)&&(identical(other.carrierWeight, carrierWeight) || other.carrierWeight == carrierWeight)&&(identical(other.carrierStepLength, carrierStepLength) || other.carrierStepLength == carrierStepLength)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName)&&(identical(other.comment, comment) || other.comment == comment)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.simId, simId) || other.simId == simId)&&const DeepCollectionEquality().equals(other.paymentOptions, paymentOptions)&&const DeepCollectionEquality().equals(other.settings, settings)&&(identical(other.connectionServer, connectionServer) || other.connectionServer == connectionServer)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other.capabilities, capabilities)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceEntity&&(identical(other.id, id) || other.id == id)&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.battery, battery) || other.battery == battery)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.delegationId, delegationId) || other.delegationId == delegationId)&&(identical(other.groupId, groupId) || other.groupId == groupId)&&const DeepCollectionEquality().equals(other.flags, flags)&&const DeepCollectionEquality().equals(other.tags, tags)&&(identical(other.lastConnection, lastConnection) || other.lastConnection == lastConnection)&&(identical(other.carrierGenre, carrierGenre) || other.carrierGenre == carrierGenre)&&(identical(other.carrierBirthday, carrierBirthday) || other.carrierBirthday == carrierBirthday)&&(identical(other.carrierWeight, carrierWeight) || other.carrierWeight == carrierWeight)&&(identical(other.carrierStepLength, carrierStepLength) || other.carrierStepLength == carrierStepLength)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName)&&(identical(other.comment, comment) || other.comment == comment)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.simId, simId) || other.simId == simId)&&const DeepCollectionEquality().equals(other.paymentOptions, paymentOptions)&&(identical(other.settings, settings) || other.settings == settings)&&(identical(other.connectionServer, connectionServer) || other.connectionServer == connectionServer)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.type, type) || other.type == type)&&(identical(other.capabilities, capabilities) || other.capabilities == capabilities)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hashAll([runtimeType,id,identificator,battery,userId,companyId,delegationId,groupId,const DeepCollectionEquality().hash(flags),const DeepCollectionEquality().hash(tags),lastConnection,carrierGenre,carrierBirthday,carrierWeight,carrierStepLength,carrierName,comment,phone,simId,const DeepCollectionEquality().hash(paymentOptions),const DeepCollectionEquality().hash(settings),connectionServer,protocol,type,const DeepCollectionEquality().hash(capabilities),createdAt,updatedAt]);
|
||||
int get hashCode => Object.hashAll([runtimeType,id,identificator,battery,userId,companyId,delegationId,groupId,const DeepCollectionEquality().hash(flags),const DeepCollectionEquality().hash(tags),lastConnection,carrierGenre,carrierBirthday,carrierWeight,carrierStepLength,carrierName,comment,phone,simId,const DeepCollectionEquality().hash(paymentOptions),settings,connectionServer,protocol,type,capabilities,createdAt,updatedAt]);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
@@ -45,11 +45,11 @@ abstract mixin class $DeviceEntityCopyWith<$Res> {
|
||||
factory $DeviceEntityCopyWith(DeviceEntity value, $Res Function(DeviceEntity) _then) = _$DeviceEntityCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, Map<String, dynamic> settings, String connectionServer, String protocol, String type, Map<String, dynamic>? capabilities, String createdAt, String? updatedAt
|
||||
String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, DeviceSettingsEntity settings, String connectionServer, String protocol, String type, DeviceCapabilitiesEntity? capabilities, String createdAt, String? updatedAt
|
||||
});
|
||||
|
||||
|
||||
|
||||
$DeviceSettingsEntityCopyWith<$Res> get settings;$DeviceCapabilitiesEntityCopyWith<$Res>? get capabilities;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
@@ -84,16 +84,37 @@ as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullabl
|
||||
as String?,simId: freezed == simId ? _self.simId : simId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,paymentOptions: freezed == paymentOptions ? _self.paymentOptions : paymentOptions // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, dynamic>?,settings: null == settings ? _self.settings : settings // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, dynamic>,connectionServer: null == connectionServer ? _self.connectionServer : connectionServer // ignore: cast_nullable_to_non_nullable
|
||||
as DeviceSettingsEntity,connectionServer: null == connectionServer ? _self.connectionServer : connectionServer // ignore: cast_nullable_to_non_nullable
|
||||
as String,protocol: null == protocol ? _self.protocol : protocol // ignore: cast_nullable_to_non_nullable
|
||||
as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
||||
as String,capabilities: freezed == capabilities ? _self.capabilities : capabilities // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, dynamic>?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DeviceCapabilitiesEntity?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as String,updatedAt: freezed == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
/// Create a copy of DeviceEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$DeviceSettingsEntityCopyWith<$Res> get settings {
|
||||
|
||||
return $DeviceSettingsEntityCopyWith<$Res>(_self.settings, (value) {
|
||||
return _then(_self.copyWith(settings: value));
|
||||
});
|
||||
}/// Create a copy of DeviceEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$DeviceCapabilitiesEntityCopyWith<$Res>? get capabilities {
|
||||
if (_self.capabilities == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $DeviceCapabilitiesEntityCopyWith<$Res>(_self.capabilities!, (value) {
|
||||
return _then(_self.copyWith(capabilities: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -175,7 +196,7 @@ return $default(_that);case _:
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, Map<String, dynamic> settings, String connectionServer, String protocol, String type, Map<String, dynamic>? capabilities, String createdAt, String? updatedAt)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, DeviceSettingsEntity settings, String connectionServer, String protocol, String type, DeviceCapabilitiesEntity? capabilities, String createdAt, String? updatedAt)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceEntity() when $default != null:
|
||||
return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.companyId,_that.delegationId,_that.groupId,_that.flags,_that.tags,_that.lastConnection,_that.carrierGenre,_that.carrierBirthday,_that.carrierWeight,_that.carrierStepLength,_that.carrierName,_that.comment,_that.phone,_that.simId,_that.paymentOptions,_that.settings,_that.connectionServer,_that.protocol,_that.type,_that.capabilities,_that.createdAt,_that.updatedAt);case _:
|
||||
@@ -196,7 +217,7 @@ return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.co
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, Map<String, dynamic> settings, String connectionServer, String protocol, String type, Map<String, dynamic>? capabilities, String createdAt, String? updatedAt) $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, DeviceSettingsEntity settings, String connectionServer, String protocol, String type, DeviceCapabilitiesEntity? capabilities, String createdAt, String? updatedAt) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceEntity():
|
||||
return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.companyId,_that.delegationId,_that.groupId,_that.flags,_that.tags,_that.lastConnection,_that.carrierGenre,_that.carrierBirthday,_that.carrierWeight,_that.carrierStepLength,_that.carrierName,_that.comment,_that.phone,_that.simId,_that.paymentOptions,_that.settings,_that.connectionServer,_that.protocol,_that.type,_that.capabilities,_that.createdAt,_that.updatedAt);case _:
|
||||
@@ -216,7 +237,7 @@ return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.co
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, Map<String, dynamic> settings, String connectionServer, String protocol, String type, Map<String, dynamic>? capabilities, String createdAt, String? updatedAt)? $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, DeviceSettingsEntity settings, String connectionServer, String protocol, String type, DeviceCapabilitiesEntity? capabilities, String createdAt, String? updatedAt)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceEntity() when $default != null:
|
||||
return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.companyId,_that.delegationId,_that.groupId,_that.flags,_that.tags,_that.lastConnection,_that.carrierGenre,_that.carrierBirthday,_that.carrierWeight,_that.carrierStepLength,_that.carrierName,_that.comment,_that.phone,_that.simId,_that.paymentOptions,_that.settings,_that.connectionServer,_that.protocol,_that.type,_that.capabilities,_that.createdAt,_that.updatedAt);case _:
|
||||
@@ -231,7 +252,7 @@ return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.co
|
||||
|
||||
|
||||
class _DeviceEntity implements DeviceEntity {
|
||||
const _DeviceEntity({required this.id, required this.identificator, this.battery, this.userId, this.companyId, this.delegationId, this.groupId, final Map<String, dynamic> flags = const {}, final List<String>? tags, this.lastConnection, this.carrierGenre, this.carrierBirthday, this.carrierWeight, this.carrierStepLength, this.carrierName, this.comment, this.phone, this.simId, final Map<String, dynamic>? paymentOptions, final Map<String, dynamic> settings = const {}, this.connectionServer = '', this.protocol = '', this.type = '', final Map<String, dynamic>? capabilities, this.createdAt = '', this.updatedAt}): _flags = flags,_tags = tags,_paymentOptions = paymentOptions,_settings = settings,_capabilities = capabilities;
|
||||
const _DeviceEntity({required this.id, required this.identificator, this.battery, this.userId, this.companyId, this.delegationId, this.groupId, final Map<String, dynamic> flags = const {}, final List<String>? tags, this.lastConnection, this.carrierGenre, this.carrierBirthday, this.carrierWeight, this.carrierStepLength, this.carrierName, this.comment, this.phone, this.simId, final Map<String, dynamic>? paymentOptions, this.settings = const DeviceSettingsEntity(), this.connectionServer = '', this.protocol = '', this.type = '', this.capabilities, this.createdAt = '', this.updatedAt}): _flags = flags,_tags = tags,_paymentOptions = paymentOptions;
|
||||
|
||||
|
||||
@override final String id;
|
||||
@@ -275,25 +296,11 @@ class _DeviceEntity implements DeviceEntity {
|
||||
return EqualUnmodifiableMapView(value);
|
||||
}
|
||||
|
||||
final Map<String, dynamic> _settings;
|
||||
@override@JsonKey() Map<String, dynamic> get settings {
|
||||
if (_settings is EqualUnmodifiableMapView) return _settings;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableMapView(_settings);
|
||||
}
|
||||
|
||||
@override@JsonKey() final DeviceSettingsEntity settings;
|
||||
@override@JsonKey() final String connectionServer;
|
||||
@override@JsonKey() final String protocol;
|
||||
@override@JsonKey() final String type;
|
||||
final Map<String, dynamic>? _capabilities;
|
||||
@override Map<String, dynamic>? get capabilities {
|
||||
final value = _capabilities;
|
||||
if (value == null) return null;
|
||||
if (_capabilities is EqualUnmodifiableMapView) return _capabilities;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableMapView(value);
|
||||
}
|
||||
|
||||
@override final DeviceCapabilitiesEntity? capabilities;
|
||||
@override@JsonKey() final String createdAt;
|
||||
@override final String? updatedAt;
|
||||
|
||||
@@ -307,12 +314,12 @@ _$DeviceEntityCopyWith<_DeviceEntity> get copyWith => __$DeviceEntityCopyWithImp
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceEntity&&(identical(other.id, id) || other.id == id)&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.battery, battery) || other.battery == battery)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.delegationId, delegationId) || other.delegationId == delegationId)&&(identical(other.groupId, groupId) || other.groupId == groupId)&&const DeepCollectionEquality().equals(other._flags, _flags)&&const DeepCollectionEquality().equals(other._tags, _tags)&&(identical(other.lastConnection, lastConnection) || other.lastConnection == lastConnection)&&(identical(other.carrierGenre, carrierGenre) || other.carrierGenre == carrierGenre)&&(identical(other.carrierBirthday, carrierBirthday) || other.carrierBirthday == carrierBirthday)&&(identical(other.carrierWeight, carrierWeight) || other.carrierWeight == carrierWeight)&&(identical(other.carrierStepLength, carrierStepLength) || other.carrierStepLength == carrierStepLength)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName)&&(identical(other.comment, comment) || other.comment == comment)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.simId, simId) || other.simId == simId)&&const DeepCollectionEquality().equals(other._paymentOptions, _paymentOptions)&&const DeepCollectionEquality().equals(other._settings, _settings)&&(identical(other.connectionServer, connectionServer) || other.connectionServer == connectionServer)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other._capabilities, _capabilities)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceEntity&&(identical(other.id, id) || other.id == id)&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.battery, battery) || other.battery == battery)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.delegationId, delegationId) || other.delegationId == delegationId)&&(identical(other.groupId, groupId) || other.groupId == groupId)&&const DeepCollectionEquality().equals(other._flags, _flags)&&const DeepCollectionEquality().equals(other._tags, _tags)&&(identical(other.lastConnection, lastConnection) || other.lastConnection == lastConnection)&&(identical(other.carrierGenre, carrierGenre) || other.carrierGenre == carrierGenre)&&(identical(other.carrierBirthday, carrierBirthday) || other.carrierBirthday == carrierBirthday)&&(identical(other.carrierWeight, carrierWeight) || other.carrierWeight == carrierWeight)&&(identical(other.carrierStepLength, carrierStepLength) || other.carrierStepLength == carrierStepLength)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName)&&(identical(other.comment, comment) || other.comment == comment)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.simId, simId) || other.simId == simId)&&const DeepCollectionEquality().equals(other._paymentOptions, _paymentOptions)&&(identical(other.settings, settings) || other.settings == settings)&&(identical(other.connectionServer, connectionServer) || other.connectionServer == connectionServer)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.type, type) || other.type == type)&&(identical(other.capabilities, capabilities) || other.capabilities == capabilities)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hashAll([runtimeType,id,identificator,battery,userId,companyId,delegationId,groupId,const DeepCollectionEquality().hash(_flags),const DeepCollectionEquality().hash(_tags),lastConnection,carrierGenre,carrierBirthday,carrierWeight,carrierStepLength,carrierName,comment,phone,simId,const DeepCollectionEquality().hash(_paymentOptions),const DeepCollectionEquality().hash(_settings),connectionServer,protocol,type,const DeepCollectionEquality().hash(_capabilities),createdAt,updatedAt]);
|
||||
int get hashCode => Object.hashAll([runtimeType,id,identificator,battery,userId,companyId,delegationId,groupId,const DeepCollectionEquality().hash(_flags),const DeepCollectionEquality().hash(_tags),lastConnection,carrierGenre,carrierBirthday,carrierWeight,carrierStepLength,carrierName,comment,phone,simId,const DeepCollectionEquality().hash(_paymentOptions),settings,connectionServer,protocol,type,capabilities,createdAt,updatedAt]);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
@@ -327,11 +334,11 @@ abstract mixin class _$DeviceEntityCopyWith<$Res> implements $DeviceEntityCopyWi
|
||||
factory _$DeviceEntityCopyWith(_DeviceEntity value, $Res Function(_DeviceEntity) _then) = __$DeviceEntityCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, Map<String, dynamic> settings, String connectionServer, String protocol, String type, Map<String, dynamic>? capabilities, String createdAt, String? updatedAt
|
||||
String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, DeviceSettingsEntity settings, String connectionServer, String protocol, String type, DeviceCapabilitiesEntity? capabilities, String createdAt, String? updatedAt
|
||||
});
|
||||
|
||||
|
||||
|
||||
@override $DeviceSettingsEntityCopyWith<$Res> get settings;@override $DeviceCapabilitiesEntityCopyWith<$Res>? get capabilities;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
@@ -365,18 +372,39 @@ as String?,comment: freezed == comment ? _self.comment : comment // ignore: cast
|
||||
as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable
|
||||
as String?,simId: freezed == simId ? _self.simId : simId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,paymentOptions: freezed == paymentOptions ? _self._paymentOptions : paymentOptions // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, dynamic>?,settings: null == settings ? _self._settings : settings // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, dynamic>,connectionServer: null == connectionServer ? _self.connectionServer : connectionServer // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, dynamic>?,settings: null == settings ? _self.settings : settings // ignore: cast_nullable_to_non_nullable
|
||||
as DeviceSettingsEntity,connectionServer: null == connectionServer ? _self.connectionServer : connectionServer // ignore: cast_nullable_to_non_nullable
|
||||
as String,protocol: null == protocol ? _self.protocol : protocol // ignore: cast_nullable_to_non_nullable
|
||||
as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
||||
as String,capabilities: freezed == capabilities ? _self._capabilities : capabilities // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, dynamic>?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as String,capabilities: freezed == capabilities ? _self.capabilities : capabilities // ignore: cast_nullable_to_non_nullable
|
||||
as DeviceCapabilitiesEntity?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as String,updatedAt: freezed == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of DeviceEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$DeviceSettingsEntityCopyWith<$Res> get settings {
|
||||
|
||||
return $DeviceSettingsEntityCopyWith<$Res>(_self.settings, (value) {
|
||||
return _then(_self.copyWith(settings: value));
|
||||
});
|
||||
}/// Create a copy of DeviceEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$DeviceCapabilitiesEntityCopyWith<$Res>? get capabilities {
|
||||
if (_self.capabilities == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $DeviceCapabilitiesEntityCopyWith<$Res>(_self.capabilities!, (value) {
|
||||
return _then(_self.copyWith(capabilities: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// dart format on
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'device_settings_entity.freezed.dart';
|
||||
|
||||
@freezed
|
||||
abstract class DeviceSettingsEntity with _$DeviceSettingsEntity {
|
||||
const factory DeviceSettingsEntity({
|
||||
@Default(60) int frequency,
|
||||
@Default(120) int frequencyHeartRate,
|
||||
@Default(0) int timezone,
|
||||
@Default(false) bool pedometer,
|
||||
@Default('es') String language,
|
||||
@Default([]) List<String> alerts,
|
||||
@Default(DeviceVolumeEntity()) DeviceVolumeEntity volume,
|
||||
String? soundMode,
|
||||
}) = _DeviceSettingsEntity;
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class DeviceVolumeEntity with _$DeviceVolumeEntity {
|
||||
const factory DeviceVolumeEntity({
|
||||
@Default(50) int media,
|
||||
@Default(50) int ringtone,
|
||||
@Default(50) int alarm,
|
||||
}) = _DeviceVolumeEntity;
|
||||
}
|
||||
@@ -0,0 +1,579 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'device_settings_entity.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
/// @nodoc
|
||||
mixin _$DeviceSettingsEntity {
|
||||
|
||||
int get frequency; int get frequencyHeartRate; int get timezone; bool get pedometer; String get language; List<String> get alerts; DeviceVolumeEntity get volume; String? get soundMode;
|
||||
/// Create a copy of DeviceSettingsEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$DeviceSettingsEntityCopyWith<DeviceSettingsEntity> get copyWith => _$DeviceSettingsEntityCopyWithImpl<DeviceSettingsEntity>(this as DeviceSettingsEntity, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceSettingsEntity&&(identical(other.frequency, frequency) || other.frequency == frequency)&&(identical(other.frequencyHeartRate, frequencyHeartRate) || other.frequencyHeartRate == frequencyHeartRate)&&(identical(other.timezone, timezone) || other.timezone == timezone)&&(identical(other.pedometer, pedometer) || other.pedometer == pedometer)&&(identical(other.language, language) || other.language == language)&&const DeepCollectionEquality().equals(other.alerts, alerts)&&(identical(other.volume, volume) || other.volume == volume)&&(identical(other.soundMode, soundMode) || other.soundMode == soundMode));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(alerts),volume,soundMode);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DeviceSettingsEntity(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts, volume: $volume, soundMode: $soundMode)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $DeviceSettingsEntityCopyWith<$Res> {
|
||||
factory $DeviceSettingsEntityCopyWith(DeviceSettingsEntity value, $Res Function(DeviceSettingsEntity) _then) = _$DeviceSettingsEntityCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeEntity volume, String? soundMode
|
||||
});
|
||||
|
||||
|
||||
$DeviceVolumeEntityCopyWith<$Res> get volume;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$DeviceSettingsEntityCopyWithImpl<$Res>
|
||||
implements $DeviceSettingsEntityCopyWith<$Res> {
|
||||
_$DeviceSettingsEntityCopyWithImpl(this._self, this._then);
|
||||
|
||||
final DeviceSettingsEntity _self;
|
||||
final $Res Function(DeviceSettingsEntity) _then;
|
||||
|
||||
/// Create a copy of DeviceSettingsEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? frequency = null,Object? frequencyHeartRate = null,Object? timezone = null,Object? pedometer = null,Object? language = null,Object? alerts = null,Object? volume = null,Object? soundMode = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
frequency: null == frequency ? _self.frequency : frequency // ignore: cast_nullable_to_non_nullable
|
||||
as int,frequencyHeartRate: null == frequencyHeartRate ? _self.frequencyHeartRate : frequencyHeartRate // ignore: cast_nullable_to_non_nullable
|
||||
as int,timezone: null == timezone ? _self.timezone : timezone // ignore: cast_nullable_to_non_nullable
|
||||
as int,pedometer: null == pedometer ? _self.pedometer : pedometer // ignore: cast_nullable_to_non_nullable
|
||||
as bool,language: null == language ? _self.language : language // ignore: cast_nullable_to_non_nullable
|
||||
as String,alerts: null == alerts ? _self.alerts : alerts // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>,volume: null == volume ? _self.volume : volume // ignore: cast_nullable_to_non_nullable
|
||||
as DeviceVolumeEntity,soundMode: freezed == soundMode ? _self.soundMode : soundMode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
/// Create a copy of DeviceSettingsEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$DeviceVolumeEntityCopyWith<$Res> get volume {
|
||||
|
||||
return $DeviceVolumeEntityCopyWith<$Res>(_self.volume, (value) {
|
||||
return _then(_self.copyWith(volume: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [DeviceSettingsEntity].
|
||||
extension DeviceSettingsEntityPatterns on DeviceSettingsEntity {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _DeviceSettingsEntity value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceSettingsEntity() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _DeviceSettingsEntity value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceSettingsEntity():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _DeviceSettingsEntity value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceSettingsEntity() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeEntity volume, String? soundMode)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceSettingsEntity() when $default != null:
|
||||
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeEntity volume, String? soundMode) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceSettingsEntity():
|
||||
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeEntity volume, String? soundMode)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceSettingsEntity() when $default != null:
|
||||
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
|
||||
class _DeviceSettingsEntity implements DeviceSettingsEntity {
|
||||
const _DeviceSettingsEntity({this.frequency = 60, this.frequencyHeartRate = 120, this.timezone = 0, this.pedometer = false, this.language = 'es', final List<String> alerts = const [], this.volume = const DeviceVolumeEntity(), this.soundMode}): _alerts = alerts;
|
||||
|
||||
|
||||
@override@JsonKey() final int frequency;
|
||||
@override@JsonKey() final int frequencyHeartRate;
|
||||
@override@JsonKey() final int timezone;
|
||||
@override@JsonKey() final bool pedometer;
|
||||
@override@JsonKey() final String language;
|
||||
final List<String> _alerts;
|
||||
@override@JsonKey() List<String> get alerts {
|
||||
if (_alerts is EqualUnmodifiableListView) return _alerts;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_alerts);
|
||||
}
|
||||
|
||||
@override@JsonKey() final DeviceVolumeEntity volume;
|
||||
@override final String? soundMode;
|
||||
|
||||
/// Create a copy of DeviceSettingsEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$DeviceSettingsEntityCopyWith<_DeviceSettingsEntity> get copyWith => __$DeviceSettingsEntityCopyWithImpl<_DeviceSettingsEntity>(this, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceSettingsEntity&&(identical(other.frequency, frequency) || other.frequency == frequency)&&(identical(other.frequencyHeartRate, frequencyHeartRate) || other.frequencyHeartRate == frequencyHeartRate)&&(identical(other.timezone, timezone) || other.timezone == timezone)&&(identical(other.pedometer, pedometer) || other.pedometer == pedometer)&&(identical(other.language, language) || other.language == language)&&const DeepCollectionEquality().equals(other._alerts, _alerts)&&(identical(other.volume, volume) || other.volume == volume)&&(identical(other.soundMode, soundMode) || other.soundMode == soundMode));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(_alerts),volume,soundMode);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DeviceSettingsEntity(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts, volume: $volume, soundMode: $soundMode)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$DeviceSettingsEntityCopyWith<$Res> implements $DeviceSettingsEntityCopyWith<$Res> {
|
||||
factory _$DeviceSettingsEntityCopyWith(_DeviceSettingsEntity value, $Res Function(_DeviceSettingsEntity) _then) = __$DeviceSettingsEntityCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeEntity volume, String? soundMode
|
||||
});
|
||||
|
||||
|
||||
@override $DeviceVolumeEntityCopyWith<$Res> get volume;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$DeviceSettingsEntityCopyWithImpl<$Res>
|
||||
implements _$DeviceSettingsEntityCopyWith<$Res> {
|
||||
__$DeviceSettingsEntityCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _DeviceSettingsEntity _self;
|
||||
final $Res Function(_DeviceSettingsEntity) _then;
|
||||
|
||||
/// Create a copy of DeviceSettingsEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? frequency = null,Object? frequencyHeartRate = null,Object? timezone = null,Object? pedometer = null,Object? language = null,Object? alerts = null,Object? volume = null,Object? soundMode = freezed,}) {
|
||||
return _then(_DeviceSettingsEntity(
|
||||
frequency: null == frequency ? _self.frequency : frequency // ignore: cast_nullable_to_non_nullable
|
||||
as int,frequencyHeartRate: null == frequencyHeartRate ? _self.frequencyHeartRate : frequencyHeartRate // ignore: cast_nullable_to_non_nullable
|
||||
as int,timezone: null == timezone ? _self.timezone : timezone // ignore: cast_nullable_to_non_nullable
|
||||
as int,pedometer: null == pedometer ? _self.pedometer : pedometer // ignore: cast_nullable_to_non_nullable
|
||||
as bool,language: null == language ? _self.language : language // ignore: cast_nullable_to_non_nullable
|
||||
as String,alerts: null == alerts ? _self._alerts : alerts // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>,volume: null == volume ? _self.volume : volume // ignore: cast_nullable_to_non_nullable
|
||||
as DeviceVolumeEntity,soundMode: freezed == soundMode ? _self.soundMode : soundMode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of DeviceSettingsEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$DeviceVolumeEntityCopyWith<$Res> get volume {
|
||||
|
||||
return $DeviceVolumeEntityCopyWith<$Res>(_self.volume, (value) {
|
||||
return _then(_self.copyWith(volume: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
mixin _$DeviceVolumeEntity {
|
||||
|
||||
int get media; int get ringtone; int get alarm;
|
||||
/// Create a copy of DeviceVolumeEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$DeviceVolumeEntityCopyWith<DeviceVolumeEntity> get copyWith => _$DeviceVolumeEntityCopyWithImpl<DeviceVolumeEntity>(this as DeviceVolumeEntity, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceVolumeEntity&&(identical(other.media, media) || other.media == media)&&(identical(other.ringtone, ringtone) || other.ringtone == ringtone)&&(identical(other.alarm, alarm) || other.alarm == alarm));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,media,ringtone,alarm);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DeviceVolumeEntity(media: $media, ringtone: $ringtone, alarm: $alarm)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $DeviceVolumeEntityCopyWith<$Res> {
|
||||
factory $DeviceVolumeEntityCopyWith(DeviceVolumeEntity value, $Res Function(DeviceVolumeEntity) _then) = _$DeviceVolumeEntityCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
int media, int ringtone, int alarm
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$DeviceVolumeEntityCopyWithImpl<$Res>
|
||||
implements $DeviceVolumeEntityCopyWith<$Res> {
|
||||
_$DeviceVolumeEntityCopyWithImpl(this._self, this._then);
|
||||
|
||||
final DeviceVolumeEntity _self;
|
||||
final $Res Function(DeviceVolumeEntity) _then;
|
||||
|
||||
/// Create a copy of DeviceVolumeEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? media = null,Object? ringtone = null,Object? alarm = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
media: null == media ? _self.media : media // ignore: cast_nullable_to_non_nullable
|
||||
as int,ringtone: null == ringtone ? _self.ringtone : ringtone // ignore: cast_nullable_to_non_nullable
|
||||
as int,alarm: null == alarm ? _self.alarm : alarm // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [DeviceVolumeEntity].
|
||||
extension DeviceVolumeEntityPatterns on DeviceVolumeEntity {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _DeviceVolumeEntity value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceVolumeEntity() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _DeviceVolumeEntity value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceVolumeEntity():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _DeviceVolumeEntity value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceVolumeEntity() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int media, int ringtone, int alarm)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceVolumeEntity() when $default != null:
|
||||
return $default(_that.media,_that.ringtone,_that.alarm);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int media, int ringtone, int alarm) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceVolumeEntity():
|
||||
return $default(_that.media,_that.ringtone,_that.alarm);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int media, int ringtone, int alarm)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceVolumeEntity() when $default != null:
|
||||
return $default(_that.media,_that.ringtone,_that.alarm);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
|
||||
|
||||
class _DeviceVolumeEntity implements DeviceVolumeEntity {
|
||||
const _DeviceVolumeEntity({this.media = 50, this.ringtone = 50, this.alarm = 50});
|
||||
|
||||
|
||||
@override@JsonKey() final int media;
|
||||
@override@JsonKey() final int ringtone;
|
||||
@override@JsonKey() final int alarm;
|
||||
|
||||
/// Create a copy of DeviceVolumeEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$DeviceVolumeEntityCopyWith<_DeviceVolumeEntity> get copyWith => __$DeviceVolumeEntityCopyWithImpl<_DeviceVolumeEntity>(this, _$identity);
|
||||
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceVolumeEntity&&(identical(other.media, media) || other.media == media)&&(identical(other.ringtone, ringtone) || other.ringtone == ringtone)&&(identical(other.alarm, alarm) || other.alarm == alarm));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,media,ringtone,alarm);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DeviceVolumeEntity(media: $media, ringtone: $ringtone, alarm: $alarm)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$DeviceVolumeEntityCopyWith<$Res> implements $DeviceVolumeEntityCopyWith<$Res> {
|
||||
factory _$DeviceVolumeEntityCopyWith(_DeviceVolumeEntity value, $Res Function(_DeviceVolumeEntity) _then) = __$DeviceVolumeEntityCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
int media, int ringtone, int alarm
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$DeviceVolumeEntityCopyWithImpl<$Res>
|
||||
implements _$DeviceVolumeEntityCopyWith<$Res> {
|
||||
__$DeviceVolumeEntityCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _DeviceVolumeEntity _self;
|
||||
final $Res Function(_DeviceVolumeEntity) _then;
|
||||
|
||||
/// Create a copy of DeviceVolumeEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? media = null,Object? ringtone = null,Object? alarm = null,}) {
|
||||
return _then(_DeviceVolumeEntity(
|
||||
media: null == media ? _self.media : media // ignore: cast_nullable_to_non_nullable
|
||||
as int,ringtone: null == ringtone ? _self.ringtone : ringtone // ignore: cast_nullable_to_non_nullable
|
||||
as int,alarm: null == alarm ? _self.alarm : alarm // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
Reference in New Issue
Block a user