feat(settings): add falldown, falldownLevel and rename gps to location

This commit is contained in:
2026-04-21 17:58:03 +02:00
parent 12011ce525
commit a86041885c
9 changed files with 105 additions and 81 deletions

View File

@@ -66,8 +66,8 @@ class DisableFunctionsScreen extends ConsumerWidget {
_FunctionCard(
icon: Icons.gps_fixed,
label: context.translate(I18n.disableFunctionsGps),
value: state.gps,
onChanged: vm.toggleGps,
value: state.location,
onChanged: vm.toggleLocation,
primaryColor: primaryColor,
),
],

View File

@@ -31,7 +31,7 @@ class DisableFunctionsViewModel extends Notifier<DisableFunctionsViewState> {
state = state.copyWith(
keyboard: device.settings.keyboard,
gps: device.settings.gps,
location: device.settings.location,
isLoading: false,
);
}
@@ -40,8 +40,8 @@ class DisableFunctionsViewModel extends Notifier<DisableFunctionsViewState> {
state = state.copyWith(keyboard: value);
}
void toggleGps(bool value) {
state = state.copyWith(gps: value);
void toggleLocation(bool value) {
state = state.copyWith(location: value);
}
Future<void> save() async {
@@ -57,7 +57,7 @@ class DisableFunctionsViewModel extends Notifier<DisableFunctionsViewState> {
try {
final updatedSettings = device.settings.copyWith(
keyboard: state.keyboard,
gps: state.gps,
location: state.location,
);
await _datasource.updateDeviceSettings(
device: device,
@@ -70,7 +70,7 @@ class DisableFunctionsViewModel extends Notifier<DisableFunctionsViewState> {
unawaited(
_tracking.legacySettingsDisableFunctionsKeyboardToggled(state.keyboard),
);
unawaited(_tracking.legacySettingsDisableFunctionsGpsToggled(state.gps));
unawaited(_tracking.legacySettingsDisableFunctionsGpsToggled(state.location));
state = state.copyWith(isSaving: false, saveSuccess: true);
} catch (e) {

View File

@@ -8,7 +8,7 @@ enum DisableFunctionsErrorEvent { update }
abstract class DisableFunctionsViewState with _$DisableFunctionsViewState {
const factory DisableFunctionsViewState({
@Default(true) bool keyboard,
@Default(true) bool gps,
@Default(true) bool location,
@Default(true) bool isLoading,
@Default(false) bool isSaving,
DisableFunctionsErrorEvent? errorEvent,

View File

@@ -14,7 +14,7 @@ T _$identity<T>(T value) => value;
/// @nodoc
mixin _$DisableFunctionsViewState {
bool get keyboard; bool get gps; bool get isLoading; bool get isSaving; DisableFunctionsErrorEvent? get errorEvent; bool get saveSuccess;
bool get keyboard; bool get location; bool get isLoading; bool get isSaving; DisableFunctionsErrorEvent? get errorEvent; bool get saveSuccess;
/// Create a copy of DisableFunctionsViewState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -25,16 +25,16 @@ $DisableFunctionsViewStateCopyWith<DisableFunctionsViewState> get copyWith => _$
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is DisableFunctionsViewState&&(identical(other.keyboard, keyboard) || other.keyboard == keyboard)&&(identical(other.gps, gps) || other.gps == gps)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.isSaving, isSaving) || other.isSaving == isSaving)&&(identical(other.errorEvent, errorEvent) || other.errorEvent == errorEvent)&&(identical(other.saveSuccess, saveSuccess) || other.saveSuccess == saveSuccess));
return identical(this, other) || (other.runtimeType == runtimeType&&other is DisableFunctionsViewState&&(identical(other.keyboard, keyboard) || other.keyboard == keyboard)&&(identical(other.location, location) || other.location == location)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.isSaving, isSaving) || other.isSaving == isSaving)&&(identical(other.errorEvent, errorEvent) || other.errorEvent == errorEvent)&&(identical(other.saveSuccess, saveSuccess) || other.saveSuccess == saveSuccess));
}
@override
int get hashCode => Object.hash(runtimeType,keyboard,gps,isLoading,isSaving,errorEvent,saveSuccess);
int get hashCode => Object.hash(runtimeType,keyboard,location,isLoading,isSaving,errorEvent,saveSuccess);
@override
String toString() {
return 'DisableFunctionsViewState(keyboard: $keyboard, gps: $gps, isLoading: $isLoading, isSaving: $isSaving, errorEvent: $errorEvent, saveSuccess: $saveSuccess)';
return 'DisableFunctionsViewState(keyboard: $keyboard, location: $location, isLoading: $isLoading, isSaving: $isSaving, errorEvent: $errorEvent, saveSuccess: $saveSuccess)';
}
@@ -45,7 +45,7 @@ abstract mixin class $DisableFunctionsViewStateCopyWith<$Res> {
factory $DisableFunctionsViewStateCopyWith(DisableFunctionsViewState value, $Res Function(DisableFunctionsViewState) _then) = _$DisableFunctionsViewStateCopyWithImpl;
@useResult
$Res call({
bool keyboard, bool gps, bool isLoading, bool isSaving, DisableFunctionsErrorEvent? errorEvent, bool saveSuccess
bool keyboard, bool location, bool isLoading, bool isSaving, DisableFunctionsErrorEvent? errorEvent, bool saveSuccess
});
@@ -62,10 +62,10 @@ class _$DisableFunctionsViewStateCopyWithImpl<$Res>
/// Create a copy of DisableFunctionsViewState
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? keyboard = null,Object? gps = null,Object? isLoading = null,Object? isSaving = null,Object? errorEvent = freezed,Object? saveSuccess = null,}) {
@pragma('vm:prefer-inline') @override $Res call({Object? keyboard = null,Object? location = null,Object? isLoading = null,Object? isSaving = null,Object? errorEvent = freezed,Object? saveSuccess = null,}) {
return _then(_self.copyWith(
keyboard: null == keyboard ? _self.keyboard : keyboard // ignore: cast_nullable_to_non_nullable
as bool,gps: null == gps ? _self.gps : gps // ignore: cast_nullable_to_non_nullable
as bool,location: null == location ? _self.location : location // ignore: cast_nullable_to_non_nullable
as bool,isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
as bool,isSaving: null == isSaving ? _self.isSaving : isSaving // ignore: cast_nullable_to_non_nullable
as bool,errorEvent: freezed == errorEvent ? _self.errorEvent : errorEvent // ignore: cast_nullable_to_non_nullable
@@ -155,10 +155,10 @@ return $default(_that);case _:
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool keyboard, bool gps, bool isLoading, bool isSaving, DisableFunctionsErrorEvent? errorEvent, bool saveSuccess)? $default,{required TResult orElse(),}) {final _that = this;
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool keyboard, bool location, bool isLoading, bool isSaving, DisableFunctionsErrorEvent? errorEvent, bool saveSuccess)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _DisableFunctionsViewState() when $default != null:
return $default(_that.keyboard,_that.gps,_that.isLoading,_that.isSaving,_that.errorEvent,_that.saveSuccess);case _:
return $default(_that.keyboard,_that.location,_that.isLoading,_that.isSaving,_that.errorEvent,_that.saveSuccess);case _:
return orElse();
}
@@ -176,10 +176,10 @@ return $default(_that.keyboard,_that.gps,_that.isLoading,_that.isSaving,_that.er
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool keyboard, bool gps, bool isLoading, bool isSaving, DisableFunctionsErrorEvent? errorEvent, bool saveSuccess) $default,) {final _that = this;
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool keyboard, bool location, bool isLoading, bool isSaving, DisableFunctionsErrorEvent? errorEvent, bool saveSuccess) $default,) {final _that = this;
switch (_that) {
case _DisableFunctionsViewState():
return $default(_that.keyboard,_that.gps,_that.isLoading,_that.isSaving,_that.errorEvent,_that.saveSuccess);case _:
return $default(_that.keyboard,_that.location,_that.isLoading,_that.isSaving,_that.errorEvent,_that.saveSuccess);case _:
throw StateError('Unexpected subclass');
}
@@ -196,10 +196,10 @@ return $default(_that.keyboard,_that.gps,_that.isLoading,_that.isSaving,_that.er
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool keyboard, bool gps, bool isLoading, bool isSaving, DisableFunctionsErrorEvent? errorEvent, bool saveSuccess)? $default,) {final _that = this;
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool keyboard, bool location, bool isLoading, bool isSaving, DisableFunctionsErrorEvent? errorEvent, bool saveSuccess)? $default,) {final _that = this;
switch (_that) {
case _DisableFunctionsViewState() when $default != null:
return $default(_that.keyboard,_that.gps,_that.isLoading,_that.isSaving,_that.errorEvent,_that.saveSuccess);case _:
return $default(_that.keyboard,_that.location,_that.isLoading,_that.isSaving,_that.errorEvent,_that.saveSuccess);case _:
return null;
}
@@ -211,11 +211,11 @@ return $default(_that.keyboard,_that.gps,_that.isLoading,_that.isSaving,_that.er
class _DisableFunctionsViewState implements DisableFunctionsViewState {
const _DisableFunctionsViewState({this.keyboard = true, this.gps = true, this.isLoading = true, this.isSaving = false, this.errorEvent, this.saveSuccess = false});
const _DisableFunctionsViewState({this.keyboard = true, this.location = true, this.isLoading = true, this.isSaving = false, this.errorEvent, this.saveSuccess = false});
@override@JsonKey() final bool keyboard;
@override@JsonKey() final bool gps;
@override@JsonKey() final bool location;
@override@JsonKey() final bool isLoading;
@override@JsonKey() final bool isSaving;
@override final DisableFunctionsErrorEvent? errorEvent;
@@ -231,16 +231,16 @@ _$DisableFunctionsViewStateCopyWith<_DisableFunctionsViewState> get copyWith =>
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _DisableFunctionsViewState&&(identical(other.keyboard, keyboard) || other.keyboard == keyboard)&&(identical(other.gps, gps) || other.gps == gps)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.isSaving, isSaving) || other.isSaving == isSaving)&&(identical(other.errorEvent, errorEvent) || other.errorEvent == errorEvent)&&(identical(other.saveSuccess, saveSuccess) || other.saveSuccess == saveSuccess));
return identical(this, other) || (other.runtimeType == runtimeType&&other is _DisableFunctionsViewState&&(identical(other.keyboard, keyboard) || other.keyboard == keyboard)&&(identical(other.location, location) || other.location == location)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.isSaving, isSaving) || other.isSaving == isSaving)&&(identical(other.errorEvent, errorEvent) || other.errorEvent == errorEvent)&&(identical(other.saveSuccess, saveSuccess) || other.saveSuccess == saveSuccess));
}
@override
int get hashCode => Object.hash(runtimeType,keyboard,gps,isLoading,isSaving,errorEvent,saveSuccess);
int get hashCode => Object.hash(runtimeType,keyboard,location,isLoading,isSaving,errorEvent,saveSuccess);
@override
String toString() {
return 'DisableFunctionsViewState(keyboard: $keyboard, gps: $gps, isLoading: $isLoading, isSaving: $isSaving, errorEvent: $errorEvent, saveSuccess: $saveSuccess)';
return 'DisableFunctionsViewState(keyboard: $keyboard, location: $location, isLoading: $isLoading, isSaving: $isSaving, errorEvent: $errorEvent, saveSuccess: $saveSuccess)';
}
@@ -251,7 +251,7 @@ abstract mixin class _$DisableFunctionsViewStateCopyWith<$Res> implements $Disab
factory _$DisableFunctionsViewStateCopyWith(_DisableFunctionsViewState value, $Res Function(_DisableFunctionsViewState) _then) = __$DisableFunctionsViewStateCopyWithImpl;
@override @useResult
$Res call({
bool keyboard, bool gps, bool isLoading, bool isSaving, DisableFunctionsErrorEvent? errorEvent, bool saveSuccess
bool keyboard, bool location, bool isLoading, bool isSaving, DisableFunctionsErrorEvent? errorEvent, bool saveSuccess
});
@@ -268,10 +268,10 @@ class __$DisableFunctionsViewStateCopyWithImpl<$Res>
/// Create a copy of DisableFunctionsViewState
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? keyboard = null,Object? gps = null,Object? isLoading = null,Object? isSaving = null,Object? errorEvent = freezed,Object? saveSuccess = null,}) {
@override @pragma('vm:prefer-inline') $Res call({Object? keyboard = null,Object? location = null,Object? isLoading = null,Object? isSaving = null,Object? errorEvent = freezed,Object? saveSuccess = null,}) {
return _then(_DisableFunctionsViewState(
keyboard: null == keyboard ? _self.keyboard : keyboard // ignore: cast_nullable_to_non_nullable
as bool,gps: null == gps ? _self.gps : gps // ignore: cast_nullable_to_non_nullable
as bool,location: null == location ? _self.location : location // ignore: cast_nullable_to_non_nullable
as bool,isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
as bool,isSaving: null == isSaving ? _self.isSaving : isSaving // ignore: cast_nullable_to_non_nullable
as bool,errorEvent: freezed == errorEvent ? _self.errorEvent : errorEvent // ignore: cast_nullable_to_non_nullable

View File

@@ -16,8 +16,10 @@ abstract class DeviceSettingsModel with _$DeviceSettingsModel {
@Default(DeviceVolumeModel()) DeviceVolumeModel volume,
String? soundMode,
@Default(true) bool keyboard,
@Default(true) bool gps,
@Default(true) bool location,
@Default(false) bool nightMode,
@Default(false) bool falldown,
@Default(0) int falldownLevel,
}) = _DeviceSettingsModel;
factory DeviceSettingsModel.fromJson(Map<String, dynamic> json) =>
@@ -51,8 +53,10 @@ extension DeviceSettingsModelMapper on DeviceSettingsModel {
),
soundMode: soundMode,
keyboard: keyboard,
gps: gps,
location: location,
nightMode: nightMode,
falldown: falldown,
falldownLevel: falldownLevel,
);
}
@@ -71,7 +75,9 @@ extension DeviceSettingsEntityMapper on DeviceSettingsEntity {
},
'soundMode': soundMode ?? 'VIBRATION',
'keyboard': keyboard,
'gps': gps,
'location': location,
'nightMode': nightMode,
'falldown': falldown,
'falldownLevel': falldownLevel,
};
}

View File

@@ -15,7 +15,7 @@ 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; bool get keyboard; bool get gps; bool get nightMode;
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; bool get keyboard; bool get location; bool get nightMode; bool get falldown; int get falldownLevel;
/// Create a copy of DeviceSettingsModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -28,16 +28,16 @@ $DeviceSettingsModelCopyWith<DeviceSettingsModel> get copyWith => _$DeviceSettin
@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)&&(identical(other.keyboard, keyboard) || other.keyboard == keyboard)&&(identical(other.gps, gps) || other.gps == gps)&&(identical(other.nightMode, nightMode) || other.nightMode == nightMode));
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)&&(identical(other.keyboard, keyboard) || other.keyboard == keyboard)&&(identical(other.location, location) || other.location == location)&&(identical(other.nightMode, nightMode) || other.nightMode == nightMode)&&(identical(other.falldown, falldown) || other.falldown == falldown)&&(identical(other.falldownLevel, falldownLevel) || other.falldownLevel == falldownLevel));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(alerts),volume,soundMode,keyboard,gps,nightMode);
int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(alerts),volume,soundMode,keyboard,location,nightMode,falldown,falldownLevel);
@override
String toString() {
return 'DeviceSettingsModel(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts, volume: $volume, soundMode: $soundMode, keyboard: $keyboard, gps: $gps, nightMode: $nightMode)';
return 'DeviceSettingsModel(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts, volume: $volume, soundMode: $soundMode, keyboard: $keyboard, location: $location, nightMode: $nightMode, falldown: $falldown, falldownLevel: $falldownLevel)';
}
@@ -48,7 +48,7 @@ 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, bool keyboard, bool gps, bool nightMode
int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeModel volume, String? soundMode, bool keyboard, bool location, bool nightMode, bool falldown, int falldownLevel
});
@@ -65,7 +65,7 @@ class _$DeviceSettingsModelCopyWithImpl<$Res>
/// 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,Object? keyboard = null,Object? gps = null,Object? nightMode = null,}) {
@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,Object? keyboard = null,Object? location = null,Object? nightMode = null,Object? falldown = null,Object? falldownLevel = null,}) {
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
@@ -76,9 +76,11 @@ as String,alerts: null == alerts ? _self.alerts : alerts // ignore: cast_nullabl
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?,keyboard: null == keyboard ? _self.keyboard : keyboard // ignore: cast_nullable_to_non_nullable
as bool,gps: null == gps ? _self.gps : gps // ignore: cast_nullable_to_non_nullable
as bool,location: null == location ? _self.location : location // ignore: cast_nullable_to_non_nullable
as bool,nightMode: null == nightMode ? _self.nightMode : nightMode // ignore: cast_nullable_to_non_nullable
as bool,
as bool,falldown: null == falldown ? _self.falldown : falldown // ignore: cast_nullable_to_non_nullable
as bool,falldownLevel: null == falldownLevel ? _self.falldownLevel : falldownLevel // ignore: cast_nullable_to_non_nullable
as int,
));
}
/// Create a copy of DeviceSettingsModel
@@ -172,10 +174,10 @@ return $default(_that);case _:
/// }
/// ```
@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, bool keyboard, bool gps, bool nightMode)? $default,{required TResult orElse(),}) {final _that = this;
@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, bool keyboard, bool location, bool nightMode, bool falldown, int falldownLevel)? $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,_that.keyboard,_that.gps,_that.nightMode);case _:
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode,_that.keyboard,_that.location,_that.nightMode,_that.falldown,_that.falldownLevel);case _:
return orElse();
}
@@ -193,10 +195,10 @@ return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pe
/// }
/// ```
@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, bool keyboard, bool gps, bool nightMode) $default,) {final _that = this;
@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, bool keyboard, bool location, bool nightMode, bool falldown, int falldownLevel) $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,_that.keyboard,_that.gps,_that.nightMode);case _:
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode,_that.keyboard,_that.location,_that.nightMode,_that.falldown,_that.falldownLevel);case _:
throw StateError('Unexpected subclass');
}
@@ -213,10 +215,10 @@ return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pe
/// }
/// ```
@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, bool keyboard, bool gps, bool nightMode)? $default,) {final _that = this;
@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, bool keyboard, bool location, bool nightMode, bool falldown, int falldownLevel)? $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,_that.keyboard,_that.gps,_that.nightMode);case _:
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode,_that.keyboard,_that.location,_that.nightMode,_that.falldown,_that.falldownLevel);case _:
return null;
}
@@ -228,7 +230,7 @@ return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pe
@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, this.keyboard = true, this.gps = true, this.nightMode = false}): _alerts = alerts;
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, this.keyboard = true, this.location = true, this.nightMode = false, this.falldown = false, this.falldownLevel = 0}): _alerts = alerts;
factory _DeviceSettingsModel.fromJson(Map<String, dynamic> json) => _$DeviceSettingsModelFromJson(json);
@override@JsonKey() final int frequency;
@@ -246,8 +248,10 @@ class _DeviceSettingsModel implements DeviceSettingsModel {
@override@JsonKey() final DeviceVolumeModel volume;
@override final String? soundMode;
@override@JsonKey() final bool keyboard;
@override@JsonKey() final bool gps;
@override@JsonKey() final bool location;
@override@JsonKey() final bool nightMode;
@override@JsonKey() final bool falldown;
@override@JsonKey() final int falldownLevel;
/// Create a copy of DeviceSettingsModel
/// with the given fields replaced by the non-null parameter values.
@@ -262,16 +266,16 @@ 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)&&(identical(other.keyboard, keyboard) || other.keyboard == keyboard)&&(identical(other.gps, gps) || other.gps == gps)&&(identical(other.nightMode, nightMode) || other.nightMode == nightMode));
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)&&(identical(other.keyboard, keyboard) || other.keyboard == keyboard)&&(identical(other.location, location) || other.location == location)&&(identical(other.nightMode, nightMode) || other.nightMode == nightMode)&&(identical(other.falldown, falldown) || other.falldown == falldown)&&(identical(other.falldownLevel, falldownLevel) || other.falldownLevel == falldownLevel));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(_alerts),volume,soundMode,keyboard,gps,nightMode);
int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(_alerts),volume,soundMode,keyboard,location,nightMode,falldown,falldownLevel);
@override
String toString() {
return 'DeviceSettingsModel(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts, volume: $volume, soundMode: $soundMode, keyboard: $keyboard, gps: $gps, nightMode: $nightMode)';
return 'DeviceSettingsModel(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts, volume: $volume, soundMode: $soundMode, keyboard: $keyboard, location: $location, nightMode: $nightMode, falldown: $falldown, falldownLevel: $falldownLevel)';
}
@@ -282,7 +286,7 @@ abstract mixin class _$DeviceSettingsModelCopyWith<$Res> implements $DeviceSetti
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, bool keyboard, bool gps, bool nightMode
int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeModel volume, String? soundMode, bool keyboard, bool location, bool nightMode, bool falldown, int falldownLevel
});
@@ -299,7 +303,7 @@ class __$DeviceSettingsModelCopyWithImpl<$Res>
/// 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,Object? keyboard = null,Object? gps = null,Object? nightMode = null,}) {
@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,Object? keyboard = null,Object? location = null,Object? nightMode = null,Object? falldown = null,Object? falldownLevel = null,}) {
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
@@ -310,9 +314,11 @@ as String,alerts: null == alerts ? _self._alerts : alerts // ignore: cast_nullab
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?,keyboard: null == keyboard ? _self.keyboard : keyboard // ignore: cast_nullable_to_non_nullable
as bool,gps: null == gps ? _self.gps : gps // ignore: cast_nullable_to_non_nullable
as bool,location: null == location ? _self.location : location // ignore: cast_nullable_to_non_nullable
as bool,nightMode: null == nightMode ? _self.nightMode : nightMode // ignore: cast_nullable_to_non_nullable
as bool,
as bool,falldown: null == falldown ? _self.falldown : falldown // ignore: cast_nullable_to_non_nullable
as bool,falldownLevel: null == falldownLevel ? _self.falldownLevel : falldownLevel // ignore: cast_nullable_to_non_nullable
as int,
));
}

View File

@@ -23,8 +23,10 @@ _DeviceSettingsModel _$DeviceSettingsModelFromJson(Map<String, dynamic> json) =>
: DeviceVolumeModel.fromJson(json['volume'] as Map<String, dynamic>),
soundMode: json['soundMode'] as String?,
keyboard: json['keyboard'] as bool? ?? true,
gps: json['gps'] as bool? ?? true,
location: json['location'] as bool? ?? true,
nightMode: json['nightMode'] as bool? ?? false,
falldown: json['falldown'] as bool? ?? false,
falldownLevel: (json['falldownLevel'] as num?)?.toInt() ?? 0,
);
Map<String, dynamic> _$DeviceSettingsModelToJson(
@@ -39,8 +41,10 @@ Map<String, dynamic> _$DeviceSettingsModelToJson(
'volume': instance.volume,
'soundMode': instance.soundMode,
'keyboard': instance.keyboard,
'gps': instance.gps,
'location': instance.location,
'nightMode': instance.nightMode,
'falldown': instance.falldown,
'falldownLevel': instance.falldownLevel,
};
_DeviceVolumeModel _$DeviceVolumeModelFromJson(Map<String, dynamic> json) =>

View File

@@ -14,8 +14,10 @@ abstract class DeviceSettingsEntity with _$DeviceSettingsEntity {
@Default(DeviceVolumeEntity()) DeviceVolumeEntity volume,
String? soundMode,
@Default(true) bool keyboard,
@Default(true) bool gps,
@Default(true) bool location,
@Default(false) bool nightMode,
@Default(false) bool falldown,
@Default(0) int falldownLevel,
}) = _DeviceSettingsEntity;
}

View File

@@ -14,7 +14,7 @@ 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; bool get keyboard; bool get gps; bool get nightMode;
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; bool get keyboard; bool get location; bool get nightMode; bool get falldown; int get falldownLevel;
/// Create a copy of DeviceSettingsEntity
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -25,16 +25,16 @@ $DeviceSettingsEntityCopyWith<DeviceSettingsEntity> get copyWith => _$DeviceSett
@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)&&(identical(other.keyboard, keyboard) || other.keyboard == keyboard)&&(identical(other.gps, gps) || other.gps == gps)&&(identical(other.nightMode, nightMode) || other.nightMode == nightMode));
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)&&(identical(other.keyboard, keyboard) || other.keyboard == keyboard)&&(identical(other.location, location) || other.location == location)&&(identical(other.nightMode, nightMode) || other.nightMode == nightMode)&&(identical(other.falldown, falldown) || other.falldown == falldown)&&(identical(other.falldownLevel, falldownLevel) || other.falldownLevel == falldownLevel));
}
@override
int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(alerts),volume,soundMode,keyboard,gps,nightMode);
int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(alerts),volume,soundMode,keyboard,location,nightMode,falldown,falldownLevel);
@override
String toString() {
return 'DeviceSettingsEntity(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts, volume: $volume, soundMode: $soundMode, keyboard: $keyboard, gps: $gps, nightMode: $nightMode)';
return 'DeviceSettingsEntity(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts, volume: $volume, soundMode: $soundMode, keyboard: $keyboard, location: $location, nightMode: $nightMode, falldown: $falldown, falldownLevel: $falldownLevel)';
}
@@ -45,7 +45,7 @@ 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, bool keyboard, bool gps, bool nightMode
int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeEntity volume, String? soundMode, bool keyboard, bool location, bool nightMode, bool falldown, int falldownLevel
});
@@ -62,7 +62,7 @@ class _$DeviceSettingsEntityCopyWithImpl<$Res>
/// 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,Object? keyboard = null,Object? gps = null,Object? nightMode = null,}) {
@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,Object? keyboard = null,Object? location = null,Object? nightMode = null,Object? falldown = null,Object? falldownLevel = null,}) {
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
@@ -73,9 +73,11 @@ as String,alerts: null == alerts ? _self.alerts : alerts // ignore: cast_nullabl
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?,keyboard: null == keyboard ? _self.keyboard : keyboard // ignore: cast_nullable_to_non_nullable
as bool,gps: null == gps ? _self.gps : gps // ignore: cast_nullable_to_non_nullable
as bool,location: null == location ? _self.location : location // ignore: cast_nullable_to_non_nullable
as bool,nightMode: null == nightMode ? _self.nightMode : nightMode // ignore: cast_nullable_to_non_nullable
as bool,
as bool,falldown: null == falldown ? _self.falldown : falldown // ignore: cast_nullable_to_non_nullable
as bool,falldownLevel: null == falldownLevel ? _self.falldownLevel : falldownLevel // ignore: cast_nullable_to_non_nullable
as int,
));
}
/// Create a copy of DeviceSettingsEntity
@@ -169,10 +171,10 @@ return $default(_that);case _:
/// }
/// ```
@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, bool keyboard, bool gps, bool nightMode)? $default,{required TResult orElse(),}) {final _that = this;
@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, bool keyboard, bool location, bool nightMode, bool falldown, int falldownLevel)? $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,_that.keyboard,_that.gps,_that.nightMode);case _:
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode,_that.keyboard,_that.location,_that.nightMode,_that.falldown,_that.falldownLevel);case _:
return orElse();
}
@@ -190,10 +192,10 @@ return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pe
/// }
/// ```
@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, bool keyboard, bool gps, bool nightMode) $default,) {final _that = this;
@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, bool keyboard, bool location, bool nightMode, bool falldown, int falldownLevel) $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,_that.keyboard,_that.gps,_that.nightMode);case _:
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode,_that.keyboard,_that.location,_that.nightMode,_that.falldown,_that.falldownLevel);case _:
throw StateError('Unexpected subclass');
}
@@ -210,10 +212,10 @@ return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pe
/// }
/// ```
@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, bool keyboard, bool gps, bool nightMode)? $default,) {final _that = this;
@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, bool keyboard, bool location, bool nightMode, bool falldown, int falldownLevel)? $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,_that.keyboard,_that.gps,_that.nightMode);case _:
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode,_that.keyboard,_that.location,_that.nightMode,_that.falldown,_that.falldownLevel);case _:
return null;
}
@@ -225,7 +227,7 @@ return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pe
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, this.keyboard = true, this.gps = true, this.nightMode = false}): _alerts = alerts;
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, this.keyboard = true, this.location = true, this.nightMode = false, this.falldown = false, this.falldownLevel = 0}): _alerts = alerts;
@override@JsonKey() final int frequency;
@@ -243,8 +245,10 @@ class _DeviceSettingsEntity implements DeviceSettingsEntity {
@override@JsonKey() final DeviceVolumeEntity volume;
@override final String? soundMode;
@override@JsonKey() final bool keyboard;
@override@JsonKey() final bool gps;
@override@JsonKey() final bool location;
@override@JsonKey() final bool nightMode;
@override@JsonKey() final bool falldown;
@override@JsonKey() final int falldownLevel;
/// Create a copy of DeviceSettingsEntity
/// with the given fields replaced by the non-null parameter values.
@@ -256,16 +260,16 @@ _$DeviceSettingsEntityCopyWith<_DeviceSettingsEntity> get copyWith => __$DeviceS
@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)&&(identical(other.keyboard, keyboard) || other.keyboard == keyboard)&&(identical(other.gps, gps) || other.gps == gps)&&(identical(other.nightMode, nightMode) || other.nightMode == nightMode));
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)&&(identical(other.keyboard, keyboard) || other.keyboard == keyboard)&&(identical(other.location, location) || other.location == location)&&(identical(other.nightMode, nightMode) || other.nightMode == nightMode)&&(identical(other.falldown, falldown) || other.falldown == falldown)&&(identical(other.falldownLevel, falldownLevel) || other.falldownLevel == falldownLevel));
}
@override
int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(_alerts),volume,soundMode,keyboard,gps,nightMode);
int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(_alerts),volume,soundMode,keyboard,location,nightMode,falldown,falldownLevel);
@override
String toString() {
return 'DeviceSettingsEntity(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts, volume: $volume, soundMode: $soundMode, keyboard: $keyboard, gps: $gps, nightMode: $nightMode)';
return 'DeviceSettingsEntity(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts, volume: $volume, soundMode: $soundMode, keyboard: $keyboard, location: $location, nightMode: $nightMode, falldown: $falldown, falldownLevel: $falldownLevel)';
}
@@ -276,7 +280,7 @@ abstract mixin class _$DeviceSettingsEntityCopyWith<$Res> implements $DeviceSett
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, bool keyboard, bool gps, bool nightMode
int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeEntity volume, String? soundMode, bool keyboard, bool location, bool nightMode, bool falldown, int falldownLevel
});
@@ -293,7 +297,7 @@ class __$DeviceSettingsEntityCopyWithImpl<$Res>
/// 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,Object? keyboard = null,Object? gps = null,Object? nightMode = null,}) {
@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,Object? keyboard = null,Object? location = null,Object? nightMode = null,Object? falldown = null,Object? falldownLevel = null,}) {
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
@@ -304,9 +308,11 @@ as String,alerts: null == alerts ? _self._alerts : alerts // ignore: cast_nullab
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?,keyboard: null == keyboard ? _self.keyboard : keyboard // ignore: cast_nullable_to_non_nullable
as bool,gps: null == gps ? _self.gps : gps // ignore: cast_nullable_to_non_nullable
as bool,location: null == location ? _self.location : location // ignore: cast_nullable_to_non_nullable
as bool,nightMode: null == nightMode ? _self.nightMode : nightMode // ignore: cast_nullable_to_non_nullable
as bool,
as bool,falldown: null == falldown ? _self.falldown : falldown // ignore: cast_nullable_to_non_nullable
as bool,falldownLevel: null == falldownLevel ? _self.falldownLevel : falldownLevel // ignore: cast_nullable_to_non_nullable
as int,
));
}