diff --git a/modules/legacy/modules/account/lib/src/core/data/datasource/account_remote_datasource.dart b/modules/legacy/modules/account/lib/src/core/data/datasource/account_remote_datasource.dart index 17ed7634..de5f7338 100644 --- a/modules/legacy/modules/account/lib/src/core/data/datasource/account_remote_datasource.dart +++ b/modules/legacy/modules/account/lib/src/core/data/datasource/account_remote_datasource.dart @@ -1,4 +1,4 @@ -import 'package:account/src/features/linked_devices/domain/entities/device_entity.dart'; +import 'package:legacy_shared/src/data/models/entities/device_entity.dart'; import 'package:account/src/features/linked_devices/domain/entities/update_device_request_entity.dart'; import 'package:account/src/features/personal_data/domain/entities/update_user_request_entity.dart'; import 'package:legacy_shared/legacy_shared.dart'; diff --git a/modules/legacy/modules/account/lib/src/core/data/datasource/account_remote_datasource_impl.dart b/modules/legacy/modules/account/lib/src/core/data/datasource/account_remote_datasource_impl.dart index 18596472..8b953385 100644 --- a/modules/legacy/modules/account/lib/src/core/data/datasource/account_remote_datasource_impl.dart +++ b/modules/legacy/modules/account/lib/src/core/data/datasource/account_remote_datasource_impl.dart @@ -5,7 +5,7 @@ import 'package:account/src/core/data/models/get_app_users_response_model.dart'; import 'package:account/src/core/data/models/get_linked_devices_response_model.dart'; import 'package:account/src/core/data/models/update_device_request_model.dart'; import 'package:account/src/core/data/models/update_user_request_model.dart'; -import 'package:account/src/features/linked_devices/domain/entities/device_entity.dart'; +import 'package:legacy_shared/src/data/models/entities/device_entity.dart'; import 'package:account/src/features/linked_devices/domain/entities/update_device_request_entity.dart'; import 'package:account/src/features/personal_data/domain/entities/update_user_request_entity.dart'; import 'package:legacy_shared/legacy_shared.dart'; @@ -21,7 +21,7 @@ class AccountRemoteDatasourceImpl implements AccountRemoteDatasource { @override Future> getLinkedDevices({required String userId}) async { try { - final response = await _repository.get>( + /*final response = await _repository.get>( '/$userId/devices', ); final data = response.data!['items']; @@ -29,17 +29,57 @@ class AccountRemoteDatasourceImpl implements AccountRemoteDatasource { throw Exception('Empty response from /:userId/devices'); } - final model = GetLinkedDevicesResponseModel.fromJson(data); - /*final model = GetLinkedDevicesResponseModel(items: [ + final model = GetLinkedDevicesResponseModel.fromJson(data);*/ + final model = GetLinkedDevicesResponseModel(items: [ GetLinkedDevicesItemResponseModel( identificator: '1111', - name: 'Carlos', - number: '111111111'), + carrierName: 'Carlos', + phone: '111111111', + id: '', + settings: GetLinkedDevicesSettingsResponseModel( + frequency: 0, + frequencyHeartRate: 0, + timezone: 0, + pedometer: false, + language: 'language', + alerts: [], + ), + protocol: '', + type: '', + connectionServer: '', + createdAt: 0, + flags: GetLinkedDevicesFlagsResponseModel( + isInOrOut: 'isInOrOut', + geofenceId: 'geofenceId', + isBatteryLow: false, + isDisconnect: false, + ) + ), GetLinkedDevicesItemResponseModel( identificator: '1112', - name: 'Ana', - number: '222222222'), - ]);*/ + carrierName: 'Ana', + phone: '222222222', + id: '', + settings: GetLinkedDevicesSettingsResponseModel( + frequency: 0, + frequencyHeartRate: 0, + timezone: 0, + pedometer: false, + language: 'language', + alerts: [], + ), + protocol: '', + type: '', + connectionServer: '', + createdAt: 0, + flags: GetLinkedDevicesFlagsResponseModel( + isInOrOut: 'isInOrOut', + geofenceId: 'geofenceId', + isBatteryLow: false, + isDisconnect: false, + ) + ), + ]); return model.toEntity(); } on DioException catch (error) { throw _mapDioError( diff --git a/modules/legacy/modules/account/lib/src/core/data/models/get_linked_devices_response_model.dart b/modules/legacy/modules/account/lib/src/core/data/models/get_linked_devices_response_model.dart index e844559d..b311ae23 100644 --- a/modules/legacy/modules/account/lib/src/core/data/models/get_linked_devices_response_model.dart +++ b/modules/legacy/modules/account/lib/src/core/data/models/get_linked_devices_response_model.dart @@ -1,4 +1,4 @@ -import 'package:account/src/features/linked_devices/domain/entities/device_entity.dart'; +import 'package:legacy_shared/src/data/models/entities/device_entity.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; part 'get_linked_devices_response_model.freezed.dart'; @@ -18,8 +18,15 @@ abstract class GetLinkedDevicesResponseModel with _$GetLinkedDevicesResponseMode abstract class GetLinkedDevicesItemResponseModel with _$GetLinkedDevicesItemResponseModel { const factory GetLinkedDevicesItemResponseModel({ required String identificator, - required String name, - required String number, + required String carrierName, + required String phone, + required String id, + required GetLinkedDevicesSettingsResponseModel settings, + required String protocol, + required String type, + required String connectionServer, + required int createdAt, + required GetLinkedDevicesFlagsResponseModel flags, }) = _GetLinkedDevicesItemResponseModel; @@ -30,9 +37,68 @@ abstract class GetLinkedDevicesItemResponseModel with _$GetLinkedDevicesItemResp extension GetDevicesResponseModelMapper on GetLinkedDevicesResponseModel { List toEntity() { return items.map((GetLinkedDevicesItemResponseModel item) => DeviceEntity( - identificator: item.identificator, - name: item.name, - number: item.number + identificator: item.identificator, + carrierName: item.carrierName, + phone: item.phone, + id: item.id, + settings: item.settings.toEntity(), + protocol: item.protocol, + type: item.type, + connectionServer: item.connectionServer, + createdAt: item.createdAt, + flags: item.flags.toEntity(), )).toList(); } +} + +@freezed +abstract class GetLinkedDevicesSettingsResponseModel with _$GetLinkedDevicesSettingsResponseModel { + const factory GetLinkedDevicesSettingsResponseModel({ + required int frequency, + required int frequencyHeartRate, + required int timezone, + required bool pedometer, + required String language, + required List alerts, + }) = _GetLinkedDevicesSettingsResponseModel; + + factory GetLinkedDevicesSettingsResponseModel.fromJson(Map json) => + _$GetLinkedDevicesSettingsResponseModelFromJson(json); +} + +extension GetLinkedDevicesSettingsResponseModelMapper on GetLinkedDevicesSettingsResponseModel { + DeviceSettingsEntity toEntity() { + return DeviceSettingsEntity( + frequency: frequency, + frequencyHeartRate: frequencyHeartRate, + timezone: timezone, + pedometer: pedometer, + language: language, + alerts: alerts, + ); + } +} + +@freezed +abstract class GetLinkedDevicesFlagsResponseModel with _$GetLinkedDevicesFlagsResponseModel { + const factory GetLinkedDevicesFlagsResponseModel({ + required String isInOrOut, + required String geofenceId, + required bool isBatteryLow, + required bool isDisconnect, + }) = _GetLinkedDevicesFlagsResponseModel; + + factory GetLinkedDevicesFlagsResponseModel.fromJson(Map json) => + _$GetLinkedDevicesFlagsResponseModelFromJson(json); +} + +extension GetLinkedDevicesFlagsResponseModelMapper on GetLinkedDevicesFlagsResponseModel { + DeviceFlagsEntity toEntity() { + return DeviceFlagsEntity( + isInOrOut: isInOrOut, + geofenceId: geofenceId, + isBatteryLow: isBatteryLow, + isDisconnect: isDisconnect, + ); + } } \ No newline at end of file diff --git a/modules/legacy/modules/account/lib/src/core/data/models/get_linked_devices_response_model.freezed.dart b/modules/legacy/modules/account/lib/src/core/data/models/get_linked_devices_response_model.freezed.dart index ed127626..46fd8f5d 100644 --- a/modules/legacy/modules/account/lib/src/core/data/models/get_linked_devices_response_model.freezed.dart +++ b/modules/legacy/modules/account/lib/src/core/data/models/get_linked_devices_response_model.freezed.dart @@ -284,7 +284,7 @@ as List, /// @nodoc mixin _$GetLinkedDevicesItemResponseModel { - String get identificator; String get name; String get number; + String get identificator; String get carrierName; String get phone; String get id; GetLinkedDevicesSettingsResponseModel get settings; String get protocol; String get type; String get connectionServer; int get createdAt; GetLinkedDevicesFlagsResponseModel get flags; /// Create a copy of GetLinkedDevicesItemResponseModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -297,16 +297,16 @@ $GetLinkedDevicesItemResponseModelCopyWith ge @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is GetLinkedDevicesItemResponseModel&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.name, name) || other.name == name)&&(identical(other.number, number) || other.number == number)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is GetLinkedDevicesItemResponseModel&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.id, id) || other.id == id)&&(identical(other.settings, settings) || other.settings == settings)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.type, type) || other.type == type)&&(identical(other.connectionServer, connectionServer) || other.connectionServer == connectionServer)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.flags, flags) || other.flags == flags)); } @JsonKey(includeFromJson: false, includeToJson: false) @override -int get hashCode => Object.hash(runtimeType,identificator,name,number); +int get hashCode => Object.hash(runtimeType,identificator,carrierName,phone,id,settings,protocol,type,connectionServer,createdAt,flags); @override String toString() { - return 'GetLinkedDevicesItemResponseModel(identificator: $identificator, name: $name, number: $number)'; + return 'GetLinkedDevicesItemResponseModel(identificator: $identificator, carrierName: $carrierName, phone: $phone, id: $id, settings: $settings, protocol: $protocol, type: $type, connectionServer: $connectionServer, createdAt: $createdAt, flags: $flags)'; } @@ -317,11 +317,11 @@ abstract mixin class $GetLinkedDevicesItemResponseModelCopyWith<$Res> { factory $GetLinkedDevicesItemResponseModelCopyWith(GetLinkedDevicesItemResponseModel value, $Res Function(GetLinkedDevicesItemResponseModel) _then) = _$GetLinkedDevicesItemResponseModelCopyWithImpl; @useResult $Res call({ - String identificator, String name, String number + String identificator, String carrierName, String phone, String id, GetLinkedDevicesSettingsResponseModel settings, String protocol, String type, String connectionServer, int createdAt, GetLinkedDevicesFlagsResponseModel flags }); - +$GetLinkedDevicesSettingsResponseModelCopyWith<$Res> get settings;$GetLinkedDevicesFlagsResponseModelCopyWith<$Res> get flags; } /// @nodoc @@ -334,15 +334,40 @@ class _$GetLinkedDevicesItemResponseModelCopyWithImpl<$Res> /// Create a copy of GetLinkedDevicesItemResponseModel /// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? identificator = null,Object? name = null,Object? number = null,}) { +@pragma('vm:prefer-inline') @override $Res call({Object? identificator = null,Object? carrierName = null,Object? phone = null,Object? id = null,Object? settings = null,Object? protocol = null,Object? type = null,Object? connectionServer = null,Object? createdAt = null,Object? flags = null,}) { return _then(_self.copyWith( identificator: null == identificator ? _self.identificator : identificator // ignore: cast_nullable_to_non_nullable -as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable -as String,number: null == number ? _self.number : number // ignore: cast_nullable_to_non_nullable -as String, +as String,carrierName: null == carrierName ? _self.carrierName : carrierName // ignore: cast_nullable_to_non_nullable +as String,phone: null == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String,id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,settings: null == settings ? _self.settings : settings // ignore: cast_nullable_to_non_nullable +as GetLinkedDevicesSettingsResponseModel,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,connectionServer: null == connectionServer ? _self.connectionServer : connectionServer // ignore: cast_nullable_to_non_nullable +as String,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable +as int,flags: null == flags ? _self.flags : flags // ignore: cast_nullable_to_non_nullable +as GetLinkedDevicesFlagsResponseModel, )); } - +/// Create a copy of GetLinkedDevicesItemResponseModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GetLinkedDevicesSettingsResponseModelCopyWith<$Res> get settings { + + return $GetLinkedDevicesSettingsResponseModelCopyWith<$Res>(_self.settings, (value) { + return _then(_self.copyWith(settings: value)); + }); +}/// Create a copy of GetLinkedDevicesItemResponseModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GetLinkedDevicesFlagsResponseModelCopyWith<$Res> get flags { + + return $GetLinkedDevicesFlagsResponseModelCopyWith<$Res>(_self.flags, (value) { + return _then(_self.copyWith(flags: value)); + }); +} } @@ -424,10 +449,10 @@ return $default(_that);case _: /// } /// ``` -@optionalTypeArgs TResult maybeWhen(TResult Function( String identificator, String name, String number)? $default,{required TResult orElse(),}) {final _that = this; +@optionalTypeArgs TResult maybeWhen(TResult Function( String identificator, String carrierName, String phone, String id, GetLinkedDevicesSettingsResponseModel settings, String protocol, String type, String connectionServer, int createdAt, GetLinkedDevicesFlagsResponseModel flags)? $default,{required TResult orElse(),}) {final _that = this; switch (_that) { case _GetLinkedDevicesItemResponseModel() when $default != null: -return $default(_that.identificator,_that.name,_that.number);case _: +return $default(_that.identificator,_that.carrierName,_that.phone,_that.id,_that.settings,_that.protocol,_that.type,_that.connectionServer,_that.createdAt,_that.flags);case _: return orElse(); } @@ -445,10 +470,10 @@ return $default(_that.identificator,_that.name,_that.number);case _: /// } /// ``` -@optionalTypeArgs TResult when(TResult Function( String identificator, String name, String number) $default,) {final _that = this; +@optionalTypeArgs TResult when(TResult Function( String identificator, String carrierName, String phone, String id, GetLinkedDevicesSettingsResponseModel settings, String protocol, String type, String connectionServer, int createdAt, GetLinkedDevicesFlagsResponseModel flags) $default,) {final _that = this; switch (_that) { case _GetLinkedDevicesItemResponseModel(): -return $default(_that.identificator,_that.name,_that.number);case _: +return $default(_that.identificator,_that.carrierName,_that.phone,_that.id,_that.settings,_that.protocol,_that.type,_that.connectionServer,_that.createdAt,_that.flags);case _: throw StateError('Unexpected subclass'); } @@ -465,10 +490,10 @@ return $default(_that.identificator,_that.name,_that.number);case _: /// } /// ``` -@optionalTypeArgs TResult? whenOrNull(TResult? Function( String identificator, String name, String number)? $default,) {final _that = this; +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String identificator, String carrierName, String phone, String id, GetLinkedDevicesSettingsResponseModel settings, String protocol, String type, String connectionServer, int createdAt, GetLinkedDevicesFlagsResponseModel flags)? $default,) {final _that = this; switch (_that) { case _GetLinkedDevicesItemResponseModel() when $default != null: -return $default(_that.identificator,_that.name,_that.number);case _: +return $default(_that.identificator,_that.carrierName,_that.phone,_that.id,_that.settings,_that.protocol,_that.type,_that.connectionServer,_that.createdAt,_that.flags);case _: return null; } @@ -480,12 +505,19 @@ return $default(_that.identificator,_that.name,_that.number);case _: @JsonSerializable() class _GetLinkedDevicesItemResponseModel implements GetLinkedDevicesItemResponseModel { - const _GetLinkedDevicesItemResponseModel({required this.identificator, required this.name, required this.number}); + const _GetLinkedDevicesItemResponseModel({required this.identificator, required this.carrierName, required this.phone, required this.id, required this.settings, required this.protocol, required this.type, required this.connectionServer, required this.createdAt, required this.flags}); factory _GetLinkedDevicesItemResponseModel.fromJson(Map json) => _$GetLinkedDevicesItemResponseModelFromJson(json); @override final String identificator; -@override final String name; -@override final String number; +@override final String carrierName; +@override final String phone; +@override final String id; +@override final GetLinkedDevicesSettingsResponseModel settings; +@override final String protocol; +@override final String type; +@override final String connectionServer; +@override final int createdAt; +@override final GetLinkedDevicesFlagsResponseModel flags; /// Create a copy of GetLinkedDevicesItemResponseModel /// with the given fields replaced by the non-null parameter values. @@ -500,16 +532,16 @@ Map toJson() { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _GetLinkedDevicesItemResponseModel&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.name, name) || other.name == name)&&(identical(other.number, number) || other.number == number)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is _GetLinkedDevicesItemResponseModel&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.id, id) || other.id == id)&&(identical(other.settings, settings) || other.settings == settings)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.type, type) || other.type == type)&&(identical(other.connectionServer, connectionServer) || other.connectionServer == connectionServer)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.flags, flags) || other.flags == flags)); } @JsonKey(includeFromJson: false, includeToJson: false) @override -int get hashCode => Object.hash(runtimeType,identificator,name,number); +int get hashCode => Object.hash(runtimeType,identificator,carrierName,phone,id,settings,protocol,type,connectionServer,createdAt,flags); @override String toString() { - return 'GetLinkedDevicesItemResponseModel(identificator: $identificator, name: $name, number: $number)'; + return 'GetLinkedDevicesItemResponseModel(identificator: $identificator, carrierName: $carrierName, phone: $phone, id: $id, settings: $settings, protocol: $protocol, type: $type, connectionServer: $connectionServer, createdAt: $createdAt, flags: $flags)'; } @@ -520,11 +552,11 @@ abstract mixin class _$GetLinkedDevicesItemResponseModelCopyWith<$Res> implement factory _$GetLinkedDevicesItemResponseModelCopyWith(_GetLinkedDevicesItemResponseModel value, $Res Function(_GetLinkedDevicesItemResponseModel) _then) = __$GetLinkedDevicesItemResponseModelCopyWithImpl; @override @useResult $Res call({ - String identificator, String name, String number + String identificator, String carrierName, String phone, String id, GetLinkedDevicesSettingsResponseModel settings, String protocol, String type, String connectionServer, int createdAt, GetLinkedDevicesFlagsResponseModel flags }); - +@override $GetLinkedDevicesSettingsResponseModelCopyWith<$Res> get settings;@override $GetLinkedDevicesFlagsResponseModelCopyWith<$Res> get flags; } /// @nodoc @@ -537,12 +569,593 @@ class __$GetLinkedDevicesItemResponseModelCopyWithImpl<$Res> /// Create a copy of GetLinkedDevicesItemResponseModel /// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? identificator = null,Object? name = null,Object? number = null,}) { +@override @pragma('vm:prefer-inline') $Res call({Object? identificator = null,Object? carrierName = null,Object? phone = null,Object? id = null,Object? settings = null,Object? protocol = null,Object? type = null,Object? connectionServer = null,Object? createdAt = null,Object? flags = null,}) { return _then(_GetLinkedDevicesItemResponseModel( identificator: null == identificator ? _self.identificator : identificator // ignore: cast_nullable_to_non_nullable -as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable -as String,number: null == number ? _self.number : number // ignore: cast_nullable_to_non_nullable -as String, +as String,carrierName: null == carrierName ? _self.carrierName : carrierName // ignore: cast_nullable_to_non_nullable +as String,phone: null == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String,id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,settings: null == settings ? _self.settings : settings // ignore: cast_nullable_to_non_nullable +as GetLinkedDevicesSettingsResponseModel,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,connectionServer: null == connectionServer ? _self.connectionServer : connectionServer // ignore: cast_nullable_to_non_nullable +as String,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable +as int,flags: null == flags ? _self.flags : flags // ignore: cast_nullable_to_non_nullable +as GetLinkedDevicesFlagsResponseModel, + )); +} + +/// Create a copy of GetLinkedDevicesItemResponseModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GetLinkedDevicesSettingsResponseModelCopyWith<$Res> get settings { + + return $GetLinkedDevicesSettingsResponseModelCopyWith<$Res>(_self.settings, (value) { + return _then(_self.copyWith(settings: value)); + }); +}/// Create a copy of GetLinkedDevicesItemResponseModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GetLinkedDevicesFlagsResponseModelCopyWith<$Res> get flags { + + return $GetLinkedDevicesFlagsResponseModelCopyWith<$Res>(_self.flags, (value) { + return _then(_self.copyWith(flags: value)); + }); +} +} + + +/// @nodoc +mixin _$GetLinkedDevicesSettingsResponseModel { + + int get frequency; int get frequencyHeartRate; int get timezone; bool get pedometer; String get language; List get alerts; +/// Create a copy of GetLinkedDevicesSettingsResponseModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$GetLinkedDevicesSettingsResponseModelCopyWith get copyWith => _$GetLinkedDevicesSettingsResponseModelCopyWithImpl(this as GetLinkedDevicesSettingsResponseModel, _$identity); + + /// Serializes this GetLinkedDevicesSettingsResponseModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is GetLinkedDevicesSettingsResponseModel&&(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)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(alerts)); + +@override +String toString() { + return 'GetLinkedDevicesSettingsResponseModel(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts)'; +} + + +} + +/// @nodoc +abstract mixin class $GetLinkedDevicesSettingsResponseModelCopyWith<$Res> { + factory $GetLinkedDevicesSettingsResponseModelCopyWith(GetLinkedDevicesSettingsResponseModel value, $Res Function(GetLinkedDevicesSettingsResponseModel) _then) = _$GetLinkedDevicesSettingsResponseModelCopyWithImpl; +@useResult +$Res call({ + int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List alerts +}); + + + + +} +/// @nodoc +class _$GetLinkedDevicesSettingsResponseModelCopyWithImpl<$Res> + implements $GetLinkedDevicesSettingsResponseModelCopyWith<$Res> { + _$GetLinkedDevicesSettingsResponseModelCopyWithImpl(this._self, this._then); + + final GetLinkedDevicesSettingsResponseModel _self; + final $Res Function(GetLinkedDevicesSettingsResponseModel) _then; + +/// Create a copy of GetLinkedDevicesSettingsResponseModel +/// 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,}) { + 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, + )); +} + +} + + +/// Adds pattern-matching-related methods to [GetLinkedDevicesSettingsResponseModel]. +extension GetLinkedDevicesSettingsResponseModelPatterns on GetLinkedDevicesSettingsResponseModel { +/// 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 Function( _GetLinkedDevicesSettingsResponseModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _GetLinkedDevicesSettingsResponseModel() 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 Function( _GetLinkedDevicesSettingsResponseModel value) $default,){ +final _that = this; +switch (_that) { +case _GetLinkedDevicesSettingsResponseModel(): +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? Function( _GetLinkedDevicesSettingsResponseModel value)? $default,){ +final _that = this; +switch (_that) { +case _GetLinkedDevicesSettingsResponseModel() 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 Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List alerts)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _GetLinkedDevicesSettingsResponseModel() when $default != null: +return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts);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 Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List alerts) $default,) {final _that = this; +switch (_that) { +case _GetLinkedDevicesSettingsResponseModel(): +return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts);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? Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List alerts)? $default,) {final _that = this; +switch (_that) { +case _GetLinkedDevicesSettingsResponseModel() when $default != null: +return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _GetLinkedDevicesSettingsResponseModel implements GetLinkedDevicesSettingsResponseModel { + const _GetLinkedDevicesSettingsResponseModel({required this.frequency, required this.frequencyHeartRate, required this.timezone, required this.pedometer, required this.language, required final List alerts}): _alerts = alerts; + factory _GetLinkedDevicesSettingsResponseModel.fromJson(Map json) => _$GetLinkedDevicesSettingsResponseModelFromJson(json); + +@override final int frequency; +@override final int frequencyHeartRate; +@override final int timezone; +@override final bool pedometer; +@override final String language; + final List _alerts; +@override List get alerts { + if (_alerts is EqualUnmodifiableListView) return _alerts; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_alerts); +} + + +/// Create a copy of GetLinkedDevicesSettingsResponseModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$GetLinkedDevicesSettingsResponseModelCopyWith<_GetLinkedDevicesSettingsResponseModel> get copyWith => __$GetLinkedDevicesSettingsResponseModelCopyWithImpl<_GetLinkedDevicesSettingsResponseModel>(this, _$identity); + +@override +Map toJson() { + return _$GetLinkedDevicesSettingsResponseModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _GetLinkedDevicesSettingsResponseModel&&(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)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(_alerts)); + +@override +String toString() { + return 'GetLinkedDevicesSettingsResponseModel(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts)'; +} + + +} + +/// @nodoc +abstract mixin class _$GetLinkedDevicesSettingsResponseModelCopyWith<$Res> implements $GetLinkedDevicesSettingsResponseModelCopyWith<$Res> { + factory _$GetLinkedDevicesSettingsResponseModelCopyWith(_GetLinkedDevicesSettingsResponseModel value, $Res Function(_GetLinkedDevicesSettingsResponseModel) _then) = __$GetLinkedDevicesSettingsResponseModelCopyWithImpl; +@override @useResult +$Res call({ + int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List alerts +}); + + + + +} +/// @nodoc +class __$GetLinkedDevicesSettingsResponseModelCopyWithImpl<$Res> + implements _$GetLinkedDevicesSettingsResponseModelCopyWith<$Res> { + __$GetLinkedDevicesSettingsResponseModelCopyWithImpl(this._self, this._then); + + final _GetLinkedDevicesSettingsResponseModel _self; + final $Res Function(_GetLinkedDevicesSettingsResponseModel) _then; + +/// Create a copy of GetLinkedDevicesSettingsResponseModel +/// 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,}) { + return _then(_GetLinkedDevicesSettingsResponseModel( +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, + )); +} + + +} + + +/// @nodoc +mixin _$GetLinkedDevicesFlagsResponseModel { + + String get isInOrOut; String get geofenceId; bool get isBatteryLow; bool get isDisconnect; +/// Create a copy of GetLinkedDevicesFlagsResponseModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$GetLinkedDevicesFlagsResponseModelCopyWith get copyWith => _$GetLinkedDevicesFlagsResponseModelCopyWithImpl(this as GetLinkedDevicesFlagsResponseModel, _$identity); + + /// Serializes this GetLinkedDevicesFlagsResponseModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is GetLinkedDevicesFlagsResponseModel&&(identical(other.isInOrOut, isInOrOut) || other.isInOrOut == isInOrOut)&&(identical(other.geofenceId, geofenceId) || other.geofenceId == geofenceId)&&(identical(other.isBatteryLow, isBatteryLow) || other.isBatteryLow == isBatteryLow)&&(identical(other.isDisconnect, isDisconnect) || other.isDisconnect == isDisconnect)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,isInOrOut,geofenceId,isBatteryLow,isDisconnect); + +@override +String toString() { + return 'GetLinkedDevicesFlagsResponseModel(isInOrOut: $isInOrOut, geofenceId: $geofenceId, isBatteryLow: $isBatteryLow, isDisconnect: $isDisconnect)'; +} + + +} + +/// @nodoc +abstract mixin class $GetLinkedDevicesFlagsResponseModelCopyWith<$Res> { + factory $GetLinkedDevicesFlagsResponseModelCopyWith(GetLinkedDevicesFlagsResponseModel value, $Res Function(GetLinkedDevicesFlagsResponseModel) _then) = _$GetLinkedDevicesFlagsResponseModelCopyWithImpl; +@useResult +$Res call({ + String isInOrOut, String geofenceId, bool isBatteryLow, bool isDisconnect +}); + + + + +} +/// @nodoc +class _$GetLinkedDevicesFlagsResponseModelCopyWithImpl<$Res> + implements $GetLinkedDevicesFlagsResponseModelCopyWith<$Res> { + _$GetLinkedDevicesFlagsResponseModelCopyWithImpl(this._self, this._then); + + final GetLinkedDevicesFlagsResponseModel _self; + final $Res Function(GetLinkedDevicesFlagsResponseModel) _then; + +/// Create a copy of GetLinkedDevicesFlagsResponseModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? isInOrOut = null,Object? geofenceId = null,Object? isBatteryLow = null,Object? isDisconnect = null,}) { + return _then(_self.copyWith( +isInOrOut: null == isInOrOut ? _self.isInOrOut : isInOrOut // ignore: cast_nullable_to_non_nullable +as String,geofenceId: null == geofenceId ? _self.geofenceId : geofenceId // ignore: cast_nullable_to_non_nullable +as String,isBatteryLow: null == isBatteryLow ? _self.isBatteryLow : isBatteryLow // ignore: cast_nullable_to_non_nullable +as bool,isDisconnect: null == isDisconnect ? _self.isDisconnect : isDisconnect // ignore: cast_nullable_to_non_nullable +as bool, + )); +} + +} + + +/// Adds pattern-matching-related methods to [GetLinkedDevicesFlagsResponseModel]. +extension GetLinkedDevicesFlagsResponseModelPatterns on GetLinkedDevicesFlagsResponseModel { +/// 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 Function( _GetLinkedDevicesFlagsResponseModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _GetLinkedDevicesFlagsResponseModel() 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 Function( _GetLinkedDevicesFlagsResponseModel value) $default,){ +final _that = this; +switch (_that) { +case _GetLinkedDevicesFlagsResponseModel(): +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? Function( _GetLinkedDevicesFlagsResponseModel value)? $default,){ +final _that = this; +switch (_that) { +case _GetLinkedDevicesFlagsResponseModel() 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 Function( String isInOrOut, String geofenceId, bool isBatteryLow, bool isDisconnect)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _GetLinkedDevicesFlagsResponseModel() when $default != null: +return $default(_that.isInOrOut,_that.geofenceId,_that.isBatteryLow,_that.isDisconnect);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 Function( String isInOrOut, String geofenceId, bool isBatteryLow, bool isDisconnect) $default,) {final _that = this; +switch (_that) { +case _GetLinkedDevicesFlagsResponseModel(): +return $default(_that.isInOrOut,_that.geofenceId,_that.isBatteryLow,_that.isDisconnect);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? Function( String isInOrOut, String geofenceId, bool isBatteryLow, bool isDisconnect)? $default,) {final _that = this; +switch (_that) { +case _GetLinkedDevicesFlagsResponseModel() when $default != null: +return $default(_that.isInOrOut,_that.geofenceId,_that.isBatteryLow,_that.isDisconnect);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _GetLinkedDevicesFlagsResponseModel implements GetLinkedDevicesFlagsResponseModel { + const _GetLinkedDevicesFlagsResponseModel({required this.isInOrOut, required this.geofenceId, required this.isBatteryLow, required this.isDisconnect}); + factory _GetLinkedDevicesFlagsResponseModel.fromJson(Map json) => _$GetLinkedDevicesFlagsResponseModelFromJson(json); + +@override final String isInOrOut; +@override final String geofenceId; +@override final bool isBatteryLow; +@override final bool isDisconnect; + +/// Create a copy of GetLinkedDevicesFlagsResponseModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$GetLinkedDevicesFlagsResponseModelCopyWith<_GetLinkedDevicesFlagsResponseModel> get copyWith => __$GetLinkedDevicesFlagsResponseModelCopyWithImpl<_GetLinkedDevicesFlagsResponseModel>(this, _$identity); + +@override +Map toJson() { + return _$GetLinkedDevicesFlagsResponseModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _GetLinkedDevicesFlagsResponseModel&&(identical(other.isInOrOut, isInOrOut) || other.isInOrOut == isInOrOut)&&(identical(other.geofenceId, geofenceId) || other.geofenceId == geofenceId)&&(identical(other.isBatteryLow, isBatteryLow) || other.isBatteryLow == isBatteryLow)&&(identical(other.isDisconnect, isDisconnect) || other.isDisconnect == isDisconnect)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,isInOrOut,geofenceId,isBatteryLow,isDisconnect); + +@override +String toString() { + return 'GetLinkedDevicesFlagsResponseModel(isInOrOut: $isInOrOut, geofenceId: $geofenceId, isBatteryLow: $isBatteryLow, isDisconnect: $isDisconnect)'; +} + + +} + +/// @nodoc +abstract mixin class _$GetLinkedDevicesFlagsResponseModelCopyWith<$Res> implements $GetLinkedDevicesFlagsResponseModelCopyWith<$Res> { + factory _$GetLinkedDevicesFlagsResponseModelCopyWith(_GetLinkedDevicesFlagsResponseModel value, $Res Function(_GetLinkedDevicesFlagsResponseModel) _then) = __$GetLinkedDevicesFlagsResponseModelCopyWithImpl; +@override @useResult +$Res call({ + String isInOrOut, String geofenceId, bool isBatteryLow, bool isDisconnect +}); + + + + +} +/// @nodoc +class __$GetLinkedDevicesFlagsResponseModelCopyWithImpl<$Res> + implements _$GetLinkedDevicesFlagsResponseModelCopyWith<$Res> { + __$GetLinkedDevicesFlagsResponseModelCopyWithImpl(this._self, this._then); + + final _GetLinkedDevicesFlagsResponseModel _self; + final $Res Function(_GetLinkedDevicesFlagsResponseModel) _then; + +/// Create a copy of GetLinkedDevicesFlagsResponseModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? isInOrOut = null,Object? geofenceId = null,Object? isBatteryLow = null,Object? isDisconnect = null,}) { + return _then(_GetLinkedDevicesFlagsResponseModel( +isInOrOut: null == isInOrOut ? _self.isInOrOut : isInOrOut // ignore: cast_nullable_to_non_nullable +as String,geofenceId: null == geofenceId ? _self.geofenceId : geofenceId // ignore: cast_nullable_to_non_nullable +as String,isBatteryLow: null == isBatteryLow ? _self.isBatteryLow : isBatteryLow // ignore: cast_nullable_to_non_nullable +as bool,isDisconnect: null == isDisconnect ? _self.isDisconnect : isDisconnect // ignore: cast_nullable_to_non_nullable +as bool, )); } diff --git a/modules/legacy/modules/account/lib/src/core/data/models/get_linked_devices_response_model.g.dart b/modules/legacy/modules/account/lib/src/core/data/models/get_linked_devices_response_model.g.dart index 19d9d0bb..e50929b2 100644 --- a/modules/legacy/modules/account/lib/src/core/data/models/get_linked_devices_response_model.g.dart +++ b/modules/legacy/modules/account/lib/src/core/data/models/get_linked_devices_response_model.g.dart @@ -26,14 +26,74 @@ _GetLinkedDevicesItemResponseModel _$GetLinkedDevicesItemResponseModelFromJson( Map json, ) => _GetLinkedDevicesItemResponseModel( identificator: json['identificator'] as String, - name: json['name'] as String, - number: json['number'] as String, + carrierName: json['carrierName'] as String, + phone: json['phone'] as String, + id: json['id'] as String, + settings: GetLinkedDevicesSettingsResponseModel.fromJson( + json['settings'] as Map, + ), + protocol: json['protocol'] as String, + type: json['type'] as String, + connectionServer: json['connectionServer'] as String, + createdAt: (json['createdAt'] as num).toInt(), + flags: GetLinkedDevicesFlagsResponseModel.fromJson( + json['flags'] as Map, + ), ); Map _$GetLinkedDevicesItemResponseModelToJson( _GetLinkedDevicesItemResponseModel instance, ) => { 'identificator': instance.identificator, - 'name': instance.name, - 'number': instance.number, + 'carrierName': instance.carrierName, + 'phone': instance.phone, + 'id': instance.id, + 'settings': instance.settings, + 'protocol': instance.protocol, + 'type': instance.type, + 'connectionServer': instance.connectionServer, + 'createdAt': instance.createdAt, + 'flags': instance.flags, +}; + +_GetLinkedDevicesSettingsResponseModel +_$GetLinkedDevicesSettingsResponseModelFromJson(Map json) => + _GetLinkedDevicesSettingsResponseModel( + frequency: (json['frequency'] as num).toInt(), + frequencyHeartRate: (json['frequencyHeartRate'] as num).toInt(), + timezone: (json['timezone'] as num).toInt(), + pedometer: json['pedometer'] as bool, + language: json['language'] as String, + alerts: (json['alerts'] as List) + .map((e) => e as String) + .toList(), + ); + +Map _$GetLinkedDevicesSettingsResponseModelToJson( + _GetLinkedDevicesSettingsResponseModel instance, +) => { + 'frequency': instance.frequency, + 'frequencyHeartRate': instance.frequencyHeartRate, + 'timezone': instance.timezone, + 'pedometer': instance.pedometer, + 'language': instance.language, + 'alerts': instance.alerts, +}; + +_GetLinkedDevicesFlagsResponseModel +_$GetLinkedDevicesFlagsResponseModelFromJson(Map json) => + _GetLinkedDevicesFlagsResponseModel( + isInOrOut: json['isInOrOut'] as String, + geofenceId: json['geofenceId'] as String, + isBatteryLow: json['isBatteryLow'] as bool, + isDisconnect: json['isDisconnect'] as bool, + ); + +Map _$GetLinkedDevicesFlagsResponseModelToJson( + _GetLinkedDevicesFlagsResponseModel instance, +) => { + 'isInOrOut': instance.isInOrOut, + 'geofenceId': instance.geofenceId, + 'isBatteryLow': instance.isBatteryLow, + 'isDisconnect': instance.isDisconnect, }; diff --git a/modules/legacy/modules/account/lib/src/core/data/repositories/account_repository_impl.dart b/modules/legacy/modules/account/lib/src/core/data/repositories/account_repository_impl.dart index d414e245..ddac953a 100644 --- a/modules/legacy/modules/account/lib/src/core/data/repositories/account_repository_impl.dart +++ b/modules/legacy/modules/account/lib/src/core/data/repositories/account_repository_impl.dart @@ -1,6 +1,6 @@ import 'package:account/src/core/data/datasource/account_remote_datasource.dart'; import 'package:account/src/core/domain/repositories/account_repository.dart'; -import 'package:account/src/features/linked_devices/domain/entities/device_entity.dart'; +import 'package:legacy_shared/src/data/models/entities/device_entity.dart'; import 'package:account/src/features/linked_devices/domain/entities/update_device_request_entity.dart'; import 'package:account/src/features/personal_data/domain/entities/update_user_request_entity.dart'; import 'package:legacy_shared/legacy_shared.dart'; diff --git a/modules/legacy/modules/account/lib/src/core/domain/repositories/account_repository.dart b/modules/legacy/modules/account/lib/src/core/domain/repositories/account_repository.dart index 49b3d70e..21c55a91 100644 --- a/modules/legacy/modules/account/lib/src/core/domain/repositories/account_repository.dart +++ b/modules/legacy/modules/account/lib/src/core/domain/repositories/account_repository.dart @@ -1,4 +1,4 @@ -import 'package:account/src/features/linked_devices/domain/entities/device_entity.dart'; +import 'package:legacy_shared/src/data/models/entities/device_entity.dart'; import 'package:account/src/features/linked_devices/domain/entities/update_device_request_entity.dart'; import 'package:account/src/features/personal_data/domain/entities/update_user_request_entity.dart'; import 'package:legacy_shared/legacy_shared.dart'; diff --git a/modules/legacy/modules/account/lib/src/features/account_settings/presentation/account_settings_screen.dart b/modules/legacy/modules/account/lib/src/features/account_settings/presentation/account_settings_screen.dart index 6956c34c..ce898fcb 100644 --- a/modules/legacy/modules/account/lib/src/features/account_settings/presentation/account_settings_screen.dart +++ b/modules/legacy/modules/account/lib/src/features/account_settings/presentation/account_settings_screen.dart @@ -17,6 +17,8 @@ class AccountSettingsScreen extends ConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { final theme = ref.watch(themePortProvider); + final selectedDevice = ref.watch(selectedDeviceProvider); + return PageLayout( title: context.translate(I18n.accountSettings), body: SingleChildScrollView(child: Container( @@ -66,7 +68,7 @@ class AccountSettingsScreen extends ConsumerWidget { onPressed: (){ showDialog(context: context, builder: (context)=>Dialog( backgroundColor: Colors.transparent, - child: RegCodeDialog(regCode: 'regCode', deviceId: 'deviceId', name: 'name'), + child: RegCodeDialog(regCode: selectedDevice?.id ?? '', deviceId: selectedDevice?.identificator ?? '', name: selectedDevice?.carrierName ?? ''), )); }, icon: Icons.qr_code, diff --git a/modules/legacy/modules/account/lib/src/features/app_users/presentation/app_users_screen.dart b/modules/legacy/modules/account/lib/src/features/app_users/presentation/app_users_screen.dart index 41c1698b..ccdd457c 100644 --- a/modules/legacy/modules/account/lib/src/features/app_users/presentation/app_users_screen.dart +++ b/modules/legacy/modules/account/lib/src/features/app_users/presentation/app_users_screen.dart @@ -19,83 +19,33 @@ class AppUsersScreen extends ConsumerWidget { final theme = ref.watch(themePortProvider); - return Scaffold( - backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary), - body: SafeArea( - child: Column( - children: [ - Container( - padding: SizeUtils.getByScreen( - small: EdgeInsets.symmetric(horizontal: 22, vertical: 10), - big: EdgeInsets.symmetric(horizontal: 21, vertical: 8) - ), - child: Stack( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - IconButton(onPressed: () {Navigator.pop(context);}, - icon: Icon(Icons.arrow_back)), - if (!state.isEditing) ...[ - DecoratedBox( - decoration: BoxDecoration( - color: Color(0xFF588EA5), - shape: BoxShape.circle - ), - child: IconButton(onPressed: vm.toggleIsEditing, - icon: Icon(Icons.edit_outlined, - color: Colors.white, - size: SizeUtils.getByScreen(small: 30, big: 28), - ) - ), - ) - ] - ], - ), - Center( - child: Text(context.translate(I18n.legacyAppUsers), - style: TextStyle( - fontSize: SizeUtils.getByScreen(small: 28, big: 27) - ), - ) - ) - ], - ), + return PageLayout( + showEdit: true, + onEditChange: vm.toggleIsEditing, + title: context.translate(I18n.legacyAppUsers), + body: Container( + padding: SizeUtils.getByScreen( + small: EdgeInsets.symmetric(horizontal: 22, vertical: 10), + big: EdgeInsets.symmetric(horizontal: 21, vertical: 8) + ), + child: ListView.separated( + itemBuilder: (BuildContext context, int index)=>AppUserCard( + user: state.appUsers[index], + isEditing: state.isEditing, ), - SizedBox(height: SizeUtils.getByScreen(small: 20, big: 18)), - Expanded( child: Container( - padding: SizeUtils.getByScreen( - small: EdgeInsets.symmetric(horizontal: 22, vertical: 10), - big: EdgeInsets.symmetric(horizontal: 21, vertical: 8) - ), - child: ListView.separated( - itemBuilder: (BuildContext context, int index)=>AppUserCard( - user: state.appUsers[index], - isEditing: state.isEditing, - ), - separatorBuilder: (BuildContext context, int index)=>SizedBox( - height: SizeUtils.getByScreen(small: 18, big: 17) - ), - itemCount: state.appUsers.length - ), - )), - if (state.isEditing) ...[ - Container( - padding: SizeUtils.getByScreen( - small: EdgeInsets.symmetric(horizontal: 26, vertical: 14), - big: EdgeInsets.symmetric(horizontal: 24, vertical: 12) - ), - child: PrimaryButton( - onPressed: vm.toggleIsEditing, - text: context.translate(I18n.legacySave), - color: Color(0xFF588EA5), - height: SizeUtils.getByScreen(small: 44, big: 42), - ), - ), - ] - ], - ) + separatorBuilder: (BuildContext context, int index)=>SizedBox( + height: SizeUtils.getByScreen(small: 18, big: 17) + ), + itemCount: state.appUsers.length + ), ), + footer: state.isEditing ? + PrimaryButton( + onPressed: vm.toggleIsEditing, + text: context.translate(I18n.legacySave), + color: Color(0xFF588EA5), + height: SizeUtils.getByScreen(small: 44, big: 42), + ) : null ); } } diff --git a/modules/legacy/modules/account/lib/src/features/app_users/presentation/state/app_users_view_model.dart b/modules/legacy/modules/account/lib/src/features/app_users/presentation/state/app_users_view_model.dart index 06b6eda5..2296503c 100644 --- a/modules/legacy/modules/account/lib/src/features/app_users/presentation/state/app_users_view_model.dart +++ b/modules/legacy/modules/account/lib/src/features/app_users/presentation/state/app_users_view_model.dart @@ -21,7 +21,7 @@ class AppUsersViewModel extends Notifier { _getAppUsersUseCase = ref.read(getAppUsersUseCaseProvider); _deleteAppUserUseCase = ref.read(deleteAppUserUseCaseProvider); - ref.watch(loggedUserProvider.future) + ref.read(loggedUserProvider.future) .then((user){ setUser(user); return _getAppUsersUseCase.getAppUsers(userId: user.id); diff --git a/modules/legacy/modules/account/lib/src/features/linked_devices/domain/entities/device_entity.dart b/modules/legacy/modules/account/lib/src/features/linked_devices/domain/entities/device_entity.dart deleted file mode 100644 index c34bd875..00000000 --- a/modules/legacy/modules/account/lib/src/features/linked_devices/domain/entities/device_entity.dart +++ /dev/null @@ -1,12 +0,0 @@ -import 'package:freezed_annotation/freezed_annotation.dart'; - -part 'device_entity.freezed.dart'; - -@freezed -abstract class DeviceEntity with _$DeviceEntity { - const factory DeviceEntity({ - required String identificator, - required String name, - required String number, - }) = _DeviceEntity; -} diff --git a/modules/legacy/modules/account/lib/src/features/linked_devices/domain/entities/device_entity.freezed.dart b/modules/legacy/modules/account/lib/src/features/linked_devices/domain/entities/device_entity.freezed.dart deleted file mode 100644 index eed00822..00000000 --- a/modules/legacy/modules/account/lib/src/features/linked_devices/domain/entities/device_entity.freezed.dart +++ /dev/null @@ -1,277 +0,0 @@ -// 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_entity.dart'; - -// ************************************************************************** -// FreezedGenerator -// ************************************************************************** - -// dart format off -T _$identity(T value) => value; -/// @nodoc -mixin _$DeviceEntity { - - String get identificator; String get name; String get number; -/// Create a copy of DeviceEntity -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$DeviceEntityCopyWith get copyWith => _$DeviceEntityCopyWithImpl(this as DeviceEntity, _$identity); - - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceEntity&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.name, name) || other.name == name)&&(identical(other.number, number) || other.number == number)); -} - - -@override -int get hashCode => Object.hash(runtimeType,identificator,name,number); - -@override -String toString() { - return 'DeviceEntity(identificator: $identificator, name: $name, number: $number)'; -} - - -} - -/// @nodoc -abstract mixin class $DeviceEntityCopyWith<$Res> { - factory $DeviceEntityCopyWith(DeviceEntity value, $Res Function(DeviceEntity) _then) = _$DeviceEntityCopyWithImpl; -@useResult -$Res call({ - String identificator, String name, String number -}); - - - - -} -/// @nodoc -class _$DeviceEntityCopyWithImpl<$Res> - implements $DeviceEntityCopyWith<$Res> { - _$DeviceEntityCopyWithImpl(this._self, this._then); - - final DeviceEntity _self; - final $Res Function(DeviceEntity) _then; - -/// Create a copy of DeviceEntity -/// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? identificator = null,Object? name = null,Object? number = null,}) { - return _then(_self.copyWith( -identificator: null == identificator ? _self.identificator : identificator // ignore: cast_nullable_to_non_nullable -as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable -as String,number: null == number ? _self.number : number // ignore: cast_nullable_to_non_nullable -as String, - )); -} - -} - - -/// Adds pattern-matching-related methods to [DeviceEntity]. -extension DeviceEntityPatterns on DeviceEntity { -/// 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 Function( _DeviceEntity value)? $default,{required TResult orElse(),}){ -final _that = this; -switch (_that) { -case _DeviceEntity() 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 Function( _DeviceEntity value) $default,){ -final _that = this; -switch (_that) { -case _DeviceEntity(): -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? Function( _DeviceEntity value)? $default,){ -final _that = this; -switch (_that) { -case _DeviceEntity() 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 Function( String identificator, String name, String number)? $default,{required TResult orElse(),}) {final _that = this; -switch (_that) { -case _DeviceEntity() when $default != null: -return $default(_that.identificator,_that.name,_that.number);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 Function( String identificator, String name, String number) $default,) {final _that = this; -switch (_that) { -case _DeviceEntity(): -return $default(_that.identificator,_that.name,_that.number);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? Function( String identificator, String name, String number)? $default,) {final _that = this; -switch (_that) { -case _DeviceEntity() when $default != null: -return $default(_that.identificator,_that.name,_that.number);case _: - return null; - -} -} - -} - -/// @nodoc - - -class _DeviceEntity implements DeviceEntity { - const _DeviceEntity({required this.identificator, required this.name, required this.number}); - - -@override final String identificator; -@override final String name; -@override final String number; - -/// Create a copy of DeviceEntity -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$DeviceEntityCopyWith<_DeviceEntity> get copyWith => __$DeviceEntityCopyWithImpl<_DeviceEntity>(this, _$identity); - - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceEntity&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.name, name) || other.name == name)&&(identical(other.number, number) || other.number == number)); -} - - -@override -int get hashCode => Object.hash(runtimeType,identificator,name,number); - -@override -String toString() { - return 'DeviceEntity(identificator: $identificator, name: $name, number: $number)'; -} - - -} - -/// @nodoc -abstract mixin class _$DeviceEntityCopyWith<$Res> implements $DeviceEntityCopyWith<$Res> { - factory _$DeviceEntityCopyWith(_DeviceEntity value, $Res Function(_DeviceEntity) _then) = __$DeviceEntityCopyWithImpl; -@override @useResult -$Res call({ - String identificator, String name, String number -}); - - - - -} -/// @nodoc -class __$DeviceEntityCopyWithImpl<$Res> - implements _$DeviceEntityCopyWith<$Res> { - __$DeviceEntityCopyWithImpl(this._self, this._then); - - final _DeviceEntity _self; - final $Res Function(_DeviceEntity) _then; - -/// Create a copy of DeviceEntity -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? identificator = null,Object? name = null,Object? number = null,}) { - return _then(_DeviceEntity( -identificator: null == identificator ? _self.identificator : identificator // ignore: cast_nullable_to_non_nullable -as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable -as String,number: null == number ? _self.number : number // ignore: cast_nullable_to_non_nullable -as String, - )); -} - - -} - -// dart format on diff --git a/modules/legacy/modules/account/lib/src/features/linked_devices/domain/get_linked_devices_use_case.dart b/modules/legacy/modules/account/lib/src/features/linked_devices/domain/get_linked_devices_use_case.dart index 67f1d8d5..777be86a 100644 --- a/modules/legacy/modules/account/lib/src/features/linked_devices/domain/get_linked_devices_use_case.dart +++ b/modules/legacy/modules/account/lib/src/features/linked_devices/domain/get_linked_devices_use_case.dart @@ -1,4 +1,4 @@ -import 'package:account/src/features/linked_devices/domain/entities/device_entity.dart'; +import 'package:legacy_shared/src/data/models/entities/device_entity.dart'; abstract class GetLinkedDevicesUseCase { Future> getLinkedDevices({required String userId}); diff --git a/modules/legacy/modules/account/lib/src/features/linked_devices/domain/get_linked_devices_use_case_impl.dart b/modules/legacy/modules/account/lib/src/features/linked_devices/domain/get_linked_devices_use_case_impl.dart index 5cabc76e..7b7b5bef 100644 --- a/modules/legacy/modules/account/lib/src/features/linked_devices/domain/get_linked_devices_use_case_impl.dart +++ b/modules/legacy/modules/account/lib/src/features/linked_devices/domain/get_linked_devices_use_case_impl.dart @@ -1,5 +1,5 @@ import 'package:account/src/core/domain/repositories/account_repository.dart'; -import 'package:account/src/features/linked_devices/domain/entities/device_entity.dart'; +import 'package:legacy_shared/src/data/models/entities/device_entity.dart'; import 'package:account/src/features/linked_devices/domain/get_linked_devices_use_case.dart'; class GetLinkedDevicesUseCaseImpl implements GetLinkedDevicesUseCase { diff --git a/modules/legacy/modules/account/lib/src/features/linked_devices/presentation/edit_linked_device_screen.dart b/modules/legacy/modules/account/lib/src/features/linked_devices/presentation/edit_linked_device_screen.dart index 2d68088b..3a29e975 100644 --- a/modules/legacy/modules/account/lib/src/features/linked_devices/presentation/edit_linked_device_screen.dart +++ b/modules/legacy/modules/account/lib/src/features/linked_devices/presentation/edit_linked_device_screen.dart @@ -1,9 +1,10 @@ -import 'package:account/src/features/linked_devices/domain/entities/device_entity.dart'; +import 'package:legacy_shared/src/data/models/entities/device_entity.dart'; import 'package:account/src/features/linked_devices/presentation/state/linked_devices_view_model.dart'; import 'package:design_system/design_system.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:legacy_shared/legacy_shared.dart'; // import 'package:navigation/navigation.dart'; import 'package:sf_localizations/sf_localizations.dart'; import 'package:utils/utils.dart'; @@ -21,86 +22,92 @@ class EditLinkedDeviceScreen extends ConsumerWidget { final theme = ref.watch(themePortProvider); - return Scaffold( + return /*PageLayout( + title: context.translate(I18n.legacyEditDeviceTitle), + showEdit: true, + onEditChange: vm.toggleIsEditing, + body: body + );*/ + Scaffold( backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary), body: SafeArea( - child: Column( - children: [ - Container( - padding: SizeUtils.getByScreen( - small: EdgeInsets.symmetric(horizontal: 22, vertical: 10), - big: EdgeInsets.symmetric(horizontal: 21, vertical: 8) - ), - child: Stack( - children: [ - IconButton(onPressed: () {Navigator.pop(context);}, - icon: Icon(Icons.arrow_back)), - Center( - child: Text(context.translate(I18n.legacyEditDeviceTitle), - style: TextStyle( - fontSize: SizeUtils.getByScreen(small: 28, big: 27) - ), - ) - ) - ], - ), + child: Column( + children: [ + Container( + padding: SizeUtils.getByScreen( + small: EdgeInsets.symmetric(horizontal: 22, vertical: 10), + big: EdgeInsets.symmetric(horizontal: 21, vertical: 8) ), - SizedBox(height: SizeUtils.getByScreen(small: 20, big: 18)), - Expanded(child: Container( - padding: SizeUtils.getByScreen( - small: EdgeInsets.symmetric(horizontal: 48, vertical: 10), - big: EdgeInsets.symmetric(horizontal: 47, vertical: 8) - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Stack( - children: [ - Center(child: SvgPicture.asset('assets/images/ui/profile.svg')), - Center(child: SizedBox( - width: 160, - height: 160, - child: Align(alignment: Alignment.bottomRight, - child: IconButton( - onPressed: (){}, - icon: Container( - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Color(0xFFCAC9C9) - ), - padding: EdgeInsets.all(8), - child: Icon( - Icons.edit_outlined, - color: Colors.white, - size: SizeUtils.getByScreen(small: 32, big: 30), - ), + child: Stack( + children: [ + IconButton(onPressed: () {Navigator.pop(context);}, + icon: Icon(Icons.arrow_back)), + Center( + child: Text(context.translate(I18n.legacyEditDeviceTitle), + style: TextStyle( + fontSize: SizeUtils.getByScreen(small: 28, big: 27) + ), + ) + ) + ], + ), + ), + SizedBox(height: SizeUtils.getByScreen(small: 20, big: 18)), + Expanded(child: Container( + padding: SizeUtils.getByScreen( + small: EdgeInsets.symmetric(horizontal: 48, vertical: 10), + big: EdgeInsets.symmetric(horizontal: 47, vertical: 8) + ), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Stack( + children: [ + Center(child: SvgPicture.asset('assets/images/ui/profile.svg')), + Center(child: SizedBox( + width: 160, + height: 160, + child: Align(alignment: Alignment.bottomRight, + child: IconButton( + onPressed: (){}, + icon: Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Color(0xFFCAC9C9) ), - ) + padding: EdgeInsets.all(8), + child: Icon( + Icons.edit_outlined, + color: Colors.white, + size: SizeUtils.getByScreen(small: 32, big: 30), + ), + ), ) - )) - ], - ), - SizedBox(height: SizeUtils.getByScreen(small: 24, big: 22)), - CustomTextField( - controller: vm.deviceNameController, - hint: device.name, - label: context.translate(I18n.legacyName), - ) - ], - ), - PrimaryButton( - onPressed: (){vm.updateDevice(device);}, - text: context.translate(I18n.legacySave), - color: Color(0xFF588EA5) - ) - ], - )) - ), - ], - ) + ) + )) + ], + ), + SizedBox(height: SizeUtils.getByScreen(small: 24, big: 22)), + CustomTextField( + controller: vm.deviceNameController, + hint: device.carrierName, + label: context.translate(I18n.legacyName), + ) + ], + ), + PrimaryButton( + onPressed: (){vm.updateDevice(device);}, + text: context.translate(I18n.legacySave), + color: Color(0xFF588EA5) + ) + ], + )) + ), + ], + ) ), ); } diff --git a/modules/legacy/modules/account/lib/src/features/linked_devices/presentation/linked_devices_screen.dart b/modules/legacy/modules/account/lib/src/features/linked_devices/presentation/linked_devices_screen.dart index 1694f4ef..c5eac3f4 100644 --- a/modules/legacy/modules/account/lib/src/features/linked_devices/presentation/linked_devices_screen.dart +++ b/modules/legacy/modules/account/lib/src/features/linked_devices/presentation/linked_devices_screen.dart @@ -1,9 +1,10 @@ -import 'package:account/src/features/linked_devices/domain/entities/device_entity.dart'; +import 'package:legacy_shared/src/data/models/entities/device_entity.dart'; import 'package:account/src/features/linked_devices/presentation/edit_linked_device_screen.dart'; import 'package:account/src/features/linked_devices/presentation/state/linked_devices_view_model.dart'; import 'package:design_system/design_system.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:legacy_shared/legacy_shared.dart'; import 'package:navigation/navigation.dart'; import 'package:sf_localizations/sf_localizations.dart'; import 'package:utils/utils.dart'; @@ -20,67 +21,26 @@ class LinkedDevicesScreen extends ConsumerWidget { final theme = ref.watch(themePortProvider); - return Scaffold( - backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary), - body: SafeArea( - child: Column( - children: [ - Container( - padding: SizeUtils.getByScreen( - small: EdgeInsets.symmetric(horizontal: 22, vertical: 10), - big: EdgeInsets.symmetric(horizontal: 21, vertical: 8) - ), - child: Stack( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - IconButton(onPressed: () {Navigator.pop(context);}, - icon: Icon(Icons.arrow_back)), - DecoratedBox( - decoration: BoxDecoration( - color: Color(0xFF588EA5), - shape: BoxShape.circle - ), - child: IconButton(onPressed: vm.toggleIsEditing, - icon: Icon(Icons.edit_outlined, - color: Colors.white, - size: SizeUtils.getByScreen(small: 30, big: 28), - ) - ), - ) - ], - ), - Center( - child: Text(context.translate(I18n.legacyLinkedDevices), - style: TextStyle( - fontSize: SizeUtils.getByScreen(small: 28, big: 27) - ), - ) - ) - ], - ), - ), - SizedBox(height: SizeUtils.getByScreen(small: 20, big: 18)), - Expanded( child: Container( - padding: SizeUtils.getByScreen( - small: EdgeInsets.symmetric(horizontal: 22, vertical: 10), - big: EdgeInsets.symmetric(horizontal: 21, vertical: 8) - ), - child: ListView.separated( - itemBuilder: (BuildContext context, int index)=>LinkedDeviceCard( - device: state.linkedDevices[index], - isEditing: state.isEditing, - onDelete: ()=>vm.deleteDevice(state.linkedDevices[index]), - ), - separatorBuilder: (BuildContext context, int index)=>SizedBox( - height: SizeUtils.getByScreen(small: 18, big: 17) - ), - itemCount: state.linkedDevices.length - ), - )), - ], - ) + return PageLayout( + title: context.translate(I18n.legacyLinkedDevices), + showEdit: true, + onEditChange: vm.toggleIsEditing, + body: Container( + padding: SizeUtils.getByScreen( + small: EdgeInsets.symmetric(horizontal: 22, vertical: 10), + big: EdgeInsets.symmetric(horizontal: 21, vertical: 8) + ), + child: ListView.separated( + itemBuilder: (BuildContext context, int index)=>LinkedDeviceCard( + device: state.linkedDevices[index], + isEditing: state.isEditing, + onDelete: ()=>vm.deleteDevice(state.linkedDevices[index]), + ), + separatorBuilder: (BuildContext context, int index)=>SizedBox( + height: SizeUtils.getByScreen(small: 18, big: 17) + ), + itemCount: state.linkedDevices.length + ), ), ); } @@ -130,13 +90,13 @@ class LinkedDeviceCard extends ConsumerWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text(device.name, + Text(device.carrierName, style: TextStyle( fontSize: SizeUtils.getByScreen(small: 18, big: 19), fontWeight: FontWeight.w500 ) ), - Text(device.number, + Text(device.phone ?? '', style: TextStyle( fontSize: SizeUtils.getByScreen(small: 14, big: 13), ) diff --git a/modules/legacy/modules/account/lib/src/features/linked_devices/presentation/state/linked_devices_view_model.dart b/modules/legacy/modules/account/lib/src/features/linked_devices/presentation/state/linked_devices_view_model.dart index 14432580..58a85727 100644 --- a/modules/legacy/modules/account/lib/src/features/linked_devices/presentation/state/linked_devices_view_model.dart +++ b/modules/legacy/modules/account/lib/src/features/linked_devices/presentation/state/linked_devices_view_model.dart @@ -1,5 +1,5 @@ import 'package:account/src/features/linked_devices/domain/delete_device_use_case.dart'; -import 'package:account/src/features/linked_devices/domain/entities/device_entity.dart'; +import 'package:legacy_shared/src/data/models/entities/device_entity.dart'; import 'package:account/src/features/linked_devices/domain/entities/update_device_request_entity.dart'; import 'package:account/src/features/linked_devices/domain/get_linked_devices_use_case.dart'; import 'package:account/src/features/linked_devices/domain/update_device_use_case.dart'; @@ -33,7 +33,7 @@ class LinkedDevicesViewModel extends Notifier { deviceNameController = TextEditingController(); deviceNameController.addListener(_onDeviceNameChanged); - ref.watch(loggedUserProvider.future) + ref.read(loggedUserProvider.future) .then((user){ setUser(user); return _getLinkedDevicesUseCase.getLinkedDevices(userId: user.id); diff --git a/modules/legacy/modules/account/lib/src/features/linked_devices/presentation/state/linked_devices_view_state.dart b/modules/legacy/modules/account/lib/src/features/linked_devices/presentation/state/linked_devices_view_state.dart index 26a091f8..373f3b01 100644 --- a/modules/legacy/modules/account/lib/src/features/linked_devices/presentation/state/linked_devices_view_state.dart +++ b/modules/legacy/modules/account/lib/src/features/linked_devices/presentation/state/linked_devices_view_state.dart @@ -1,4 +1,4 @@ -import 'package:account/src/features/linked_devices/domain/entities/device_entity.dart'; +import 'package:legacy_shared/src/data/models/entities/device_entity.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:legacy_shared/legacy_shared.dart'; diff --git a/modules/legacy/modules/account/lib/src/features/personal_data/presentation/personal_data_screen.dart b/modules/legacy/modules/account/lib/src/features/personal_data/presentation/personal_data_screen.dart index 0e2858f9..92ac5845 100644 --- a/modules/legacy/modules/account/lib/src/features/personal_data/presentation/personal_data_screen.dart +++ b/modules/legacy/modules/account/lib/src/features/personal_data/presentation/personal_data_screen.dart @@ -3,6 +3,7 @@ import 'package:design_system/design_system.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:legacy_shared/legacy_shared.dart'; import 'package:navigation/navigation.dart'; import 'package:sf_localizations/sf_localizations.dart'; import 'package:utils/utils.dart'; @@ -19,113 +20,74 @@ class PersonalDataScreen extends ConsumerWidget { final theme = ref.watch(themePortProvider); - return Scaffold( - backgroundColor: theme.getColorFor(ThemeCode.backgroundPrimary), - body: SafeArea( - child: Column( - children: [ - Container( - padding: SizeUtils.getByScreen( - small: EdgeInsets.symmetric(horizontal: 22, vertical: 10), - big: EdgeInsets.symmetric(horizontal: 21, vertical: 8) - ), - child: Stack( - children: [ - IconButton(onPressed: () {Navigator.pop(context);}, - icon: Icon(Icons.arrow_back)), - Center( - child: Text(context.translate(I18n.legacyPersonalData), - style: TextStyle( - fontSize: SizeUtils.getByScreen(small: 28, big: 27) + return PageLayout( + title: context.translate(I18n.legacyPersonalData), + body: Container( + padding: SizeUtils.getByScreen( + small: EdgeInsets.symmetric(horizontal: 48, vertical: 10), + big: EdgeInsets.symmetric(horizontal: 47, vertical: 8) + ), + child: SingleChildScrollView(child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Stack( + children: [ + Center(child: SvgPicture.asset('assets/images/ui/profile.svg')), + Center(child: SizedBox( + width: 160, + height: 160, + child: Align(alignment: Alignment.bottomRight, + child: IconButton( + onPressed: (){}, + icon: Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Color(0xFFCAC9C9) ), - ) + padding: EdgeInsets.all(8), + child: Icon( + Icons.edit_outlined, + color: Colors.white, + size: SizeUtils.getByScreen(small: 32, big: 30), + ), + ), ) - ], - ), - ), - SizedBox(height: SizeUtils.getByScreen(small: 20, big: 18)), - Expanded(child: Container( - padding: SizeUtils.getByScreen( - small: EdgeInsets.symmetric(horizontal: 48, vertical: 10), - big: EdgeInsets.symmetric(horizontal: 47, vertical: 8) - ), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded(child: SingleChildScrollView(child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Stack( - children: [ - Center(child: SvgPicture.asset('assets/images/ui/profile.svg')), - Center(child: SizedBox( - width: 160, - height: 160, - child: Align(alignment: Alignment.bottomRight, - child: IconButton( - onPressed: (){}, - icon: Container( - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Color(0xFFCAC9C9) - ), - padding: EdgeInsets.all(8), - child: Icon( - Icons.edit_outlined, - color: Colors.white, - size: SizeUtils.getByScreen(small: 32, big: 30), - ), - ), - ) - ) - )) - ], - ), - SizedBox(height: SizeUtils.getByScreen(small: 18, big: 16)), - Text(context.translate(I18n.legacyLoginEmail), - style: TextStyle(fontSize: SizeUtils.getByScreen(small: 14, big: 13)) - ), - Text(state.user?.email ?? '', - style: TextStyle(fontSize: SizeUtils.getByScreen(small: 18, big: 17)) - ), - SizedBox(height: SizeUtils.getByScreen(small: 24, big: 22)), - CustomTextField( - controller: vm.nameController, - hint: state.user?.firstName ?? '', - label: context.translate(I18n.legacyUserNameLabel), - ), - SizedBox(height: SizeUtils.getByScreen(small: 24, big: 22)), - CustomTextField( - controller: vm.phoneController, - hint: state.user?.phone ?? '', - label: context.translate(I18n.legacyUserPhoneLabel), - ), - SizedBox(height: SizeUtils.getByScreen(small: 24, big: 22)), - CustomTextField( - controller: vm.emailController, - hint: state.user?.email ?? '', - label: context.translate(I18n.legacyContactEmailLabel), - ), - SizedBox(height: SizeUtils.getByScreen(small: 24, big: 22)), - CustomTextField( - controller: vm.passwordController, - showPassword: state.showPassword, - hint: '********', - label: context.translate(I18n.passwordLabel), - ), - ], - ))), - SizedBox(height: SizeUtils.getByScreen(small: 24, big: 22)), - PrimaryButton( - onPressed: vm.updateUser, - text: context.translate(I18n.legacySubmit), - color: Color(0xFF588EA5) - ) - ], + ) )) - ), - ], - ) + ], + ), + SizedBox(height: SizeUtils.getByScreen(small: 18, big: 16)), + Text(context.translate(I18n.emailLabel), + style: TextStyle(fontSize: SizeUtils.getByScreen(small: 14, big: 13)) + ), + Text(state.user?.email ?? '', + style: TextStyle(fontSize: SizeUtils.getByScreen(small: 18, big: 17)) + ), + SizedBox(height: SizeUtils.getByScreen(small: 24, big: 22)), + CustomTextField( + controller: vm.nameController, + hint: state.user?.firstName ?? '', + label: context.translate(I18n.firstNameLabel), + ), + SizedBox(height: SizeUtils.getByScreen(small: 24, big: 22)), + CustomTextField( + controller: vm.phoneController, + hint: state.user?.phone ?? '', + label: context.translate(I18n.phoneLabel), + ), + SizedBox(height: SizeUtils.getByScreen(small: 24, big: 22)), + CustomTextField( + controller: vm.emailController, + hint: state.user?.email ?? '', + label: context.translate(I18n.emailLabel), + ), + ], + )) + ), + footer: PrimaryButton( + onPressed: vm.updateUser, + text: context.translate(I18n.legacySubmit), + color: Color(0xFF588EA5) ), ); } diff --git a/modules/legacy/modules/account/lib/src/features/personal_data/presentation/state/personal_data_view_model.dart b/modules/legacy/modules/account/lib/src/features/personal_data/presentation/state/personal_data_view_model.dart index 3404a946..febcec7c 100644 --- a/modules/legacy/modules/account/lib/src/features/personal_data/presentation/state/personal_data_view_model.dart +++ b/modules/legacy/modules/account/lib/src/features/personal_data/presentation/state/personal_data_view_model.dart @@ -36,7 +36,7 @@ class PersonalDataViewModel extends Notifier { passwordController = TextEditingController(); passwordController.addListener(_onPasswordChanged); - ref.watch(loggedUserProvider.future) + ref.read(loggedUserProvider.future) .then(setUser); ref.onDispose(disposeControllers); @@ -117,6 +117,7 @@ class PersonalDataViewModel extends Notifier { final request = _toRequest(); _updateUserUseCase.updateUser(userId: state.user!.id, request: request); + ref.invalidate(loggedUserProvider); return true; } catch (e) { diff --git a/modules/legacy/modules/account/pubspec.yaml b/modules/legacy/modules/account/pubspec.yaml new file mode 100644 index 00000000..c68930d9 --- /dev/null +++ b/modules/legacy/modules/account/pubspec.yaml @@ -0,0 +1,116 @@ +name: account +description: "A new Flutter project." + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# +# This version is used _only_ for the Runner app, which is used if you just do +# a `flutter run`. It has no impact on any other native host app that you embed +# your Flutter project into. +version: 1.0.0+1 + +environment: + sdk: ^3.9.2 + +dependencies: + flutter: + sdk: flutter + #modules dependencies go here + + #packages dependencies go here + design_system: + path: ../../../../packages/design_system + navigation: + path: ../../../../packages/navigation + sf_localizations: + path: ../../../../packages/sf_localizations + sf_infrastructure: + path: ../../../../packages/sf_infrastructure + utils: + path: ../../../../packages/utils + fonts: + path: ../../../../packages/fonts + legacy_shared: + path: ../../packages/legacy_shared + #dependencies go here + flutter_svg: ^2.2.1 + get_it: ^9.0.5 + go_router: ^17.0.0 + flutter_riverpod: ^3.0.3 + freezed_annotation: ^3.1.0 + freezed: ^3.2.3 + dio: ^5.9.0 + json_annotation: ^4.9.0 + json_serializable: ^6.11.2 + uuid: ^4.5.2 + qr_flutter: ^4.1.0 + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.8 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^5.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +flutter: + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add Flutter specific assets to your application, add an assets section, + # like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/to/resolution-aware-images + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/to/asset-from-package + + # To add Flutter specific custom fonts to your application, add a fonts + # section here, in this "flutter" section. Each entry in this list should + # have a "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/to/font-from-package + + + # This section identifies your Flutter project as a module meant for + # embedding in a native host app. These identifiers should _not_ ordinarily + # be changed after generation - they are used to ensure that the tooling can + # maintain consistency when adding or modifying assets and plugins. + # They also do not have any bearing on your native host application's + # identifiers, which may be completely independent or the same as these. + module: + androidX: true + androidPackage: com.example.account + iosBundleIdentifier: com.example.account diff --git a/modules/legacy/modules/customer_service/pubspec.yaml b/modules/legacy/modules/customer_service/pubspec.yaml new file mode 100644 index 00000000..d5e1e055 --- /dev/null +++ b/modules/legacy/modules/customer_service/pubspec.yaml @@ -0,0 +1,117 @@ +name: customer_service +description: "A new Flutter project." + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +# +# This version is used _only_ for the Runner app, which is used if you just do +# a `flutter run`. It has no impact on any other native host app that you embed +# your Flutter project into. +version: 1.0.0+1 + +environment: + sdk: ^3.9.2 + +dependencies: + flutter: + sdk: flutter + #modules dependencies go here + + #packages dependencies go here + design_system: + path: ../../../../packages/design_system + navigation: + path: ../../../../packages/navigation + sf_localizations: + path: ../../../../packages/sf_localizations + sf_infrastructure: + path: ../../../../packages/sf_infrastructure + utils: + path: ../../../../packages/utils + fonts: + path: ../../../../packages/fonts + legacy_shared: + path: ../../packages/legacy_shared + #dependencies go here + flutter_svg: ^2.2.1 + get_it: ^9.0.5 + go_router: ^17.0.0 + flutter_riverpod: ^3.0.3 + freezed_annotation: ^3.1.0 + freezed: ^3.2.3 + dio: ^5.9.0 + json_annotation: ^4.9.0 + json_serializable: ^6.11.2 + url_launcher: ^6.3.2 + qr_flutter: ^4.1.0 + + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.8 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^5.0.0 + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +flutter: + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + # To add Flutter specific assets to your application, add an assets section, + # like this: + # assets: + # - images/a_dot_burr.jpeg + # - images/a_dot_ham.jpeg + + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/to/resolution-aware-images + + # For details regarding adding assets from package dependencies, see + # https://flutter.dev/to/asset-from-package + + # To add Flutter specific custom fonts to your application, add a fonts + # section here, in this "flutter" section. Each entry in this list should + # have a "family" key with the font family name, and a "fonts" key with a + # list giving the asset and other descriptors for the font. For + # example: + # fonts: + # - family: Schyler + # fonts: + # - asset: fonts/Schyler-Regular.ttf + # - asset: fonts/Schyler-Italic.ttf + # style: italic + # - family: Trajan Pro + # fonts: + # - asset: fonts/TrajanPro.ttf + # - asset: fonts/TrajanPro_Bold.ttf + # weight: 700 + # + # For details regarding fonts from package dependencies, + # see https://flutter.dev/to/font-from-package + + + # This section identifies your Flutter project as a module meant for + # embedding in a native host app. These identifiers should _not_ ordinarily + # be changed after generation - they are used to ensure that the tooling can + # maintain consistency when adding or modifying assets and plugins. + # They also do not have any bearing on your native host application's + # identifiers, which may be completely independent or the same as these. + module: + androidX: true + androidPackage: com.example.customer_service + iosBundleIdentifier: com.example.customerService diff --git a/modules/legacy/modules/hub/lib/src/core/data/datasource/hub_remote_datasource.dart b/modules/legacy/modules/hub/lib/src/core/data/datasource/hub_remote_datasource.dart index 54336801..2f14ce30 100644 --- a/modules/legacy/modules/hub/lib/src/core/data/datasource/hub_remote_datasource.dart +++ b/modules/legacy/modules/hub/lib/src/core/data/datasource/hub_remote_datasource.dart @@ -1,7 +1,5 @@ - -import 'package:hub/src/features/hub/domain/entities/device_entity.dart'; -import 'package:hub/src/features/hub/domain/entities/get_devices_request_entity.dart'; import 'package:hub/src/features/hub/domain/entities/position_entity.dart'; +import 'package:legacy_shared/legacy_shared.dart'; abstract class HomeRemoteDatasource { Future> getDevices({required String userId}); diff --git a/modules/legacy/modules/hub/lib/src/core/data/datasource/hub_remote_datasource_impl.dart b/modules/legacy/modules/hub/lib/src/core/data/datasource/hub_remote_datasource_impl.dart index 6eca5a50..ac9c073a 100644 --- a/modules/legacy/modules/hub/lib/src/core/data/datasource/hub_remote_datasource_impl.dart +++ b/modules/legacy/modules/hub/lib/src/core/data/datasource/hub_remote_datasource_impl.dart @@ -4,8 +4,8 @@ import 'package:dio/dio.dart'; import 'package:hub/src/core/data/datasource/hub_remote_datasource.dart'; import 'package:hub/src/core/data/models/get_devices_response_model.dart'; import 'package:hub/src/core/data/models/latest_positions_response_model.dart'; -import 'package:hub/src/features/hub/domain/entities/device_entity.dart'; import 'package:hub/src/features/hub/domain/entities/position_entity.dart'; +import 'package:legacy_shared/legacy_shared.dart'; import 'package:sf_infrastructure/sf_infrastructure.dart'; class HomeRemoteDatasourceImpl implements HomeRemoteDatasource { diff --git a/modules/legacy/modules/hub/lib/src/core/data/models/get_devices_response_model.dart b/modules/legacy/modules/hub/lib/src/core/data/models/get_devices_response_model.dart index e64f3bf5..523daef1 100644 --- a/modules/legacy/modules/hub/lib/src/core/data/models/get_devices_response_model.dart +++ b/modules/legacy/modules/hub/lib/src/core/data/models/get_devices_response_model.dart @@ -1,5 +1,5 @@ +import 'package:legacy_shared/src/data/models/entities/device_entity.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; -import 'package:hub/src/features/hub/domain/entities/device_entity.dart'; part 'get_devices_response_model.freezed.dart'; part 'get_devices_response_model.g.dart'; @@ -15,13 +15,20 @@ abstract class GetDevicesResponseModel with _$GetDevicesResponseModel { } @freezed -abstract class GetDevicesItemResponseModel - with _$GetDevicesItemResponseModel { +abstract class GetDevicesItemResponseModel with _$GetDevicesItemResponseModel { const factory GetDevicesItemResponseModel({ - required String id, required String identificator, required String carrierName, - }) = _GetDevicesItemResponseModel; + required String phone, + required String id, + required GetDevicesSettingsResponseModel settings, + required String protocol, + required String type, + required String connectionServer, + required int createdAt, + required GetDevicesFlagsResponseModel flags, + }) = + _GetDevicesItemResponseModel; factory GetDevicesItemResponseModel.fromJson(Map json) => _$GetDevicesItemResponseModelFromJson(json); @@ -30,9 +37,68 @@ abstract class GetDevicesItemResponseModel extension GetDevicesResponseModelMapper on GetDevicesResponseModel { List toEntity() { return items.map((GetDevicesItemResponseModel item) => DeviceEntity( - id: item.id, - identificator: item.identificator, - carrierName: item.carrierName, + identificator: item.identificator, + carrierName: item.carrierName, + phone: item.phone, + id: item.id, + settings: item.settings.toEntity(), + protocol: item.protocol, + type: item.type, + connectionServer: item.connectionServer, + createdAt: item.createdAt, + flags: item.flags.toEntity(), )).toList(); } } + +@freezed +abstract class GetDevicesSettingsResponseModel with _$GetDevicesSettingsResponseModel { + const factory GetDevicesSettingsResponseModel({ + required int frequency, + required int frequencyHeartRate, + required int timezone, + required bool pedometer, + required String language, + required List alerts, + }) = _GetDevicesSettingsResponseModel; + + factory GetDevicesSettingsResponseModel.fromJson(Map json) => + _$GetDevicesSettingsResponseModelFromJson(json); +} + +extension GetDevicesSettingsResponseModelMapper on GetDevicesSettingsResponseModel { + DeviceSettingsEntity toEntity() { + return DeviceSettingsEntity( + frequency: frequency, + frequencyHeartRate: frequencyHeartRate, + timezone: timezone, + pedometer: pedometer, + language: language, + alerts: alerts, + ); + } +} + +@freezed +abstract class GetDevicesFlagsResponseModel with _$GetDevicesFlagsResponseModel { + const factory GetDevicesFlagsResponseModel({ + required String isInOrOut, + required String geofenceId, + required bool isBatteryLow, + required bool isDisconnect, + }) = _GetDevicesFlagsResponseModel; + + factory GetDevicesFlagsResponseModel.fromJson(Map json) => + _$GetDevicesFlagsResponseModelFromJson(json); +} + +extension GetDevicesFlagsResponseModelMapper on GetDevicesFlagsResponseModel { + DeviceFlagsEntity toEntity() { + return DeviceFlagsEntity( + isInOrOut: isInOrOut, + geofenceId: geofenceId, + isBatteryLow: isBatteryLow, + isDisconnect: isDisconnect, + ); + } +} \ No newline at end of file diff --git a/modules/legacy/modules/hub/lib/src/core/data/models/get_devices_response_model.freezed.dart b/modules/legacy/modules/hub/lib/src/core/data/models/get_devices_response_model.freezed.dart index 1ad17056..2473d450 100644 --- a/modules/legacy/modules/hub/lib/src/core/data/models/get_devices_response_model.freezed.dart +++ b/modules/legacy/modules/hub/lib/src/core/data/models/get_devices_response_model.freezed.dart @@ -284,7 +284,7 @@ as List, /// @nodoc mixin _$GetDevicesItemResponseModel { - String get id; String get identificator; String get carrierName; + String get identificator; String get carrierName; String get phone; String get id; GetDevicesSettingsResponseModel get settings; String get protocol; String get type; String get connectionServer; int get createdAt; GetDevicesFlagsResponseModel get flags; /// Create a copy of GetDevicesItemResponseModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -297,16 +297,16 @@ $GetDevicesItemResponseModelCopyWith get copyWith = @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is GetDevicesItemResponseModel&&(identical(other.id, id) || other.id == id)&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is GetDevicesItemResponseModel&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.id, id) || other.id == id)&&(identical(other.settings, settings) || other.settings == settings)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.type, type) || other.type == type)&&(identical(other.connectionServer, connectionServer) || other.connectionServer == connectionServer)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.flags, flags) || other.flags == flags)); } @JsonKey(includeFromJson: false, includeToJson: false) @override -int get hashCode => Object.hash(runtimeType,id,identificator,carrierName); +int get hashCode => Object.hash(runtimeType,identificator,carrierName,phone,id,settings,protocol,type,connectionServer,createdAt,flags); @override String toString() { - return 'GetDevicesItemResponseModel(id: $id, identificator: $identificator, carrierName: $carrierName)'; + return 'GetDevicesItemResponseModel(identificator: $identificator, carrierName: $carrierName, phone: $phone, id: $id, settings: $settings, protocol: $protocol, type: $type, connectionServer: $connectionServer, createdAt: $createdAt, flags: $flags)'; } @@ -317,11 +317,11 @@ abstract mixin class $GetDevicesItemResponseModelCopyWith<$Res> { factory $GetDevicesItemResponseModelCopyWith(GetDevicesItemResponseModel value, $Res Function(GetDevicesItemResponseModel) _then) = _$GetDevicesItemResponseModelCopyWithImpl; @useResult $Res call({ - String id, String identificator, String carrierName + String identificator, String carrierName, String phone, String id, GetDevicesSettingsResponseModel settings, String protocol, String type, String connectionServer, int createdAt, GetDevicesFlagsResponseModel flags }); - +$GetDevicesSettingsResponseModelCopyWith<$Res> get settings;$GetDevicesFlagsResponseModelCopyWith<$Res> get flags; } /// @nodoc @@ -334,15 +334,40 @@ class _$GetDevicesItemResponseModelCopyWithImpl<$Res> /// Create a copy of GetDevicesItemResponseModel /// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? identificator = null,Object? carrierName = null,}) { +@pragma('vm:prefer-inline') @override $Res call({Object? identificator = null,Object? carrierName = null,Object? phone = null,Object? id = null,Object? settings = null,Object? protocol = null,Object? type = null,Object? connectionServer = null,Object? createdAt = null,Object? flags = null,}) { return _then(_self.copyWith( -id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as String,identificator: null == identificator ? _self.identificator : identificator // ignore: cast_nullable_to_non_nullable +identificator: null == identificator ? _self.identificator : identificator // ignore: cast_nullable_to_non_nullable as String,carrierName: null == carrierName ? _self.carrierName : carrierName // ignore: cast_nullable_to_non_nullable -as String, +as String,phone: null == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String,id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,settings: null == settings ? _self.settings : settings // ignore: cast_nullable_to_non_nullable +as GetDevicesSettingsResponseModel,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,connectionServer: null == connectionServer ? _self.connectionServer : connectionServer // ignore: cast_nullable_to_non_nullable +as String,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable +as int,flags: null == flags ? _self.flags : flags // ignore: cast_nullable_to_non_nullable +as GetDevicesFlagsResponseModel, )); } - +/// Create a copy of GetDevicesItemResponseModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GetDevicesSettingsResponseModelCopyWith<$Res> get settings { + + return $GetDevicesSettingsResponseModelCopyWith<$Res>(_self.settings, (value) { + return _then(_self.copyWith(settings: value)); + }); +}/// Create a copy of GetDevicesItemResponseModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GetDevicesFlagsResponseModelCopyWith<$Res> get flags { + + return $GetDevicesFlagsResponseModelCopyWith<$Res>(_self.flags, (value) { + return _then(_self.copyWith(flags: value)); + }); +} } @@ -424,10 +449,10 @@ return $default(_that);case _: /// } /// ``` -@optionalTypeArgs TResult maybeWhen(TResult Function( String id, String identificator, String carrierName)? $default,{required TResult orElse(),}) {final _that = this; +@optionalTypeArgs TResult maybeWhen(TResult Function( String identificator, String carrierName, String phone, String id, GetDevicesSettingsResponseModel settings, String protocol, String type, String connectionServer, int createdAt, GetDevicesFlagsResponseModel flags)? $default,{required TResult orElse(),}) {final _that = this; switch (_that) { case _GetDevicesItemResponseModel() when $default != null: -return $default(_that.id,_that.identificator,_that.carrierName);case _: +return $default(_that.identificator,_that.carrierName,_that.phone,_that.id,_that.settings,_that.protocol,_that.type,_that.connectionServer,_that.createdAt,_that.flags);case _: return orElse(); } @@ -445,10 +470,10 @@ return $default(_that.id,_that.identificator,_that.carrierName);case _: /// } /// ``` -@optionalTypeArgs TResult when(TResult Function( String id, String identificator, String carrierName) $default,) {final _that = this; +@optionalTypeArgs TResult when(TResult Function( String identificator, String carrierName, String phone, String id, GetDevicesSettingsResponseModel settings, String protocol, String type, String connectionServer, int createdAt, GetDevicesFlagsResponseModel flags) $default,) {final _that = this; switch (_that) { case _GetDevicesItemResponseModel(): -return $default(_that.id,_that.identificator,_that.carrierName);case _: +return $default(_that.identificator,_that.carrierName,_that.phone,_that.id,_that.settings,_that.protocol,_that.type,_that.connectionServer,_that.createdAt,_that.flags);case _: throw StateError('Unexpected subclass'); } @@ -465,10 +490,10 @@ return $default(_that.id,_that.identificator,_that.carrierName);case _: /// } /// ``` -@optionalTypeArgs TResult? whenOrNull(TResult? Function( String id, String identificator, String carrierName)? $default,) {final _that = this; +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String identificator, String carrierName, String phone, String id, GetDevicesSettingsResponseModel settings, String protocol, String type, String connectionServer, int createdAt, GetDevicesFlagsResponseModel flags)? $default,) {final _that = this; switch (_that) { case _GetDevicesItemResponseModel() when $default != null: -return $default(_that.id,_that.identificator,_that.carrierName);case _: +return $default(_that.identificator,_that.carrierName,_that.phone,_that.id,_that.settings,_that.protocol,_that.type,_that.connectionServer,_that.createdAt,_that.flags);case _: return null; } @@ -480,12 +505,19 @@ return $default(_that.id,_that.identificator,_that.carrierName);case _: @JsonSerializable() class _GetDevicesItemResponseModel implements GetDevicesItemResponseModel { - const _GetDevicesItemResponseModel({required this.id, required this.identificator, required this.carrierName}); + const _GetDevicesItemResponseModel({required this.identificator, required this.carrierName, required this.phone, required this.id, required this.settings, required this.protocol, required this.type, required this.connectionServer, required this.createdAt, required this.flags}); factory _GetDevicesItemResponseModel.fromJson(Map json) => _$GetDevicesItemResponseModelFromJson(json); -@override final String id; @override final String identificator; @override final String carrierName; +@override final String phone; +@override final String id; +@override final GetDevicesSettingsResponseModel settings; +@override final String protocol; +@override final String type; +@override final String connectionServer; +@override final int createdAt; +@override final GetDevicesFlagsResponseModel flags; /// Create a copy of GetDevicesItemResponseModel /// with the given fields replaced by the non-null parameter values. @@ -500,16 +532,16 @@ Map toJson() { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _GetDevicesItemResponseModel&&(identical(other.id, id) || other.id == id)&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is _GetDevicesItemResponseModel&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.id, id) || other.id == id)&&(identical(other.settings, settings) || other.settings == settings)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.type, type) || other.type == type)&&(identical(other.connectionServer, connectionServer) || other.connectionServer == connectionServer)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.flags, flags) || other.flags == flags)); } @JsonKey(includeFromJson: false, includeToJson: false) @override -int get hashCode => Object.hash(runtimeType,id,identificator,carrierName); +int get hashCode => Object.hash(runtimeType,identificator,carrierName,phone,id,settings,protocol,type,connectionServer,createdAt,flags); @override String toString() { - return 'GetDevicesItemResponseModel(id: $id, identificator: $identificator, carrierName: $carrierName)'; + return 'GetDevicesItemResponseModel(identificator: $identificator, carrierName: $carrierName, phone: $phone, id: $id, settings: $settings, protocol: $protocol, type: $type, connectionServer: $connectionServer, createdAt: $createdAt, flags: $flags)'; } @@ -520,11 +552,11 @@ abstract mixin class _$GetDevicesItemResponseModelCopyWith<$Res> implements $Get factory _$GetDevicesItemResponseModelCopyWith(_GetDevicesItemResponseModel value, $Res Function(_GetDevicesItemResponseModel) _then) = __$GetDevicesItemResponseModelCopyWithImpl; @override @useResult $Res call({ - String id, String identificator, String carrierName + String identificator, String carrierName, String phone, String id, GetDevicesSettingsResponseModel settings, String protocol, String type, String connectionServer, int createdAt, GetDevicesFlagsResponseModel flags }); - +@override $GetDevicesSettingsResponseModelCopyWith<$Res> get settings;@override $GetDevicesFlagsResponseModelCopyWith<$Res> get flags; } /// @nodoc @@ -537,12 +569,593 @@ class __$GetDevicesItemResponseModelCopyWithImpl<$Res> /// Create a copy of GetDevicesItemResponseModel /// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? identificator = null,Object? carrierName = null,}) { +@override @pragma('vm:prefer-inline') $Res call({Object? identificator = null,Object? carrierName = null,Object? phone = null,Object? id = null,Object? settings = null,Object? protocol = null,Object? type = null,Object? connectionServer = null,Object? createdAt = null,Object? flags = null,}) { return _then(_GetDevicesItemResponseModel( -id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as String,identificator: null == identificator ? _self.identificator : identificator // ignore: cast_nullable_to_non_nullable +identificator: null == identificator ? _self.identificator : identificator // ignore: cast_nullable_to_non_nullable as String,carrierName: null == carrierName ? _self.carrierName : carrierName // ignore: cast_nullable_to_non_nullable -as String, +as String,phone: null == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +as String,id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,settings: null == settings ? _self.settings : settings // ignore: cast_nullable_to_non_nullable +as GetDevicesSettingsResponseModel,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,connectionServer: null == connectionServer ? _self.connectionServer : connectionServer // ignore: cast_nullable_to_non_nullable +as String,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable +as int,flags: null == flags ? _self.flags : flags // ignore: cast_nullable_to_non_nullable +as GetDevicesFlagsResponseModel, + )); +} + +/// Create a copy of GetDevicesItemResponseModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GetDevicesSettingsResponseModelCopyWith<$Res> get settings { + + return $GetDevicesSettingsResponseModelCopyWith<$Res>(_self.settings, (value) { + return _then(_self.copyWith(settings: value)); + }); +}/// Create a copy of GetDevicesItemResponseModel +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$GetDevicesFlagsResponseModelCopyWith<$Res> get flags { + + return $GetDevicesFlagsResponseModelCopyWith<$Res>(_self.flags, (value) { + return _then(_self.copyWith(flags: value)); + }); +} +} + + +/// @nodoc +mixin _$GetDevicesSettingsResponseModel { + + int get frequency; int get frequencyHeartRate; int get timezone; bool get pedometer; String get language; List get alerts; +/// Create a copy of GetDevicesSettingsResponseModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$GetDevicesSettingsResponseModelCopyWith get copyWith => _$GetDevicesSettingsResponseModelCopyWithImpl(this as GetDevicesSettingsResponseModel, _$identity); + + /// Serializes this GetDevicesSettingsResponseModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is GetDevicesSettingsResponseModel&&(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)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(alerts)); + +@override +String toString() { + return 'GetDevicesSettingsResponseModel(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts)'; +} + + +} + +/// @nodoc +abstract mixin class $GetDevicesSettingsResponseModelCopyWith<$Res> { + factory $GetDevicesSettingsResponseModelCopyWith(GetDevicesSettingsResponseModel value, $Res Function(GetDevicesSettingsResponseModel) _then) = _$GetDevicesSettingsResponseModelCopyWithImpl; +@useResult +$Res call({ + int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List alerts +}); + + + + +} +/// @nodoc +class _$GetDevicesSettingsResponseModelCopyWithImpl<$Res> + implements $GetDevicesSettingsResponseModelCopyWith<$Res> { + _$GetDevicesSettingsResponseModelCopyWithImpl(this._self, this._then); + + final GetDevicesSettingsResponseModel _self; + final $Res Function(GetDevicesSettingsResponseModel) _then; + +/// Create a copy of GetDevicesSettingsResponseModel +/// 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,}) { + 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, + )); +} + +} + + +/// Adds pattern-matching-related methods to [GetDevicesSettingsResponseModel]. +extension GetDevicesSettingsResponseModelPatterns on GetDevicesSettingsResponseModel { +/// 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 Function( _GetDevicesSettingsResponseModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _GetDevicesSettingsResponseModel() 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 Function( _GetDevicesSettingsResponseModel value) $default,){ +final _that = this; +switch (_that) { +case _GetDevicesSettingsResponseModel(): +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? Function( _GetDevicesSettingsResponseModel value)? $default,){ +final _that = this; +switch (_that) { +case _GetDevicesSettingsResponseModel() 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 Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List alerts)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _GetDevicesSettingsResponseModel() when $default != null: +return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts);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 Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List alerts) $default,) {final _that = this; +switch (_that) { +case _GetDevicesSettingsResponseModel(): +return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts);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? Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List alerts)? $default,) {final _that = this; +switch (_that) { +case _GetDevicesSettingsResponseModel() when $default != null: +return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _GetDevicesSettingsResponseModel implements GetDevicesSettingsResponseModel { + const _GetDevicesSettingsResponseModel({required this.frequency, required this.frequencyHeartRate, required this.timezone, required this.pedometer, required this.language, required final List alerts}): _alerts = alerts; + factory _GetDevicesSettingsResponseModel.fromJson(Map json) => _$GetDevicesSettingsResponseModelFromJson(json); + +@override final int frequency; +@override final int frequencyHeartRate; +@override final int timezone; +@override final bool pedometer; +@override final String language; + final List _alerts; +@override List get alerts { + if (_alerts is EqualUnmodifiableListView) return _alerts; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_alerts); +} + + +/// Create a copy of GetDevicesSettingsResponseModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$GetDevicesSettingsResponseModelCopyWith<_GetDevicesSettingsResponseModel> get copyWith => __$GetDevicesSettingsResponseModelCopyWithImpl<_GetDevicesSettingsResponseModel>(this, _$identity); + +@override +Map toJson() { + return _$GetDevicesSettingsResponseModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _GetDevicesSettingsResponseModel&&(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)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(_alerts)); + +@override +String toString() { + return 'GetDevicesSettingsResponseModel(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts)'; +} + + +} + +/// @nodoc +abstract mixin class _$GetDevicesSettingsResponseModelCopyWith<$Res> implements $GetDevicesSettingsResponseModelCopyWith<$Res> { + factory _$GetDevicesSettingsResponseModelCopyWith(_GetDevicesSettingsResponseModel value, $Res Function(_GetDevicesSettingsResponseModel) _then) = __$GetDevicesSettingsResponseModelCopyWithImpl; +@override @useResult +$Res call({ + int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List alerts +}); + + + + +} +/// @nodoc +class __$GetDevicesSettingsResponseModelCopyWithImpl<$Res> + implements _$GetDevicesSettingsResponseModelCopyWith<$Res> { + __$GetDevicesSettingsResponseModelCopyWithImpl(this._self, this._then); + + final _GetDevicesSettingsResponseModel _self; + final $Res Function(_GetDevicesSettingsResponseModel) _then; + +/// Create a copy of GetDevicesSettingsResponseModel +/// 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,}) { + return _then(_GetDevicesSettingsResponseModel( +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, + )); +} + + +} + + +/// @nodoc +mixin _$GetDevicesFlagsResponseModel { + + String get isInOrOut; String get geofenceId; bool get isBatteryLow; bool get isDisconnect; +/// Create a copy of GetDevicesFlagsResponseModel +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$GetDevicesFlagsResponseModelCopyWith get copyWith => _$GetDevicesFlagsResponseModelCopyWithImpl(this as GetDevicesFlagsResponseModel, _$identity); + + /// Serializes this GetDevicesFlagsResponseModel to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is GetDevicesFlagsResponseModel&&(identical(other.isInOrOut, isInOrOut) || other.isInOrOut == isInOrOut)&&(identical(other.geofenceId, geofenceId) || other.geofenceId == geofenceId)&&(identical(other.isBatteryLow, isBatteryLow) || other.isBatteryLow == isBatteryLow)&&(identical(other.isDisconnect, isDisconnect) || other.isDisconnect == isDisconnect)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,isInOrOut,geofenceId,isBatteryLow,isDisconnect); + +@override +String toString() { + return 'GetDevicesFlagsResponseModel(isInOrOut: $isInOrOut, geofenceId: $geofenceId, isBatteryLow: $isBatteryLow, isDisconnect: $isDisconnect)'; +} + + +} + +/// @nodoc +abstract mixin class $GetDevicesFlagsResponseModelCopyWith<$Res> { + factory $GetDevicesFlagsResponseModelCopyWith(GetDevicesFlagsResponseModel value, $Res Function(GetDevicesFlagsResponseModel) _then) = _$GetDevicesFlagsResponseModelCopyWithImpl; +@useResult +$Res call({ + String isInOrOut, String geofenceId, bool isBatteryLow, bool isDisconnect +}); + + + + +} +/// @nodoc +class _$GetDevicesFlagsResponseModelCopyWithImpl<$Res> + implements $GetDevicesFlagsResponseModelCopyWith<$Res> { + _$GetDevicesFlagsResponseModelCopyWithImpl(this._self, this._then); + + final GetDevicesFlagsResponseModel _self; + final $Res Function(GetDevicesFlagsResponseModel) _then; + +/// Create a copy of GetDevicesFlagsResponseModel +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? isInOrOut = null,Object? geofenceId = null,Object? isBatteryLow = null,Object? isDisconnect = null,}) { + return _then(_self.copyWith( +isInOrOut: null == isInOrOut ? _self.isInOrOut : isInOrOut // ignore: cast_nullable_to_non_nullable +as String,geofenceId: null == geofenceId ? _self.geofenceId : geofenceId // ignore: cast_nullable_to_non_nullable +as String,isBatteryLow: null == isBatteryLow ? _self.isBatteryLow : isBatteryLow // ignore: cast_nullable_to_non_nullable +as bool,isDisconnect: null == isDisconnect ? _self.isDisconnect : isDisconnect // ignore: cast_nullable_to_non_nullable +as bool, + )); +} + +} + + +/// Adds pattern-matching-related methods to [GetDevicesFlagsResponseModel]. +extension GetDevicesFlagsResponseModelPatterns on GetDevicesFlagsResponseModel { +/// 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 Function( _GetDevicesFlagsResponseModel value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _GetDevicesFlagsResponseModel() 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 Function( _GetDevicesFlagsResponseModel value) $default,){ +final _that = this; +switch (_that) { +case _GetDevicesFlagsResponseModel(): +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? Function( _GetDevicesFlagsResponseModel value)? $default,){ +final _that = this; +switch (_that) { +case _GetDevicesFlagsResponseModel() 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 Function( String isInOrOut, String geofenceId, bool isBatteryLow, bool isDisconnect)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _GetDevicesFlagsResponseModel() when $default != null: +return $default(_that.isInOrOut,_that.geofenceId,_that.isBatteryLow,_that.isDisconnect);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 Function( String isInOrOut, String geofenceId, bool isBatteryLow, bool isDisconnect) $default,) {final _that = this; +switch (_that) { +case _GetDevicesFlagsResponseModel(): +return $default(_that.isInOrOut,_that.geofenceId,_that.isBatteryLow,_that.isDisconnect);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? Function( String isInOrOut, String geofenceId, bool isBatteryLow, bool isDisconnect)? $default,) {final _that = this; +switch (_that) { +case _GetDevicesFlagsResponseModel() when $default != null: +return $default(_that.isInOrOut,_that.geofenceId,_that.isBatteryLow,_that.isDisconnect);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _GetDevicesFlagsResponseModel implements GetDevicesFlagsResponseModel { + const _GetDevicesFlagsResponseModel({required this.isInOrOut, required this.geofenceId, required this.isBatteryLow, required this.isDisconnect}); + factory _GetDevicesFlagsResponseModel.fromJson(Map json) => _$GetDevicesFlagsResponseModelFromJson(json); + +@override final String isInOrOut; +@override final String geofenceId; +@override final bool isBatteryLow; +@override final bool isDisconnect; + +/// Create a copy of GetDevicesFlagsResponseModel +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$GetDevicesFlagsResponseModelCopyWith<_GetDevicesFlagsResponseModel> get copyWith => __$GetDevicesFlagsResponseModelCopyWithImpl<_GetDevicesFlagsResponseModel>(this, _$identity); + +@override +Map toJson() { + return _$GetDevicesFlagsResponseModelToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _GetDevicesFlagsResponseModel&&(identical(other.isInOrOut, isInOrOut) || other.isInOrOut == isInOrOut)&&(identical(other.geofenceId, geofenceId) || other.geofenceId == geofenceId)&&(identical(other.isBatteryLow, isBatteryLow) || other.isBatteryLow == isBatteryLow)&&(identical(other.isDisconnect, isDisconnect) || other.isDisconnect == isDisconnect)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,isInOrOut,geofenceId,isBatteryLow,isDisconnect); + +@override +String toString() { + return 'GetDevicesFlagsResponseModel(isInOrOut: $isInOrOut, geofenceId: $geofenceId, isBatteryLow: $isBatteryLow, isDisconnect: $isDisconnect)'; +} + + +} + +/// @nodoc +abstract mixin class _$GetDevicesFlagsResponseModelCopyWith<$Res> implements $GetDevicesFlagsResponseModelCopyWith<$Res> { + factory _$GetDevicesFlagsResponseModelCopyWith(_GetDevicesFlagsResponseModel value, $Res Function(_GetDevicesFlagsResponseModel) _then) = __$GetDevicesFlagsResponseModelCopyWithImpl; +@override @useResult +$Res call({ + String isInOrOut, String geofenceId, bool isBatteryLow, bool isDisconnect +}); + + + + +} +/// @nodoc +class __$GetDevicesFlagsResponseModelCopyWithImpl<$Res> + implements _$GetDevicesFlagsResponseModelCopyWith<$Res> { + __$GetDevicesFlagsResponseModelCopyWithImpl(this._self, this._then); + + final _GetDevicesFlagsResponseModel _self; + final $Res Function(_GetDevicesFlagsResponseModel) _then; + +/// Create a copy of GetDevicesFlagsResponseModel +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? isInOrOut = null,Object? geofenceId = null,Object? isBatteryLow = null,Object? isDisconnect = null,}) { + return _then(_GetDevicesFlagsResponseModel( +isInOrOut: null == isInOrOut ? _self.isInOrOut : isInOrOut // ignore: cast_nullable_to_non_nullable +as String,geofenceId: null == geofenceId ? _self.geofenceId : geofenceId // ignore: cast_nullable_to_non_nullable +as String,isBatteryLow: null == isBatteryLow ? _self.isBatteryLow : isBatteryLow // ignore: cast_nullable_to_non_nullable +as bool,isDisconnect: null == isDisconnect ? _self.isDisconnect : isDisconnect // ignore: cast_nullable_to_non_nullable +as bool, )); } diff --git a/modules/legacy/modules/hub/lib/src/core/data/models/get_devices_response_model.g.dart b/modules/legacy/modules/hub/lib/src/core/data/models/get_devices_response_model.g.dart index e6927c90..258ecfad 100644 --- a/modules/legacy/modules/hub/lib/src/core/data/models/get_devices_response_model.g.dart +++ b/modules/legacy/modules/hub/lib/src/core/data/models/get_devices_response_model.g.dart @@ -23,15 +23,73 @@ Map _$GetDevicesResponseModelToJson( _GetDevicesItemResponseModel _$GetDevicesItemResponseModelFromJson( Map json, ) => _GetDevicesItemResponseModel( - id: json['id'] as String, identificator: json['identificator'] as String, carrierName: json['carrierName'] as String, + phone: json['phone'] as String, + id: json['id'] as String, + settings: GetDevicesSettingsResponseModel.fromJson( + json['settings'] as Map, + ), + protocol: json['protocol'] as String, + type: json['type'] as String, + connectionServer: json['connectionServer'] as String, + createdAt: (json['createdAt'] as num).toInt(), + flags: GetDevicesFlagsResponseModel.fromJson( + json['flags'] as Map, + ), ); Map _$GetDevicesItemResponseModelToJson( _GetDevicesItemResponseModel instance, ) => { - 'id': instance.id, 'identificator': instance.identificator, 'carrierName': instance.carrierName, + 'phone': instance.phone, + 'id': instance.id, + 'settings': instance.settings, + 'protocol': instance.protocol, + 'type': instance.type, + 'connectionServer': instance.connectionServer, + 'createdAt': instance.createdAt, + 'flags': instance.flags, +}; + +_GetDevicesSettingsResponseModel _$GetDevicesSettingsResponseModelFromJson( + Map json, +) => _GetDevicesSettingsResponseModel( + frequency: (json['frequency'] as num).toInt(), + frequencyHeartRate: (json['frequencyHeartRate'] as num).toInt(), + timezone: (json['timezone'] as num).toInt(), + pedometer: json['pedometer'] as bool, + language: json['language'] as String, + alerts: (json['alerts'] as List).map((e) => e as String).toList(), +); + +Map _$GetDevicesSettingsResponseModelToJson( + _GetDevicesSettingsResponseModel instance, +) => { + 'frequency': instance.frequency, + 'frequencyHeartRate': instance.frequencyHeartRate, + 'timezone': instance.timezone, + 'pedometer': instance.pedometer, + 'language': instance.language, + 'alerts': instance.alerts, +}; + +_GetDevicesFlagsResponseModel _$GetDevicesFlagsResponseModelFromJson( + Map json, +) => _GetDevicesFlagsResponseModel( + isInOrOut: json['isInOrOut'] as String, + geofenceId: json['geofenceId'] as String, + isBatteryLow: json['isBatteryLow'] as bool, + isDisconnect: json['isDisconnect'] as bool, +); + +Map _$GetDevicesFlagsResponseModelToJson( + _GetDevicesFlagsResponseModel instance, +) => { + 'isInOrOut': instance.isInOrOut, + 'geofenceId': instance.geofenceId, + 'isBatteryLow': instance.isBatteryLow, + 'isDisconnect': instance.isDisconnect, }; diff --git a/modules/legacy/modules/hub/lib/src/core/data/repositories/hub_repository_impl.dart b/modules/legacy/modules/hub/lib/src/core/data/repositories/hub_repository_impl.dart index 90e10058..4dbb96d2 100644 --- a/modules/legacy/modules/hub/lib/src/core/data/repositories/hub_repository_impl.dart +++ b/modules/legacy/modules/hub/lib/src/core/data/repositories/hub_repository_impl.dart @@ -1,8 +1,7 @@ import 'package:hub/src/core/data/datasource/hub_remote_datasource.dart'; import 'package:hub/src/core/domain/repositories/hub_repository.dart'; -import 'package:hub/src/features/hub/domain/entities/device_entity.dart'; -import 'package:hub/src/features/hub/domain/entities/get_devices_request_entity.dart'; import 'package:hub/src/features/hub/domain/entities/position_entity.dart'; +import 'package:legacy_shared/legacy_shared.dart'; class HomeRepositoryImpl implements HomeRepository { const HomeRepositoryImpl(this._remote); diff --git a/modules/legacy/modules/hub/lib/src/core/domain/repositories/hub_repository.dart b/modules/legacy/modules/hub/lib/src/core/domain/repositories/hub_repository.dart index ad163bef..f0eff890 100644 --- a/modules/legacy/modules/hub/lib/src/core/domain/repositories/hub_repository.dart +++ b/modules/legacy/modules/hub/lib/src/core/domain/repositories/hub_repository.dart @@ -1,6 +1,5 @@ -import 'package:hub/src/features/hub/domain/entities/device_entity.dart'; -import 'package:hub/src/features/hub/domain/entities/get_devices_request_entity.dart'; import 'package:hub/src/features/hub/domain/entities/position_entity.dart'; +import 'package:legacy_shared/legacy_shared.dart'; abstract class HomeRepository { Future> getDevices({required String userId}); diff --git a/modules/legacy/modules/hub/lib/src/features/hub/domain/entities/device_entity.dart b/modules/legacy/modules/hub/lib/src/features/hub/domain/entities/device_entity.dart deleted file mode 100644 index 23334861..00000000 --- a/modules/legacy/modules/hub/lib/src/features/hub/domain/entities/device_entity.dart +++ /dev/null @@ -1,11 +0,0 @@ -class DeviceEntity { - final String id; - final String identificator; - final String carrierName; - - const DeviceEntity({ - required this.id, - required this.identificator, - required this.carrierName, - }); -} \ No newline at end of file diff --git a/modules/legacy/modules/hub/lib/src/features/hub/domain/get_devices_use_case.dart b/modules/legacy/modules/hub/lib/src/features/hub/domain/get_devices_use_case.dart index 2647cb60..aa5d3efd 100644 --- a/modules/legacy/modules/hub/lib/src/features/hub/domain/get_devices_use_case.dart +++ b/modules/legacy/modules/hub/lib/src/features/hub/domain/get_devices_use_case.dart @@ -1,4 +1,4 @@ -import 'package:hub/src/features/hub/domain/entities/device_entity.dart'; +import 'package:legacy_shared/legacy_shared.dart'; abstract class GetDevicesUseCase { Future> getDevices({required String userId}); diff --git a/modules/legacy/modules/hub/lib/src/features/hub/domain/get_devices_use_case_impl.dart b/modules/legacy/modules/hub/lib/src/features/hub/domain/get_devices_use_case_impl.dart index a5e8c62c..e7877039 100644 --- a/modules/legacy/modules/hub/lib/src/features/hub/domain/get_devices_use_case_impl.dart +++ b/modules/legacy/modules/hub/lib/src/features/hub/domain/get_devices_use_case_impl.dart @@ -1,7 +1,6 @@ import 'package:hub/src/core/domain/repositories/hub_repository.dart'; -import 'package:hub/src/features/hub/domain/entities/device_entity.dart'; -import 'package:hub/src/features/hub/domain/entities/get_devices_request_entity.dart'; import 'package:hub/src/features/hub/domain/get_devices_use_case.dart'; +import 'package:legacy_shared/legacy_shared.dart'; class GetDevicesUseCaseImpl implements GetDevicesUseCase { GetDevicesUseCaseImpl(this._repository); diff --git a/modules/legacy/modules/hub/lib/src/features/hub/presentation/hub_screen.dart b/modules/legacy/modules/hub/lib/src/features/hub/presentation/hub_screen.dart index 9efd7f0c..238b13e4 100644 --- a/modules/legacy/modules/hub/lib/src/features/hub/presentation/hub_screen.dart +++ b/modules/legacy/modules/hub/lib/src/features/hub/presentation/hub_screen.dart @@ -6,6 +6,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_map/flutter_map.dart'; import 'package:latlong2/latlong.dart'; +import 'package:legacy_shared/legacy_shared.dart'; import 'package:navigation/navigation.dart'; import 'package:sf_localizations/sf_localizations.dart'; import 'package:utils/utils.dart'; @@ -49,7 +50,7 @@ class HubScreen extends ConsumerWidget { width: SizeUtils.getByScreen(small: 104, big: 100), height: 32, child: CustomDropdown( - items: viewState.devices.map((device)=> + items: viewState.devices.map((DeviceEntity device)=> Text(device.carrierName) ).toList(), values: viewState.devices, diff --git a/modules/legacy/modules/hub/lib/src/features/hub/presentation/state/hub_view_model.dart b/modules/legacy/modules/hub/lib/src/features/hub/presentation/state/hub_view_model.dart index 2473a0f7..e25e8be4 100644 --- a/modules/legacy/modules/hub/lib/src/features/hub/presentation/state/hub_view_model.dart +++ b/modules/legacy/modules/hub/lib/src/features/hub/presentation/state/hub_view_model.dart @@ -1,13 +1,13 @@ import 'dart:async'; import 'package:flutter_map/flutter_map.dart'; -import 'package:hub/src/features/hub/domain/entities/device_entity.dart'; import 'package:hub/src/features/hub/domain/entities/position_entity.dart'; import 'package:hub/src/features/hub/domain/get_devices_use_case.dart'; import 'package:hub/src/features/hub/domain/get_latest_positions_use_case.dart'; import 'package:hub/src/features/hub/presentation/providers/get_devices_use_case_provider.dart'; import 'package:hub/src/features/hub/presentation/providers/get_latest_positions_use_case_provider.dart'; import 'package:hub/src/features/hub/presentation/state/hub_view_state.dart'; +import 'package:legacy_shared/legacy_shared.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:latlong2/latlong.dart'; @@ -20,6 +20,8 @@ class HubViewModel extends Notifier { late final GetDevicesUseCase _getDevicesUseCase; late final GetLatestPositionsUseCase _getLatestPositionsUseCase; + late final SelectedDeviceNotifier selectedDeviceNotifier; + late final MapController mapController; @override @@ -27,11 +29,17 @@ class HubViewModel extends Notifier { _getDevicesUseCase = ref.read(getDevicesUseCaseProvider); _getLatestPositionsUseCase = ref.read(getLatestPositionsUseCaseProvider); + selectedDeviceNotifier = ref.read(selectedDeviceProvider.notifier); + mapController = MapControllerImpl(); - _getDevicesUseCase.getDevices( - userId: '' - ).then((List res){ + ref.read(loggedUserProvider.future) + .then((loggedUser) { + state = state.copyWith(loggedUser: loggedUser); + return _getDevicesUseCase.getDevices( + userId: loggedUser.id + ); + }).then((List res){ state = state.copyWith( devices: res, selectedDevice: res.first @@ -75,6 +83,8 @@ class HubViewModel extends Notifier { selectedDevice: device, selectedPosition: selectedPosition, ); + + selectedDeviceNotifier.setSelectedDevice(device); } void disposeControllers(){ diff --git a/modules/legacy/modules/hub/lib/src/features/hub/presentation/state/hub_view_state.dart b/modules/legacy/modules/hub/lib/src/features/hub/presentation/state/hub_view_state.dart index d19035f7..02abd604 100644 --- a/modules/legacy/modules/hub/lib/src/features/hub/presentation/state/hub_view_state.dart +++ b/modules/legacy/modules/hub/lib/src/features/hub/presentation/state/hub_view_state.dart @@ -1,12 +1,13 @@ -import 'package:hub/src/features/hub/domain/entities/device_entity.dart'; import 'package:hub/src/features/hub/domain/entities/position_entity.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:legacy_shared/legacy_shared.dart'; part 'hub_view_state.freezed.dart'; @freezed abstract class HubViewState with _$HubViewState { const factory HubViewState({ + UserEntity? loggedUser, @Default([]) List devices, DeviceEntity? selectedDevice, @Default([]) List positions, diff --git a/modules/legacy/modules/hub/lib/src/features/hub/presentation/state/hub_view_state.freezed.dart b/modules/legacy/modules/hub/lib/src/features/hub/presentation/state/hub_view_state.freezed.dart index 92221d5c..578f4431 100644 --- a/modules/legacy/modules/hub/lib/src/features/hub/presentation/state/hub_view_state.freezed.dart +++ b/modules/legacy/modules/hub/lib/src/features/hub/presentation/state/hub_view_state.freezed.dart @@ -14,7 +14,7 @@ T _$identity(T value) => value; /// @nodoc mixin _$HubViewState { - List get devices; DeviceEntity? get selectedDevice; List get positions; PositionEntity? get selectedPosition; + UserEntity? get loggedUser; List get devices; DeviceEntity? get selectedDevice; List get positions; PositionEntity? get selectedPosition; /// Create a copy of HubViewState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -25,16 +25,16 @@ $HubViewStateCopyWith get copyWith => _$HubViewStateCopyWithImpl Object.hash(runtimeType,const DeepCollectionEquality().hash(devices),selectedDevice,const DeepCollectionEquality().hash(positions),selectedPosition); +int get hashCode => Object.hash(runtimeType,loggedUser,const DeepCollectionEquality().hash(devices),selectedDevice,const DeepCollectionEquality().hash(positions),selectedPosition); @override String toString() { - return 'HubViewState(devices: $devices, selectedDevice: $selectedDevice, positions: $positions, selectedPosition: $selectedPosition)'; + return 'HubViewState(loggedUser: $loggedUser, devices: $devices, selectedDevice: $selectedDevice, positions: $positions, selectedPosition: $selectedPosition)'; } @@ -45,11 +45,11 @@ abstract mixin class $HubViewStateCopyWith<$Res> { factory $HubViewStateCopyWith(HubViewState value, $Res Function(HubViewState) _then) = _$HubViewStateCopyWithImpl; @useResult $Res call({ - List devices, DeviceEntity? selectedDevice, List positions, PositionEntity? selectedPosition + UserEntity? loggedUser, List devices, DeviceEntity? selectedDevice, List positions, PositionEntity? selectedPosition }); -$PositionEntityCopyWith<$Res>? get selectedPosition; +$UserEntityCopyWith<$Res>? get loggedUser;$DeviceEntityCopyWith<$Res>? get selectedDevice;$PositionEntityCopyWith<$Res>? get selectedPosition; } /// @nodoc @@ -62,9 +62,10 @@ class _$HubViewStateCopyWithImpl<$Res> /// Create a copy of HubViewState /// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? devices = null,Object? selectedDevice = freezed,Object? positions = null,Object? selectedPosition = freezed,}) { +@pragma('vm:prefer-inline') @override $Res call({Object? loggedUser = freezed,Object? devices = null,Object? selectedDevice = freezed,Object? positions = null,Object? selectedPosition = freezed,}) { return _then(_self.copyWith( -devices: null == devices ? _self.devices : devices // ignore: cast_nullable_to_non_nullable +loggedUser: freezed == loggedUser ? _self.loggedUser : loggedUser // ignore: cast_nullable_to_non_nullable +as UserEntity?,devices: null == devices ? _self.devices : devices // ignore: cast_nullable_to_non_nullable as List,selectedDevice: freezed == selectedDevice ? _self.selectedDevice : selectedDevice // ignore: cast_nullable_to_non_nullable as DeviceEntity?,positions: null == positions ? _self.positions : positions // ignore: cast_nullable_to_non_nullable as List,selectedPosition: freezed == selectedPosition ? _self.selectedPosition : selectedPosition // ignore: cast_nullable_to_non_nullable @@ -75,6 +76,30 @@ as PositionEntity?, /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') +$UserEntityCopyWith<$Res>? get loggedUser { + if (_self.loggedUser == null) { + return null; + } + + return $UserEntityCopyWith<$Res>(_self.loggedUser!, (value) { + return _then(_self.copyWith(loggedUser: value)); + }); +}/// Create a copy of HubViewState +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$DeviceEntityCopyWith<$Res>? get selectedDevice { + if (_self.selectedDevice == null) { + return null; + } + + return $DeviceEntityCopyWith<$Res>(_self.selectedDevice!, (value) { + return _then(_self.copyWith(selectedDevice: value)); + }); +}/// Create a copy of HubViewState +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') $PositionEntityCopyWith<$Res>? get selectedPosition { if (_self.selectedPosition == null) { return null; @@ -165,10 +190,10 @@ return $default(_that);case _: /// } /// ``` -@optionalTypeArgs TResult maybeWhen(TResult Function( List devices, DeviceEntity? selectedDevice, List positions, PositionEntity? selectedPosition)? $default,{required TResult orElse(),}) {final _that = this; +@optionalTypeArgs TResult maybeWhen(TResult Function( UserEntity? loggedUser, List devices, DeviceEntity? selectedDevice, List positions, PositionEntity? selectedPosition)? $default,{required TResult orElse(),}) {final _that = this; switch (_that) { case _HubViewState() when $default != null: -return $default(_that.devices,_that.selectedDevice,_that.positions,_that.selectedPosition);case _: +return $default(_that.loggedUser,_that.devices,_that.selectedDevice,_that.positions,_that.selectedPosition);case _: return orElse(); } @@ -186,10 +211,10 @@ return $default(_that.devices,_that.selectedDevice,_that.positions,_that.selecte /// } /// ``` -@optionalTypeArgs TResult when(TResult Function( List devices, DeviceEntity? selectedDevice, List positions, PositionEntity? selectedPosition) $default,) {final _that = this; +@optionalTypeArgs TResult when(TResult Function( UserEntity? loggedUser, List devices, DeviceEntity? selectedDevice, List positions, PositionEntity? selectedPosition) $default,) {final _that = this; switch (_that) { case _HubViewState(): -return $default(_that.devices,_that.selectedDevice,_that.positions,_that.selectedPosition);case _: +return $default(_that.loggedUser,_that.devices,_that.selectedDevice,_that.positions,_that.selectedPosition);case _: throw StateError('Unexpected subclass'); } @@ -206,10 +231,10 @@ return $default(_that.devices,_that.selectedDevice,_that.positions,_that.selecte /// } /// ``` -@optionalTypeArgs TResult? whenOrNull(TResult? Function( List devices, DeviceEntity? selectedDevice, List positions, PositionEntity? selectedPosition)? $default,) {final _that = this; +@optionalTypeArgs TResult? whenOrNull(TResult? Function( UserEntity? loggedUser, List devices, DeviceEntity? selectedDevice, List positions, PositionEntity? selectedPosition)? $default,) {final _that = this; switch (_that) { case _HubViewState() when $default != null: -return $default(_that.devices,_that.selectedDevice,_that.positions,_that.selectedPosition);case _: +return $default(_that.loggedUser,_that.devices,_that.selectedDevice,_that.positions,_that.selectedPosition);case _: return null; } @@ -221,9 +246,10 @@ return $default(_that.devices,_that.selectedDevice,_that.positions,_that.selecte class _HubViewState implements HubViewState { - const _HubViewState({final List devices = const [], this.selectedDevice, final List positions = const [], this.selectedPosition}): _devices = devices,_positions = positions; + const _HubViewState({this.loggedUser, final List devices = const [], this.selectedDevice, final List positions = const [], this.selectedPosition}): _devices = devices,_positions = positions; +@override final UserEntity? loggedUser; final List _devices; @override@JsonKey() List get devices { if (_devices is EqualUnmodifiableListView) return _devices; @@ -251,16 +277,16 @@ _$HubViewStateCopyWith<_HubViewState> get copyWith => __$HubViewStateCopyWithImp @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _HubViewState&&const DeepCollectionEquality().equals(other._devices, _devices)&&(identical(other.selectedDevice, selectedDevice) || other.selectedDevice == selectedDevice)&&const DeepCollectionEquality().equals(other._positions, _positions)&&(identical(other.selectedPosition, selectedPosition) || other.selectedPosition == selectedPosition)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is _HubViewState&&(identical(other.loggedUser, loggedUser) || other.loggedUser == loggedUser)&&const DeepCollectionEquality().equals(other._devices, _devices)&&(identical(other.selectedDevice, selectedDevice) || other.selectedDevice == selectedDevice)&&const DeepCollectionEquality().equals(other._positions, _positions)&&(identical(other.selectedPosition, selectedPosition) || other.selectedPosition == selectedPosition)); } @override -int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_devices),selectedDevice,const DeepCollectionEquality().hash(_positions),selectedPosition); +int get hashCode => Object.hash(runtimeType,loggedUser,const DeepCollectionEquality().hash(_devices),selectedDevice,const DeepCollectionEquality().hash(_positions),selectedPosition); @override String toString() { - return 'HubViewState(devices: $devices, selectedDevice: $selectedDevice, positions: $positions, selectedPosition: $selectedPosition)'; + return 'HubViewState(loggedUser: $loggedUser, devices: $devices, selectedDevice: $selectedDevice, positions: $positions, selectedPosition: $selectedPosition)'; } @@ -271,11 +297,11 @@ abstract mixin class _$HubViewStateCopyWith<$Res> implements $HubViewStateCopyWi factory _$HubViewStateCopyWith(_HubViewState value, $Res Function(_HubViewState) _then) = __$HubViewStateCopyWithImpl; @override @useResult $Res call({ - List devices, DeviceEntity? selectedDevice, List positions, PositionEntity? selectedPosition + UserEntity? loggedUser, List devices, DeviceEntity? selectedDevice, List positions, PositionEntity? selectedPosition }); -@override $PositionEntityCopyWith<$Res>? get selectedPosition; +@override $UserEntityCopyWith<$Res>? get loggedUser;@override $DeviceEntityCopyWith<$Res>? get selectedDevice;@override $PositionEntityCopyWith<$Res>? get selectedPosition; } /// @nodoc @@ -288,9 +314,10 @@ class __$HubViewStateCopyWithImpl<$Res> /// Create a copy of HubViewState /// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? devices = null,Object? selectedDevice = freezed,Object? positions = null,Object? selectedPosition = freezed,}) { +@override @pragma('vm:prefer-inline') $Res call({Object? loggedUser = freezed,Object? devices = null,Object? selectedDevice = freezed,Object? positions = null,Object? selectedPosition = freezed,}) { return _then(_HubViewState( -devices: null == devices ? _self._devices : devices // ignore: cast_nullable_to_non_nullable +loggedUser: freezed == loggedUser ? _self.loggedUser : loggedUser // ignore: cast_nullable_to_non_nullable +as UserEntity?,devices: null == devices ? _self._devices : devices // ignore: cast_nullable_to_non_nullable as List,selectedDevice: freezed == selectedDevice ? _self.selectedDevice : selectedDevice // ignore: cast_nullable_to_non_nullable as DeviceEntity?,positions: null == positions ? _self._positions : positions // ignore: cast_nullable_to_non_nullable as List,selectedPosition: freezed == selectedPosition ? _self.selectedPosition : selectedPosition // ignore: cast_nullable_to_non_nullable @@ -302,6 +329,30 @@ as PositionEntity?, /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') +$UserEntityCopyWith<$Res>? get loggedUser { + if (_self.loggedUser == null) { + return null; + } + + return $UserEntityCopyWith<$Res>(_self.loggedUser!, (value) { + return _then(_self.copyWith(loggedUser: value)); + }); +}/// Create a copy of HubViewState +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$DeviceEntityCopyWith<$Res>? get selectedDevice { + if (_self.selectedDevice == null) { + return null; + } + + return $DeviceEntityCopyWith<$Res>(_self.selectedDevice!, (value) { + return _then(_self.copyWith(selectedDevice: value)); + }); +}/// Create a copy of HubViewState +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') $PositionEntityCopyWith<$Res>? get selectedPosition { if (_self.selectedPosition == null) { return null; diff --git a/modules/legacy/modules/hub/pubspec.lock b/modules/legacy/modules/hub/pubspec.lock index 636f3de1..16307937 100644 --- a/modules/legacy/modules/hub/pubspec.lock +++ b/modules/legacy/modules/hub/pubspec.lock @@ -422,7 +422,7 @@ packages: source: sdk version: "0.0.0" fonts: - dependency: "direct main" + dependency: "direct overridden" description: path: "../../../../packages/fonts" relative: true @@ -595,6 +595,13 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.2" + legacy_shared: + dependency: "direct main" + description: + path: "../../packages/legacy_shared" + relative: true + source: path + version: "0.0.1" lints: dependency: transitive description: diff --git a/modules/legacy/modules/hub/pubspec.yaml b/modules/legacy/modules/hub/pubspec.yaml index aa7ceb59..b1c41d9d 100644 --- a/modules/legacy/modules/hub/pubspec.yaml +++ b/modules/legacy/modules/hub/pubspec.yaml @@ -45,8 +45,8 @@ dependencies: path: ../../../../packages/sf_infrastructure utils: path: ../../../../packages/utils - fonts: - path: ../../../../packages/fonts + legacy_shared: + path: ../../packages/legacy_shared #dependencies go here flutter_svg: ^2.2.1 get_it: ^9.0.5 diff --git a/modules/legacy/modules/hub/pubspec_overrides.yaml b/modules/legacy/modules/hub/pubspec_overrides.yaml index cf91bc8a..04ccd0da 100644 --- a/modules/legacy/modules/hub/pubspec_overrides.yaml +++ b/modules/legacy/modules/hub/pubspec_overrides.yaml @@ -1,3 +1,4 @@ +# melos_managed_dependency_overrides: legacy_shared # melos_managed_dependency_overrides: design_system,fonts,navigation,sf_infrastructure,sf_localizations,utils,auth,dashboard_shell,home,notifications,sf_shared,profile dependency_overrides: auth: @@ -10,6 +11,8 @@ dependency_overrides: path: ..\\..\\..\\..\\packages\\fonts home: path: ..\\..\\..\\home + legacy_shared: + path: ..\\..\\packages\\legacy_shared navigation: path: ..\\..\\..\\..\\packages\\navigation notifications: diff --git a/modules/legacy/modules/legacy_dashboard_shell/pubspec_overrides.yaml b/modules/legacy/modules/legacy_dashboard_shell/pubspec_overrides.yaml index fef6dac5..62159a3e 100644 --- a/modules/legacy/modules/legacy_dashboard_shell/pubspec_overrides.yaml +++ b/modules/legacy/modules/legacy_dashboard_shell/pubspec_overrides.yaml @@ -1,3 +1,4 @@ +# melos_managed_dependency_overrides: legacy_shared # melos_managed_dependency_overrides: auth,design_system,fonts,home,navigation,notifications,sf_infrastructure,sf_localizations,sf_shared,utils,dashboard_shell,hub,profile dependency_overrides: auth: @@ -12,6 +13,8 @@ dependency_overrides: path: ..\\..\\..\\home hub: path: ..\\hub + legacy_shared: + path: ..\\..\\packages\\legacy_shared navigation: path: ..\\..\\..\\..\\packages\\navigation notifications: diff --git a/modules/legacy/packages/legacy_shared/lib/src/data/models/entities/device_entity.dart b/modules/legacy/packages/legacy_shared/lib/src/data/models/entities/device_entity.dart new file mode 100644 index 00000000..d7dddaa1 --- /dev/null +++ b/modules/legacy/packages/legacy_shared/lib/src/data/models/entities/device_entity.dart @@ -0,0 +1,123 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'device_entity.freezed.dart'; + +@freezed +abstract class DeviceEntity with _$DeviceEntity { + const factory DeviceEntity({ + required String id, + required String identificator, + int? battery, + String? userId, + String? companyId, + String? delegationId, + String? groupId, + required DeviceFlagsEntity flags, + List? tags, + int? lastConnection, + String? carrierGenre, + int? carrierBirthday, + int? carrierWeight, + int? carrierStepLength, + required String carrierName, + String? comment, + String? phone, + String? simId, + String? simStatus, + DevicePaymentOptionsEntity? paymentOptions, + required DeviceSettingsEntity settings, + required String protocol, + required String type, + required String connectionServer, + DeviceCapabilitiesEntity? capabilities, + required int createdAt, + int? updatedAt, + }) = _DeviceEntity; +} + +@freezed +abstract class DeviceFlagsEntity with _$DeviceFlagsEntity{ + const factory DeviceFlagsEntity({ + required String isInOrOut, + String? geofenceId, + required bool isBatteryLow, + required bool isDisconnect, + }) = _DeviceFlagsEntity; +} + +@freezed +abstract class DevicePaymentOptionsEntity with _$DevicePaymentOptionsEntity{ + const factory DevicePaymentOptionsEntity({ + int? nextPayDate, + required bool usePayment, + required String typeSubscription, + required bool hasSubscription, + required bool hasToPay, + }) = _DevicePaymentOptionsEntity; +} + +@freezed +abstract class DeviceSettingsEntity with _$DeviceSettingsEntity{ + const factory DeviceSettingsEntity({ + required int frequency, + required int frequencyHeartRate, + required int timezone, + required bool pedometer, + required String language, + required List alerts, + }) = _DeviceSettingsEntity; +} + +@freezed +abstract class DeviceCapabilitiesEntity with _$DeviceCapabilitiesEntity{ + const factory DeviceCapabilitiesEntity({ + required bool heartbeats, + required bool bloodPressure, + required DeviceCapabilitiesAlertEntity alerts, + required bool podometer, + required DeviceCapabilitiesContactsEntity contacts, + required DeviceCapabilitiesCommandsEntity commands, + required DeviceCapabilitiesSettingsEntity settings, + }) = _DeviceCapabilitiesEntity; +} + +@freezed +abstract class DeviceCapabilitiesAlertEntity with _$DeviceCapabilitiesAlertEntity{ + const factory DeviceCapabilitiesAlertEntity({ + required bool enabled, + required List types, + }) = _DeviceCapabilitiesAlertEntity; +} + +@freezed +abstract class DeviceCapabilitiesContactsEntity with _$DeviceCapabilitiesContactsEntity{ + const factory DeviceCapabilitiesContactsEntity({ + required bool enabled, + required List types, + }) = _DeviceCapabilitiesContactsEntity; +} + +@freezed +abstract class DeviceCapabilitiesContactTypeEntity with _$DeviceCapabilitiesContactTypeEntity{ + const factory DeviceCapabilitiesContactTypeEntity({ + required String type, + required int amount, + }) = _DeviceCapabilitiesContactTypeEntity; +} + +@freezed +abstract class DeviceCapabilitiesCommandsEntity with _$DeviceCapabilitiesCommandsEntity{ + const factory DeviceCapabilitiesCommandsEntity({ + required bool enabled, + required List types, + }) = _DeviceCapabilitiesCommandsEntity; +} + +@freezed +abstract class DeviceCapabilitiesSettingsEntity with _$DeviceCapabilitiesSettingsEntity{ + const factory DeviceCapabilitiesSettingsEntity({ + required bool locationFrequency, + required bool timezone, + required bool language, + }) = _DeviceCapabilitiesSettingsEntity; +} \ No newline at end of file diff --git a/modules/legacy/packages/legacy_shared/lib/src/data/models/entities/device_entity.freezed.dart b/modules/legacy/packages/legacy_shared/lib/src/data/models/entities/device_entity.freezed.dart new file mode 100644 index 00000000..44d8b405 --- /dev/null +++ b/modules/legacy/packages/legacy_shared/lib/src/data/models/entities/device_entity.freezed.dart @@ -0,0 +1,2922 @@ +// 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_entity.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(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; DeviceFlagsEntity get flags; List? get tags; int? get lastConnection; String? get carrierGenre; int? get carrierBirthday; int? get carrierWeight; int? get carrierStepLength; String get carrierName; String? get comment; String? get phone; String? get simId; String? get simStatus; DevicePaymentOptionsEntity? get paymentOptions; DeviceSettingsEntity get settings; String get protocol; String get type; String get connectionServer; DeviceCapabilitiesEntity? get capabilities; int get createdAt; int? get updatedAt; +/// Create a copy of DeviceEntity +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$DeviceEntityCopyWith get copyWith => _$DeviceEntityCopyWithImpl(this as DeviceEntity, _$identity); + + + +@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)&&(identical(other.flags, flags) || 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)&&(identical(other.simStatus, simStatus) || other.simStatus == simStatus)&&(identical(other.paymentOptions, paymentOptions) || other.paymentOptions == paymentOptions)&&(identical(other.settings, settings) || other.settings == settings)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.type, type) || other.type == type)&&(identical(other.connectionServer, connectionServer) || other.connectionServer == connectionServer)&&(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,flags,const DeepCollectionEquality().hash(tags),lastConnection,carrierGenre,carrierBirthday,carrierWeight,carrierStepLength,carrierName,comment,phone,simId,simStatus,paymentOptions,settings,protocol,type,connectionServer,capabilities,createdAt,updatedAt]); + +@override +String toString() { + return 'DeviceEntity(id: $id, identificator: $identificator, battery: $battery, userId: $userId, companyId: $companyId, delegationId: $delegationId, groupId: $groupId, flags: $flags, tags: $tags, lastConnection: $lastConnection, carrierGenre: $carrierGenre, carrierBirthday: $carrierBirthday, carrierWeight: $carrierWeight, carrierStepLength: $carrierStepLength, carrierName: $carrierName, comment: $comment, phone: $phone, simId: $simId, simStatus: $simStatus, paymentOptions: $paymentOptions, settings: $settings, protocol: $protocol, type: $type, connectionServer: $connectionServer, capabilities: $capabilities, createdAt: $createdAt, updatedAt: $updatedAt)'; +} + + +} + +/// @nodoc +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, DeviceFlagsEntity flags, List? tags, int? lastConnection, String? carrierGenre, int? carrierBirthday, int? carrierWeight, int? carrierStepLength, String carrierName, String? comment, String? phone, String? simId, String? simStatus, DevicePaymentOptionsEntity? paymentOptions, DeviceSettingsEntity settings, String protocol, String type, String connectionServer, DeviceCapabilitiesEntity? capabilities, int createdAt, int? updatedAt +}); + + +$DeviceFlagsEntityCopyWith<$Res> get flags;$DevicePaymentOptionsEntityCopyWith<$Res>? get paymentOptions;$DeviceSettingsEntityCopyWith<$Res> get settings;$DeviceCapabilitiesEntityCopyWith<$Res>? get capabilities; + +} +/// @nodoc +class _$DeviceEntityCopyWithImpl<$Res> + implements $DeviceEntityCopyWith<$Res> { + _$DeviceEntityCopyWithImpl(this._self, this._then); + + final DeviceEntity _self; + final $Res Function(DeviceEntity) _then; + +/// Create a copy of DeviceEntity +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? identificator = null,Object? battery = freezed,Object? userId = freezed,Object? companyId = freezed,Object? delegationId = freezed,Object? groupId = freezed,Object? flags = null,Object? tags = freezed,Object? lastConnection = freezed,Object? carrierGenre = freezed,Object? carrierBirthday = freezed,Object? carrierWeight = freezed,Object? carrierStepLength = freezed,Object? carrierName = null,Object? comment = freezed,Object? phone = freezed,Object? simId = freezed,Object? simStatus = freezed,Object? paymentOptions = freezed,Object? settings = null,Object? protocol = null,Object? type = null,Object? connectionServer = null,Object? capabilities = freezed,Object? createdAt = null,Object? updatedAt = freezed,}) { + return _then(_self.copyWith( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,identificator: null == identificator ? _self.identificator : identificator // ignore: cast_nullable_to_non_nullable +as String,battery: freezed == battery ? _self.battery : battery // ignore: cast_nullable_to_non_nullable +as int?,userId: freezed == userId ? _self.userId : userId // ignore: cast_nullable_to_non_nullable +as String?,companyId: freezed == companyId ? _self.companyId : companyId // ignore: cast_nullable_to_non_nullable +as String?,delegationId: freezed == delegationId ? _self.delegationId : delegationId // ignore: cast_nullable_to_non_nullable +as String?,groupId: freezed == groupId ? _self.groupId : groupId // ignore: cast_nullable_to_non_nullable +as String?,flags: null == flags ? _self.flags : flags // ignore: cast_nullable_to_non_nullable +as DeviceFlagsEntity,tags: freezed == tags ? _self.tags : tags // ignore: cast_nullable_to_non_nullable +as List?,lastConnection: freezed == lastConnection ? _self.lastConnection : lastConnection // ignore: cast_nullable_to_non_nullable +as int?,carrierGenre: freezed == carrierGenre ? _self.carrierGenre : carrierGenre // ignore: cast_nullable_to_non_nullable +as String?,carrierBirthday: freezed == carrierBirthday ? _self.carrierBirthday : carrierBirthday // ignore: cast_nullable_to_non_nullable +as int?,carrierWeight: freezed == carrierWeight ? _self.carrierWeight : carrierWeight // ignore: cast_nullable_to_non_nullable +as int?,carrierStepLength: freezed == carrierStepLength ? _self.carrierStepLength : carrierStepLength // ignore: cast_nullable_to_non_nullable +as int?,carrierName: null == carrierName ? _self.carrierName : carrierName // ignore: cast_nullable_to_non_nullable +as String,comment: freezed == comment ? _self.comment : comment // ignore: cast_nullable_to_non_nullable +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?,simStatus: freezed == simStatus ? _self.simStatus : simStatus // ignore: cast_nullable_to_non_nullable +as String?,paymentOptions: freezed == paymentOptions ? _self.paymentOptions : paymentOptions // ignore: cast_nullable_to_non_nullable +as DevicePaymentOptionsEntity?,settings: null == settings ? _self.settings : settings // ignore: cast_nullable_to_non_nullable +as DeviceSettingsEntity,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,connectionServer: null == connectionServer ? _self.connectionServer : connectionServer // 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 int,updatedAt: freezed == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable +as int?, + )); +} +/// Create a copy of DeviceEntity +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$DeviceFlagsEntityCopyWith<$Res> get flags { + + return $DeviceFlagsEntityCopyWith<$Res>(_self.flags, (value) { + return _then(_self.copyWith(flags: value)); + }); +}/// Create a copy of DeviceEntity +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$DevicePaymentOptionsEntityCopyWith<$Res>? get paymentOptions { + if (_self.paymentOptions == null) { + return null; + } + + return $DevicePaymentOptionsEntityCopyWith<$Res>(_self.paymentOptions!, (value) { + return _then(_self.copyWith(paymentOptions: value)); + }); +}/// 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)); + }); +} +} + + +/// Adds pattern-matching-related methods to [DeviceEntity]. +extension DeviceEntityPatterns on DeviceEntity { +/// 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 Function( _DeviceEntity value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _DeviceEntity() 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 Function( _DeviceEntity value) $default,){ +final _that = this; +switch (_that) { +case _DeviceEntity(): +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? Function( _DeviceEntity value)? $default,){ +final _that = this; +switch (_that) { +case _DeviceEntity() 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 Function( String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, DeviceFlagsEntity flags, List? tags, int? lastConnection, String? carrierGenre, int? carrierBirthday, int? carrierWeight, int? carrierStepLength, String carrierName, String? comment, String? phone, String? simId, String? simStatus, DevicePaymentOptionsEntity? paymentOptions, DeviceSettingsEntity settings, String protocol, String type, String connectionServer, DeviceCapabilitiesEntity? capabilities, int createdAt, int? 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.simStatus,_that.paymentOptions,_that.settings,_that.protocol,_that.type,_that.connectionServer,_that.capabilities,_that.createdAt,_that.updatedAt);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 Function( String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, DeviceFlagsEntity flags, List? tags, int? lastConnection, String? carrierGenre, int? carrierBirthday, int? carrierWeight, int? carrierStepLength, String carrierName, String? comment, String? phone, String? simId, String? simStatus, DevicePaymentOptionsEntity? paymentOptions, DeviceSettingsEntity settings, String protocol, String type, String connectionServer, DeviceCapabilitiesEntity? capabilities, int createdAt, int? 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.simStatus,_that.paymentOptions,_that.settings,_that.protocol,_that.type,_that.connectionServer,_that.capabilities,_that.createdAt,_that.updatedAt);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? Function( String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, DeviceFlagsEntity flags, List? tags, int? lastConnection, String? carrierGenre, int? carrierBirthday, int? carrierWeight, int? carrierStepLength, String carrierName, String? comment, String? phone, String? simId, String? simStatus, DevicePaymentOptionsEntity? paymentOptions, DeviceSettingsEntity settings, String protocol, String type, String connectionServer, DeviceCapabilitiesEntity? capabilities, int createdAt, int? 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.simStatus,_that.paymentOptions,_that.settings,_that.protocol,_that.type,_that.connectionServer,_that.capabilities,_that.createdAt,_that.updatedAt);case _: + return null; + +} +} + +} + +/// @nodoc + + +class _DeviceEntity implements DeviceEntity { + const _DeviceEntity({required this.id, required this.identificator, this.battery, this.userId, this.companyId, this.delegationId, this.groupId, required this.flags, final List? tags, this.lastConnection, this.carrierGenre, this.carrierBirthday, this.carrierWeight, this.carrierStepLength, required this.carrierName, this.comment, this.phone, this.simId, this.simStatus, this.paymentOptions, required this.settings, required this.protocol, required this.type, required this.connectionServer, this.capabilities, required this.createdAt, this.updatedAt}): _tags = tags; + + +@override final String id; +@override final String identificator; +@override final int? battery; +@override final String? userId; +@override final String? companyId; +@override final String? delegationId; +@override final String? groupId; +@override final DeviceFlagsEntity flags; + final List? _tags; +@override List? get tags { + final value = _tags; + if (value == null) return null; + if (_tags is EqualUnmodifiableListView) return _tags; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); +} + +@override final int? lastConnection; +@override final String? carrierGenre; +@override final int? carrierBirthday; +@override final int? carrierWeight; +@override final int? carrierStepLength; +@override final String carrierName; +@override final String? comment; +@override final String? phone; +@override final String? simId; +@override final String? simStatus; +@override final DevicePaymentOptionsEntity? paymentOptions; +@override final DeviceSettingsEntity settings; +@override final String protocol; +@override final String type; +@override final String connectionServer; +@override final DeviceCapabilitiesEntity? capabilities; +@override final int createdAt; +@override final int? updatedAt; + +/// Create a copy of DeviceEntity +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$DeviceEntityCopyWith<_DeviceEntity> get copyWith => __$DeviceEntityCopyWithImpl<_DeviceEntity>(this, _$identity); + + + +@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)&&(identical(other.flags, flags) || 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)&&(identical(other.simStatus, simStatus) || other.simStatus == simStatus)&&(identical(other.paymentOptions, paymentOptions) || other.paymentOptions == paymentOptions)&&(identical(other.settings, settings) || other.settings == settings)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.type, type) || other.type == type)&&(identical(other.connectionServer, connectionServer) || other.connectionServer == connectionServer)&&(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,flags,const DeepCollectionEquality().hash(_tags),lastConnection,carrierGenre,carrierBirthday,carrierWeight,carrierStepLength,carrierName,comment,phone,simId,simStatus,paymentOptions,settings,protocol,type,connectionServer,capabilities,createdAt,updatedAt]); + +@override +String toString() { + return 'DeviceEntity(id: $id, identificator: $identificator, battery: $battery, userId: $userId, companyId: $companyId, delegationId: $delegationId, groupId: $groupId, flags: $flags, tags: $tags, lastConnection: $lastConnection, carrierGenre: $carrierGenre, carrierBirthday: $carrierBirthday, carrierWeight: $carrierWeight, carrierStepLength: $carrierStepLength, carrierName: $carrierName, comment: $comment, phone: $phone, simId: $simId, simStatus: $simStatus, paymentOptions: $paymentOptions, settings: $settings, protocol: $protocol, type: $type, connectionServer: $connectionServer, capabilities: $capabilities, createdAt: $createdAt, updatedAt: $updatedAt)'; +} + + +} + +/// @nodoc +abstract mixin class _$DeviceEntityCopyWith<$Res> implements $DeviceEntityCopyWith<$Res> { + 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, DeviceFlagsEntity flags, List? tags, int? lastConnection, String? carrierGenre, int? carrierBirthday, int? carrierWeight, int? carrierStepLength, String carrierName, String? comment, String? phone, String? simId, String? simStatus, DevicePaymentOptionsEntity? paymentOptions, DeviceSettingsEntity settings, String protocol, String type, String connectionServer, DeviceCapabilitiesEntity? capabilities, int createdAt, int? updatedAt +}); + + +@override $DeviceFlagsEntityCopyWith<$Res> get flags;@override $DevicePaymentOptionsEntityCopyWith<$Res>? get paymentOptions;@override $DeviceSettingsEntityCopyWith<$Res> get settings;@override $DeviceCapabilitiesEntityCopyWith<$Res>? get capabilities; + +} +/// @nodoc +class __$DeviceEntityCopyWithImpl<$Res> + implements _$DeviceEntityCopyWith<$Res> { + __$DeviceEntityCopyWithImpl(this._self, this._then); + + final _DeviceEntity _self; + final $Res Function(_DeviceEntity) _then; + +/// Create a copy of DeviceEntity +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? identificator = null,Object? battery = freezed,Object? userId = freezed,Object? companyId = freezed,Object? delegationId = freezed,Object? groupId = freezed,Object? flags = null,Object? tags = freezed,Object? lastConnection = freezed,Object? carrierGenre = freezed,Object? carrierBirthday = freezed,Object? carrierWeight = freezed,Object? carrierStepLength = freezed,Object? carrierName = null,Object? comment = freezed,Object? phone = freezed,Object? simId = freezed,Object? simStatus = freezed,Object? paymentOptions = freezed,Object? settings = null,Object? protocol = null,Object? type = null,Object? connectionServer = null,Object? capabilities = freezed,Object? createdAt = null,Object? updatedAt = freezed,}) { + return _then(_DeviceEntity( +id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as String,identificator: null == identificator ? _self.identificator : identificator // ignore: cast_nullable_to_non_nullable +as String,battery: freezed == battery ? _self.battery : battery // ignore: cast_nullable_to_non_nullable +as int?,userId: freezed == userId ? _self.userId : userId // ignore: cast_nullable_to_non_nullable +as String?,companyId: freezed == companyId ? _self.companyId : companyId // ignore: cast_nullable_to_non_nullable +as String?,delegationId: freezed == delegationId ? _self.delegationId : delegationId // ignore: cast_nullable_to_non_nullable +as String?,groupId: freezed == groupId ? _self.groupId : groupId // ignore: cast_nullable_to_non_nullable +as String?,flags: null == flags ? _self.flags : flags // ignore: cast_nullable_to_non_nullable +as DeviceFlagsEntity,tags: freezed == tags ? _self._tags : tags // ignore: cast_nullable_to_non_nullable +as List?,lastConnection: freezed == lastConnection ? _self.lastConnection : lastConnection // ignore: cast_nullable_to_non_nullable +as int?,carrierGenre: freezed == carrierGenre ? _self.carrierGenre : carrierGenre // ignore: cast_nullable_to_non_nullable +as String?,carrierBirthday: freezed == carrierBirthday ? _self.carrierBirthday : carrierBirthday // ignore: cast_nullable_to_non_nullable +as int?,carrierWeight: freezed == carrierWeight ? _self.carrierWeight : carrierWeight // ignore: cast_nullable_to_non_nullable +as int?,carrierStepLength: freezed == carrierStepLength ? _self.carrierStepLength : carrierStepLength // ignore: cast_nullable_to_non_nullable +as int?,carrierName: null == carrierName ? _self.carrierName : carrierName // ignore: cast_nullable_to_non_nullable +as String,comment: freezed == comment ? _self.comment : comment // ignore: cast_nullable_to_non_nullable +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?,simStatus: freezed == simStatus ? _self.simStatus : simStatus // ignore: cast_nullable_to_non_nullable +as String?,paymentOptions: freezed == paymentOptions ? _self.paymentOptions : paymentOptions // ignore: cast_nullable_to_non_nullable +as DevicePaymentOptionsEntity?,settings: null == settings ? _self.settings : settings // ignore: cast_nullable_to_non_nullable +as DeviceSettingsEntity,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,connectionServer: null == connectionServer ? _self.connectionServer : connectionServer // 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 int,updatedAt: freezed == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable +as int?, + )); +} + +/// Create a copy of DeviceEntity +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$DeviceFlagsEntityCopyWith<$Res> get flags { + + return $DeviceFlagsEntityCopyWith<$Res>(_self.flags, (value) { + return _then(_self.copyWith(flags: value)); + }); +}/// Create a copy of DeviceEntity +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$DevicePaymentOptionsEntityCopyWith<$Res>? get paymentOptions { + if (_self.paymentOptions == null) { + return null; + } + + return $DevicePaymentOptionsEntityCopyWith<$Res>(_self.paymentOptions!, (value) { + return _then(_self.copyWith(paymentOptions: value)); + }); +}/// 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)); + }); +} +} + +/// @nodoc +mixin _$DeviceFlagsEntity { + + String get isInOrOut; String? get geofenceId; bool get isBatteryLow; bool get isDisconnect; +/// Create a copy of DeviceFlagsEntity +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$DeviceFlagsEntityCopyWith get copyWith => _$DeviceFlagsEntityCopyWithImpl(this as DeviceFlagsEntity, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceFlagsEntity&&(identical(other.isInOrOut, isInOrOut) || other.isInOrOut == isInOrOut)&&(identical(other.geofenceId, geofenceId) || other.geofenceId == geofenceId)&&(identical(other.isBatteryLow, isBatteryLow) || other.isBatteryLow == isBatteryLow)&&(identical(other.isDisconnect, isDisconnect) || other.isDisconnect == isDisconnect)); +} + + +@override +int get hashCode => Object.hash(runtimeType,isInOrOut,geofenceId,isBatteryLow,isDisconnect); + +@override +String toString() { + return 'DeviceFlagsEntity(isInOrOut: $isInOrOut, geofenceId: $geofenceId, isBatteryLow: $isBatteryLow, isDisconnect: $isDisconnect)'; +} + + +} + +/// @nodoc +abstract mixin class $DeviceFlagsEntityCopyWith<$Res> { + factory $DeviceFlagsEntityCopyWith(DeviceFlagsEntity value, $Res Function(DeviceFlagsEntity) _then) = _$DeviceFlagsEntityCopyWithImpl; +@useResult +$Res call({ + String isInOrOut, String? geofenceId, bool isBatteryLow, bool isDisconnect +}); + + + + +} +/// @nodoc +class _$DeviceFlagsEntityCopyWithImpl<$Res> + implements $DeviceFlagsEntityCopyWith<$Res> { + _$DeviceFlagsEntityCopyWithImpl(this._self, this._then); + + final DeviceFlagsEntity _self; + final $Res Function(DeviceFlagsEntity) _then; + +/// Create a copy of DeviceFlagsEntity +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? isInOrOut = null,Object? geofenceId = freezed,Object? isBatteryLow = null,Object? isDisconnect = null,}) { + return _then(_self.copyWith( +isInOrOut: null == isInOrOut ? _self.isInOrOut : isInOrOut // ignore: cast_nullable_to_non_nullable +as String,geofenceId: freezed == geofenceId ? _self.geofenceId : geofenceId // ignore: cast_nullable_to_non_nullable +as String?,isBatteryLow: null == isBatteryLow ? _self.isBatteryLow : isBatteryLow // ignore: cast_nullable_to_non_nullable +as bool,isDisconnect: null == isDisconnect ? _self.isDisconnect : isDisconnect // ignore: cast_nullable_to_non_nullable +as bool, + )); +} + +} + + +/// Adds pattern-matching-related methods to [DeviceFlagsEntity]. +extension DeviceFlagsEntityPatterns on DeviceFlagsEntity { +/// 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 Function( _DeviceFlagsEntity value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _DeviceFlagsEntity() 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 Function( _DeviceFlagsEntity value) $default,){ +final _that = this; +switch (_that) { +case _DeviceFlagsEntity(): +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? Function( _DeviceFlagsEntity value)? $default,){ +final _that = this; +switch (_that) { +case _DeviceFlagsEntity() 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 Function( String isInOrOut, String? geofenceId, bool isBatteryLow, bool isDisconnect)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _DeviceFlagsEntity() when $default != null: +return $default(_that.isInOrOut,_that.geofenceId,_that.isBatteryLow,_that.isDisconnect);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 Function( String isInOrOut, String? geofenceId, bool isBatteryLow, bool isDisconnect) $default,) {final _that = this; +switch (_that) { +case _DeviceFlagsEntity(): +return $default(_that.isInOrOut,_that.geofenceId,_that.isBatteryLow,_that.isDisconnect);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? Function( String isInOrOut, String? geofenceId, bool isBatteryLow, bool isDisconnect)? $default,) {final _that = this; +switch (_that) { +case _DeviceFlagsEntity() when $default != null: +return $default(_that.isInOrOut,_that.geofenceId,_that.isBatteryLow,_that.isDisconnect);case _: + return null; + +} +} + +} + +/// @nodoc + + +class _DeviceFlagsEntity implements DeviceFlagsEntity { + const _DeviceFlagsEntity({required this.isInOrOut, this.geofenceId, required this.isBatteryLow, required this.isDisconnect}); + + +@override final String isInOrOut; +@override final String? geofenceId; +@override final bool isBatteryLow; +@override final bool isDisconnect; + +/// Create a copy of DeviceFlagsEntity +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$DeviceFlagsEntityCopyWith<_DeviceFlagsEntity> get copyWith => __$DeviceFlagsEntityCopyWithImpl<_DeviceFlagsEntity>(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceFlagsEntity&&(identical(other.isInOrOut, isInOrOut) || other.isInOrOut == isInOrOut)&&(identical(other.geofenceId, geofenceId) || other.geofenceId == geofenceId)&&(identical(other.isBatteryLow, isBatteryLow) || other.isBatteryLow == isBatteryLow)&&(identical(other.isDisconnect, isDisconnect) || other.isDisconnect == isDisconnect)); +} + + +@override +int get hashCode => Object.hash(runtimeType,isInOrOut,geofenceId,isBatteryLow,isDisconnect); + +@override +String toString() { + return 'DeviceFlagsEntity(isInOrOut: $isInOrOut, geofenceId: $geofenceId, isBatteryLow: $isBatteryLow, isDisconnect: $isDisconnect)'; +} + + +} + +/// @nodoc +abstract mixin class _$DeviceFlagsEntityCopyWith<$Res> implements $DeviceFlagsEntityCopyWith<$Res> { + factory _$DeviceFlagsEntityCopyWith(_DeviceFlagsEntity value, $Res Function(_DeviceFlagsEntity) _then) = __$DeviceFlagsEntityCopyWithImpl; +@override @useResult +$Res call({ + String isInOrOut, String? geofenceId, bool isBatteryLow, bool isDisconnect +}); + + + + +} +/// @nodoc +class __$DeviceFlagsEntityCopyWithImpl<$Res> + implements _$DeviceFlagsEntityCopyWith<$Res> { + __$DeviceFlagsEntityCopyWithImpl(this._self, this._then); + + final _DeviceFlagsEntity _self; + final $Res Function(_DeviceFlagsEntity) _then; + +/// Create a copy of DeviceFlagsEntity +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? isInOrOut = null,Object? geofenceId = freezed,Object? isBatteryLow = null,Object? isDisconnect = null,}) { + return _then(_DeviceFlagsEntity( +isInOrOut: null == isInOrOut ? _self.isInOrOut : isInOrOut // ignore: cast_nullable_to_non_nullable +as String,geofenceId: freezed == geofenceId ? _self.geofenceId : geofenceId // ignore: cast_nullable_to_non_nullable +as String?,isBatteryLow: null == isBatteryLow ? _self.isBatteryLow : isBatteryLow // ignore: cast_nullable_to_non_nullable +as bool,isDisconnect: null == isDisconnect ? _self.isDisconnect : isDisconnect // ignore: cast_nullable_to_non_nullable +as bool, + )); +} + + +} + +/// @nodoc +mixin _$DevicePaymentOptionsEntity { + + int? get nextPayDate; bool get usePayment; String get typeSubscription; bool get hasSubscription; bool get hasToPay; +/// Create a copy of DevicePaymentOptionsEntity +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$DevicePaymentOptionsEntityCopyWith get copyWith => _$DevicePaymentOptionsEntityCopyWithImpl(this as DevicePaymentOptionsEntity, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is DevicePaymentOptionsEntity&&(identical(other.nextPayDate, nextPayDate) || other.nextPayDate == nextPayDate)&&(identical(other.usePayment, usePayment) || other.usePayment == usePayment)&&(identical(other.typeSubscription, typeSubscription) || other.typeSubscription == typeSubscription)&&(identical(other.hasSubscription, hasSubscription) || other.hasSubscription == hasSubscription)&&(identical(other.hasToPay, hasToPay) || other.hasToPay == hasToPay)); +} + + +@override +int get hashCode => Object.hash(runtimeType,nextPayDate,usePayment,typeSubscription,hasSubscription,hasToPay); + +@override +String toString() { + return 'DevicePaymentOptionsEntity(nextPayDate: $nextPayDate, usePayment: $usePayment, typeSubscription: $typeSubscription, hasSubscription: $hasSubscription, hasToPay: $hasToPay)'; +} + + +} + +/// @nodoc +abstract mixin class $DevicePaymentOptionsEntityCopyWith<$Res> { + factory $DevicePaymentOptionsEntityCopyWith(DevicePaymentOptionsEntity value, $Res Function(DevicePaymentOptionsEntity) _then) = _$DevicePaymentOptionsEntityCopyWithImpl; +@useResult +$Res call({ + int? nextPayDate, bool usePayment, String typeSubscription, bool hasSubscription, bool hasToPay +}); + + + + +} +/// @nodoc +class _$DevicePaymentOptionsEntityCopyWithImpl<$Res> + implements $DevicePaymentOptionsEntityCopyWith<$Res> { + _$DevicePaymentOptionsEntityCopyWithImpl(this._self, this._then); + + final DevicePaymentOptionsEntity _self; + final $Res Function(DevicePaymentOptionsEntity) _then; + +/// Create a copy of DevicePaymentOptionsEntity +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? nextPayDate = freezed,Object? usePayment = null,Object? typeSubscription = null,Object? hasSubscription = null,Object? hasToPay = null,}) { + return _then(_self.copyWith( +nextPayDate: freezed == nextPayDate ? _self.nextPayDate : nextPayDate // ignore: cast_nullable_to_non_nullable +as int?,usePayment: null == usePayment ? _self.usePayment : usePayment // ignore: cast_nullable_to_non_nullable +as bool,typeSubscription: null == typeSubscription ? _self.typeSubscription : typeSubscription // ignore: cast_nullable_to_non_nullable +as String,hasSubscription: null == hasSubscription ? _self.hasSubscription : hasSubscription // ignore: cast_nullable_to_non_nullable +as bool,hasToPay: null == hasToPay ? _self.hasToPay : hasToPay // ignore: cast_nullable_to_non_nullable +as bool, + )); +} + +} + + +/// Adds pattern-matching-related methods to [DevicePaymentOptionsEntity]. +extension DevicePaymentOptionsEntityPatterns on DevicePaymentOptionsEntity { +/// 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 Function( _DevicePaymentOptionsEntity value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _DevicePaymentOptionsEntity() 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 Function( _DevicePaymentOptionsEntity value) $default,){ +final _that = this; +switch (_that) { +case _DevicePaymentOptionsEntity(): +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? Function( _DevicePaymentOptionsEntity value)? $default,){ +final _that = this; +switch (_that) { +case _DevicePaymentOptionsEntity() 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 Function( int? nextPayDate, bool usePayment, String typeSubscription, bool hasSubscription, bool hasToPay)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _DevicePaymentOptionsEntity() when $default != null: +return $default(_that.nextPayDate,_that.usePayment,_that.typeSubscription,_that.hasSubscription,_that.hasToPay);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 Function( int? nextPayDate, bool usePayment, String typeSubscription, bool hasSubscription, bool hasToPay) $default,) {final _that = this; +switch (_that) { +case _DevicePaymentOptionsEntity(): +return $default(_that.nextPayDate,_that.usePayment,_that.typeSubscription,_that.hasSubscription,_that.hasToPay);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? Function( int? nextPayDate, bool usePayment, String typeSubscription, bool hasSubscription, bool hasToPay)? $default,) {final _that = this; +switch (_that) { +case _DevicePaymentOptionsEntity() when $default != null: +return $default(_that.nextPayDate,_that.usePayment,_that.typeSubscription,_that.hasSubscription,_that.hasToPay);case _: + return null; + +} +} + +} + +/// @nodoc + + +class _DevicePaymentOptionsEntity implements DevicePaymentOptionsEntity { + const _DevicePaymentOptionsEntity({this.nextPayDate, required this.usePayment, required this.typeSubscription, required this.hasSubscription, required this.hasToPay}); + + +@override final int? nextPayDate; +@override final bool usePayment; +@override final String typeSubscription; +@override final bool hasSubscription; +@override final bool hasToPay; + +/// Create a copy of DevicePaymentOptionsEntity +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$DevicePaymentOptionsEntityCopyWith<_DevicePaymentOptionsEntity> get copyWith => __$DevicePaymentOptionsEntityCopyWithImpl<_DevicePaymentOptionsEntity>(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _DevicePaymentOptionsEntity&&(identical(other.nextPayDate, nextPayDate) || other.nextPayDate == nextPayDate)&&(identical(other.usePayment, usePayment) || other.usePayment == usePayment)&&(identical(other.typeSubscription, typeSubscription) || other.typeSubscription == typeSubscription)&&(identical(other.hasSubscription, hasSubscription) || other.hasSubscription == hasSubscription)&&(identical(other.hasToPay, hasToPay) || other.hasToPay == hasToPay)); +} + + +@override +int get hashCode => Object.hash(runtimeType,nextPayDate,usePayment,typeSubscription,hasSubscription,hasToPay); + +@override +String toString() { + return 'DevicePaymentOptionsEntity(nextPayDate: $nextPayDate, usePayment: $usePayment, typeSubscription: $typeSubscription, hasSubscription: $hasSubscription, hasToPay: $hasToPay)'; +} + + +} + +/// @nodoc +abstract mixin class _$DevicePaymentOptionsEntityCopyWith<$Res> implements $DevicePaymentOptionsEntityCopyWith<$Res> { + factory _$DevicePaymentOptionsEntityCopyWith(_DevicePaymentOptionsEntity value, $Res Function(_DevicePaymentOptionsEntity) _then) = __$DevicePaymentOptionsEntityCopyWithImpl; +@override @useResult +$Res call({ + int? nextPayDate, bool usePayment, String typeSubscription, bool hasSubscription, bool hasToPay +}); + + + + +} +/// @nodoc +class __$DevicePaymentOptionsEntityCopyWithImpl<$Res> + implements _$DevicePaymentOptionsEntityCopyWith<$Res> { + __$DevicePaymentOptionsEntityCopyWithImpl(this._self, this._then); + + final _DevicePaymentOptionsEntity _self; + final $Res Function(_DevicePaymentOptionsEntity) _then; + +/// Create a copy of DevicePaymentOptionsEntity +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? nextPayDate = freezed,Object? usePayment = null,Object? typeSubscription = null,Object? hasSubscription = null,Object? hasToPay = null,}) { + return _then(_DevicePaymentOptionsEntity( +nextPayDate: freezed == nextPayDate ? _self.nextPayDate : nextPayDate // ignore: cast_nullable_to_non_nullable +as int?,usePayment: null == usePayment ? _self.usePayment : usePayment // ignore: cast_nullable_to_non_nullable +as bool,typeSubscription: null == typeSubscription ? _self.typeSubscription : typeSubscription // ignore: cast_nullable_to_non_nullable +as String,hasSubscription: null == hasSubscription ? _self.hasSubscription : hasSubscription // ignore: cast_nullable_to_non_nullable +as bool,hasToPay: null == hasToPay ? _self.hasToPay : hasToPay // ignore: cast_nullable_to_non_nullable +as bool, + )); +} + + +} + +/// @nodoc +mixin _$DeviceSettingsEntity { + + int get frequency; int get frequencyHeartRate; int get timezone; bool get pedometer; String get language; List get alerts; +/// 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 get copyWith => _$DeviceSettingsEntityCopyWithImpl(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)); +} + + +@override +int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(alerts)); + +@override +String toString() { + return 'DeviceSettingsEntity(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts)'; +} + + +} + +/// @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 alerts +}); + + + + +} +/// @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,}) { + 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, + )); +} + +} + + +/// 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 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 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? 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 Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List alerts)? $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);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 Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List alerts) $default,) {final _that = this; +switch (_that) { +case _DeviceSettingsEntity(): +return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts);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? Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List alerts)? $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);case _: + return null; + +} +} + +} + +/// @nodoc + + +class _DeviceSettingsEntity implements DeviceSettingsEntity { + const _DeviceSettingsEntity({required this.frequency, required this.frequencyHeartRate, required this.timezone, required this.pedometer, required this.language, required final List alerts}): _alerts = alerts; + + +@override final int frequency; +@override final int frequencyHeartRate; +@override final int timezone; +@override final bool pedometer; +@override final String language; + final List _alerts; +@override List get alerts { + if (_alerts is EqualUnmodifiableListView) return _alerts; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_alerts); +} + + +/// 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)); +} + + +@override +int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(_alerts)); + +@override +String toString() { + return 'DeviceSettingsEntity(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts)'; +} + + +} + +/// @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 alerts +}); + + + + +} +/// @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,}) { + 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, + )); +} + + +} + +/// @nodoc +mixin _$DeviceCapabilitiesEntity { + + bool get heartbeats; bool get bloodPressure; DeviceCapabilitiesAlertEntity get alerts; bool get podometer; DeviceCapabilitiesContactsEntity get contacts; DeviceCapabilitiesCommandsEntity get commands; DeviceCapabilitiesSettingsEntity get settings; +/// Create a copy of DeviceCapabilitiesEntity +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$DeviceCapabilitiesEntityCopyWith get copyWith => _$DeviceCapabilitiesEntityCopyWithImpl(this as DeviceCapabilitiesEntity, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceCapabilitiesEntity&&(identical(other.heartbeats, heartbeats) || other.heartbeats == heartbeats)&&(identical(other.bloodPressure, bloodPressure) || other.bloodPressure == bloodPressure)&&(identical(other.alerts, alerts) || other.alerts == alerts)&&(identical(other.podometer, podometer) || other.podometer == podometer)&&(identical(other.contacts, contacts) || other.contacts == contacts)&&(identical(other.commands, commands) || other.commands == commands)&&(identical(other.settings, settings) || other.settings == settings)); +} + + +@override +int get hashCode => Object.hash(runtimeType,heartbeats,bloodPressure,alerts,podometer,contacts,commands,settings); + +@override +String toString() { + return 'DeviceCapabilitiesEntity(heartbeats: $heartbeats, bloodPressure: $bloodPressure, alerts: $alerts, podometer: $podometer, contacts: $contacts, commands: $commands, settings: $settings)'; +} + + +} + +/// @nodoc +abstract mixin class $DeviceCapabilitiesEntityCopyWith<$Res> { + factory $DeviceCapabilitiesEntityCopyWith(DeviceCapabilitiesEntity value, $Res Function(DeviceCapabilitiesEntity) _then) = _$DeviceCapabilitiesEntityCopyWithImpl; +@useResult +$Res call({ + bool heartbeats, bool bloodPressure, DeviceCapabilitiesAlertEntity alerts, bool podometer, DeviceCapabilitiesContactsEntity contacts, DeviceCapabilitiesCommandsEntity commands, DeviceCapabilitiesSettingsEntity settings +}); + + +$DeviceCapabilitiesAlertEntityCopyWith<$Res> get alerts;$DeviceCapabilitiesContactsEntityCopyWith<$Res> get contacts;$DeviceCapabilitiesCommandsEntityCopyWith<$Res> get commands;$DeviceCapabilitiesSettingsEntityCopyWith<$Res> get settings; + +} +/// @nodoc +class _$DeviceCapabilitiesEntityCopyWithImpl<$Res> + implements $DeviceCapabilitiesEntityCopyWith<$Res> { + _$DeviceCapabilitiesEntityCopyWithImpl(this._self, this._then); + + final DeviceCapabilitiesEntity _self; + final $Res Function(DeviceCapabilitiesEntity) _then; + +/// Create a copy of DeviceCapabilitiesEntity +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? heartbeats = null,Object? bloodPressure = null,Object? alerts = null,Object? podometer = null,Object? contacts = null,Object? commands = null,Object? settings = null,}) { + return _then(_self.copyWith( +heartbeats: null == heartbeats ? _self.heartbeats : heartbeats // ignore: cast_nullable_to_non_nullable +as bool,bloodPressure: null == bloodPressure ? _self.bloodPressure : bloodPressure // ignore: cast_nullable_to_non_nullable +as bool,alerts: null == alerts ? _self.alerts : alerts // ignore: cast_nullable_to_non_nullable +as DeviceCapabilitiesAlertEntity,podometer: null == podometer ? _self.podometer : podometer // ignore: cast_nullable_to_non_nullable +as bool,contacts: null == contacts ? _self.contacts : contacts // ignore: cast_nullable_to_non_nullable +as DeviceCapabilitiesContactsEntity,commands: null == commands ? _self.commands : commands // ignore: cast_nullable_to_non_nullable +as DeviceCapabilitiesCommandsEntity,settings: null == settings ? _self.settings : settings // ignore: cast_nullable_to_non_nullable +as DeviceCapabilitiesSettingsEntity, + )); +} +/// Create a copy of DeviceCapabilitiesEntity +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$DeviceCapabilitiesAlertEntityCopyWith<$Res> get alerts { + + return $DeviceCapabilitiesAlertEntityCopyWith<$Res>(_self.alerts, (value) { + return _then(_self.copyWith(alerts: value)); + }); +}/// Create a copy of DeviceCapabilitiesEntity +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$DeviceCapabilitiesContactsEntityCopyWith<$Res> get contacts { + + return $DeviceCapabilitiesContactsEntityCopyWith<$Res>(_self.contacts, (value) { + return _then(_self.copyWith(contacts: value)); + }); +}/// Create a copy of DeviceCapabilitiesEntity +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$DeviceCapabilitiesCommandsEntityCopyWith<$Res> get commands { + + return $DeviceCapabilitiesCommandsEntityCopyWith<$Res>(_self.commands, (value) { + return _then(_self.copyWith(commands: value)); + }); +}/// Create a copy of DeviceCapabilitiesEntity +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$DeviceCapabilitiesSettingsEntityCopyWith<$Res> get settings { + + return $DeviceCapabilitiesSettingsEntityCopyWith<$Res>(_self.settings, (value) { + return _then(_self.copyWith(settings: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [DeviceCapabilitiesEntity]. +extension DeviceCapabilitiesEntityPatterns on DeviceCapabilitiesEntity { +/// 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 Function( _DeviceCapabilitiesEntity value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _DeviceCapabilitiesEntity() 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 Function( _DeviceCapabilitiesEntity value) $default,){ +final _that = this; +switch (_that) { +case _DeviceCapabilitiesEntity(): +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? Function( _DeviceCapabilitiesEntity value)? $default,){ +final _that = this; +switch (_that) { +case _DeviceCapabilitiesEntity() 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 Function( bool heartbeats, bool bloodPressure, DeviceCapabilitiesAlertEntity alerts, bool podometer, DeviceCapabilitiesContactsEntity contacts, DeviceCapabilitiesCommandsEntity commands, DeviceCapabilitiesSettingsEntity settings)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _DeviceCapabilitiesEntity() when $default != null: +return $default(_that.heartbeats,_that.bloodPressure,_that.alerts,_that.podometer,_that.contacts,_that.commands,_that.settings);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 Function( bool heartbeats, bool bloodPressure, DeviceCapabilitiesAlertEntity alerts, bool podometer, DeviceCapabilitiesContactsEntity contacts, DeviceCapabilitiesCommandsEntity commands, DeviceCapabilitiesSettingsEntity settings) $default,) {final _that = this; +switch (_that) { +case _DeviceCapabilitiesEntity(): +return $default(_that.heartbeats,_that.bloodPressure,_that.alerts,_that.podometer,_that.contacts,_that.commands,_that.settings);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? Function( bool heartbeats, bool bloodPressure, DeviceCapabilitiesAlertEntity alerts, bool podometer, DeviceCapabilitiesContactsEntity contacts, DeviceCapabilitiesCommandsEntity commands, DeviceCapabilitiesSettingsEntity settings)? $default,) {final _that = this; +switch (_that) { +case _DeviceCapabilitiesEntity() when $default != null: +return $default(_that.heartbeats,_that.bloodPressure,_that.alerts,_that.podometer,_that.contacts,_that.commands,_that.settings);case _: + return null; + +} +} + +} + +/// @nodoc + + +class _DeviceCapabilitiesEntity implements DeviceCapabilitiesEntity { + const _DeviceCapabilitiesEntity({required this.heartbeats, required this.bloodPressure, required this.alerts, required this.podometer, required this.contacts, required this.commands, required this.settings}); + + +@override final bool heartbeats; +@override final bool bloodPressure; +@override final DeviceCapabilitiesAlertEntity alerts; +@override final bool podometer; +@override final DeviceCapabilitiesContactsEntity contacts; +@override final DeviceCapabilitiesCommandsEntity commands; +@override final DeviceCapabilitiesSettingsEntity settings; + +/// Create a copy of DeviceCapabilitiesEntity +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$DeviceCapabilitiesEntityCopyWith<_DeviceCapabilitiesEntity> get copyWith => __$DeviceCapabilitiesEntityCopyWithImpl<_DeviceCapabilitiesEntity>(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceCapabilitiesEntity&&(identical(other.heartbeats, heartbeats) || other.heartbeats == heartbeats)&&(identical(other.bloodPressure, bloodPressure) || other.bloodPressure == bloodPressure)&&(identical(other.alerts, alerts) || other.alerts == alerts)&&(identical(other.podometer, podometer) || other.podometer == podometer)&&(identical(other.contacts, contacts) || other.contacts == contacts)&&(identical(other.commands, commands) || other.commands == commands)&&(identical(other.settings, settings) || other.settings == settings)); +} + + +@override +int get hashCode => Object.hash(runtimeType,heartbeats,bloodPressure,alerts,podometer,contacts,commands,settings); + +@override +String toString() { + return 'DeviceCapabilitiesEntity(heartbeats: $heartbeats, bloodPressure: $bloodPressure, alerts: $alerts, podometer: $podometer, contacts: $contacts, commands: $commands, settings: $settings)'; +} + + +} + +/// @nodoc +abstract mixin class _$DeviceCapabilitiesEntityCopyWith<$Res> implements $DeviceCapabilitiesEntityCopyWith<$Res> { + factory _$DeviceCapabilitiesEntityCopyWith(_DeviceCapabilitiesEntity value, $Res Function(_DeviceCapabilitiesEntity) _then) = __$DeviceCapabilitiesEntityCopyWithImpl; +@override @useResult +$Res call({ + bool heartbeats, bool bloodPressure, DeviceCapabilitiesAlertEntity alerts, bool podometer, DeviceCapabilitiesContactsEntity contacts, DeviceCapabilitiesCommandsEntity commands, DeviceCapabilitiesSettingsEntity settings +}); + + +@override $DeviceCapabilitiesAlertEntityCopyWith<$Res> get alerts;@override $DeviceCapabilitiesContactsEntityCopyWith<$Res> get contacts;@override $DeviceCapabilitiesCommandsEntityCopyWith<$Res> get commands;@override $DeviceCapabilitiesSettingsEntityCopyWith<$Res> get settings; + +} +/// @nodoc +class __$DeviceCapabilitiesEntityCopyWithImpl<$Res> + implements _$DeviceCapabilitiesEntityCopyWith<$Res> { + __$DeviceCapabilitiesEntityCopyWithImpl(this._self, this._then); + + final _DeviceCapabilitiesEntity _self; + final $Res Function(_DeviceCapabilitiesEntity) _then; + +/// Create a copy of DeviceCapabilitiesEntity +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? heartbeats = null,Object? bloodPressure = null,Object? alerts = null,Object? podometer = null,Object? contacts = null,Object? commands = null,Object? settings = null,}) { + return _then(_DeviceCapabilitiesEntity( +heartbeats: null == heartbeats ? _self.heartbeats : heartbeats // ignore: cast_nullable_to_non_nullable +as bool,bloodPressure: null == bloodPressure ? _self.bloodPressure : bloodPressure // ignore: cast_nullable_to_non_nullable +as bool,alerts: null == alerts ? _self.alerts : alerts // ignore: cast_nullable_to_non_nullable +as DeviceCapabilitiesAlertEntity,podometer: null == podometer ? _self.podometer : podometer // ignore: cast_nullable_to_non_nullable +as bool,contacts: null == contacts ? _self.contacts : contacts // ignore: cast_nullable_to_non_nullable +as DeviceCapabilitiesContactsEntity,commands: null == commands ? _self.commands : commands // ignore: cast_nullable_to_non_nullable +as DeviceCapabilitiesCommandsEntity,settings: null == settings ? _self.settings : settings // ignore: cast_nullable_to_non_nullable +as DeviceCapabilitiesSettingsEntity, + )); +} + +/// Create a copy of DeviceCapabilitiesEntity +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$DeviceCapabilitiesAlertEntityCopyWith<$Res> get alerts { + + return $DeviceCapabilitiesAlertEntityCopyWith<$Res>(_self.alerts, (value) { + return _then(_self.copyWith(alerts: value)); + }); +}/// Create a copy of DeviceCapabilitiesEntity +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$DeviceCapabilitiesContactsEntityCopyWith<$Res> get contacts { + + return $DeviceCapabilitiesContactsEntityCopyWith<$Res>(_self.contacts, (value) { + return _then(_self.copyWith(contacts: value)); + }); +}/// Create a copy of DeviceCapabilitiesEntity +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$DeviceCapabilitiesCommandsEntityCopyWith<$Res> get commands { + + return $DeviceCapabilitiesCommandsEntityCopyWith<$Res>(_self.commands, (value) { + return _then(_self.copyWith(commands: value)); + }); +}/// Create a copy of DeviceCapabilitiesEntity +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$DeviceCapabilitiesSettingsEntityCopyWith<$Res> get settings { + + return $DeviceCapabilitiesSettingsEntityCopyWith<$Res>(_self.settings, (value) { + return _then(_self.copyWith(settings: value)); + }); +} +} + +/// @nodoc +mixin _$DeviceCapabilitiesAlertEntity { + + bool get enabled; List get types; +/// Create a copy of DeviceCapabilitiesAlertEntity +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$DeviceCapabilitiesAlertEntityCopyWith get copyWith => _$DeviceCapabilitiesAlertEntityCopyWithImpl(this as DeviceCapabilitiesAlertEntity, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceCapabilitiesAlertEntity&&(identical(other.enabled, enabled) || other.enabled == enabled)&&const DeepCollectionEquality().equals(other.types, types)); +} + + +@override +int get hashCode => Object.hash(runtimeType,enabled,const DeepCollectionEquality().hash(types)); + +@override +String toString() { + return 'DeviceCapabilitiesAlertEntity(enabled: $enabled, types: $types)'; +} + + +} + +/// @nodoc +abstract mixin class $DeviceCapabilitiesAlertEntityCopyWith<$Res> { + factory $DeviceCapabilitiesAlertEntityCopyWith(DeviceCapabilitiesAlertEntity value, $Res Function(DeviceCapabilitiesAlertEntity) _then) = _$DeviceCapabilitiesAlertEntityCopyWithImpl; +@useResult +$Res call({ + bool enabled, List types +}); + + + + +} +/// @nodoc +class _$DeviceCapabilitiesAlertEntityCopyWithImpl<$Res> + implements $DeviceCapabilitiesAlertEntityCopyWith<$Res> { + _$DeviceCapabilitiesAlertEntityCopyWithImpl(this._self, this._then); + + final DeviceCapabilitiesAlertEntity _self; + final $Res Function(DeviceCapabilitiesAlertEntity) _then; + +/// Create a copy of DeviceCapabilitiesAlertEntity +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? enabled = null,Object? types = null,}) { + return _then(_self.copyWith( +enabled: null == enabled ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable +as bool,types: null == types ? _self.types : types // ignore: cast_nullable_to_non_nullable +as List, + )); +} + +} + + +/// Adds pattern-matching-related methods to [DeviceCapabilitiesAlertEntity]. +extension DeviceCapabilitiesAlertEntityPatterns on DeviceCapabilitiesAlertEntity { +/// 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 Function( _DeviceCapabilitiesAlertEntity value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _DeviceCapabilitiesAlertEntity() 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 Function( _DeviceCapabilitiesAlertEntity value) $default,){ +final _that = this; +switch (_that) { +case _DeviceCapabilitiesAlertEntity(): +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? Function( _DeviceCapabilitiesAlertEntity value)? $default,){ +final _that = this; +switch (_that) { +case _DeviceCapabilitiesAlertEntity() 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 Function( bool enabled, List types)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _DeviceCapabilitiesAlertEntity() when $default != null: +return $default(_that.enabled,_that.types);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 Function( bool enabled, List types) $default,) {final _that = this; +switch (_that) { +case _DeviceCapabilitiesAlertEntity(): +return $default(_that.enabled,_that.types);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? Function( bool enabled, List types)? $default,) {final _that = this; +switch (_that) { +case _DeviceCapabilitiesAlertEntity() when $default != null: +return $default(_that.enabled,_that.types);case _: + return null; + +} +} + +} + +/// @nodoc + + +class _DeviceCapabilitiesAlertEntity implements DeviceCapabilitiesAlertEntity { + const _DeviceCapabilitiesAlertEntity({required this.enabled, required final List types}): _types = types; + + +@override final bool enabled; + final List _types; +@override List get types { + if (_types is EqualUnmodifiableListView) return _types; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_types); +} + + +/// Create a copy of DeviceCapabilitiesAlertEntity +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$DeviceCapabilitiesAlertEntityCopyWith<_DeviceCapabilitiesAlertEntity> get copyWith => __$DeviceCapabilitiesAlertEntityCopyWithImpl<_DeviceCapabilitiesAlertEntity>(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceCapabilitiesAlertEntity&&(identical(other.enabled, enabled) || other.enabled == enabled)&&const DeepCollectionEquality().equals(other._types, _types)); +} + + +@override +int get hashCode => Object.hash(runtimeType,enabled,const DeepCollectionEquality().hash(_types)); + +@override +String toString() { + return 'DeviceCapabilitiesAlertEntity(enabled: $enabled, types: $types)'; +} + + +} + +/// @nodoc +abstract mixin class _$DeviceCapabilitiesAlertEntityCopyWith<$Res> implements $DeviceCapabilitiesAlertEntityCopyWith<$Res> { + factory _$DeviceCapabilitiesAlertEntityCopyWith(_DeviceCapabilitiesAlertEntity value, $Res Function(_DeviceCapabilitiesAlertEntity) _then) = __$DeviceCapabilitiesAlertEntityCopyWithImpl; +@override @useResult +$Res call({ + bool enabled, List types +}); + + + + +} +/// @nodoc +class __$DeviceCapabilitiesAlertEntityCopyWithImpl<$Res> + implements _$DeviceCapabilitiesAlertEntityCopyWith<$Res> { + __$DeviceCapabilitiesAlertEntityCopyWithImpl(this._self, this._then); + + final _DeviceCapabilitiesAlertEntity _self; + final $Res Function(_DeviceCapabilitiesAlertEntity) _then; + +/// Create a copy of DeviceCapabilitiesAlertEntity +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? enabled = null,Object? types = null,}) { + return _then(_DeviceCapabilitiesAlertEntity( +enabled: null == enabled ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable +as bool,types: null == types ? _self._types : types // ignore: cast_nullable_to_non_nullable +as List, + )); +} + + +} + +/// @nodoc +mixin _$DeviceCapabilitiesContactsEntity { + + bool get enabled; List get types; +/// Create a copy of DeviceCapabilitiesContactsEntity +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$DeviceCapabilitiesContactsEntityCopyWith get copyWith => _$DeviceCapabilitiesContactsEntityCopyWithImpl(this as DeviceCapabilitiesContactsEntity, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceCapabilitiesContactsEntity&&(identical(other.enabled, enabled) || other.enabled == enabled)&&const DeepCollectionEquality().equals(other.types, types)); +} + + +@override +int get hashCode => Object.hash(runtimeType,enabled,const DeepCollectionEquality().hash(types)); + +@override +String toString() { + return 'DeviceCapabilitiesContactsEntity(enabled: $enabled, types: $types)'; +} + + +} + +/// @nodoc +abstract mixin class $DeviceCapabilitiesContactsEntityCopyWith<$Res> { + factory $DeviceCapabilitiesContactsEntityCopyWith(DeviceCapabilitiesContactsEntity value, $Res Function(DeviceCapabilitiesContactsEntity) _then) = _$DeviceCapabilitiesContactsEntityCopyWithImpl; +@useResult +$Res call({ + bool enabled, List types +}); + + + + +} +/// @nodoc +class _$DeviceCapabilitiesContactsEntityCopyWithImpl<$Res> + implements $DeviceCapabilitiesContactsEntityCopyWith<$Res> { + _$DeviceCapabilitiesContactsEntityCopyWithImpl(this._self, this._then); + + final DeviceCapabilitiesContactsEntity _self; + final $Res Function(DeviceCapabilitiesContactsEntity) _then; + +/// Create a copy of DeviceCapabilitiesContactsEntity +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? enabled = null,Object? types = null,}) { + return _then(_self.copyWith( +enabled: null == enabled ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable +as bool,types: null == types ? _self.types : types // ignore: cast_nullable_to_non_nullable +as List, + )); +} + +} + + +/// Adds pattern-matching-related methods to [DeviceCapabilitiesContactsEntity]. +extension DeviceCapabilitiesContactsEntityPatterns on DeviceCapabilitiesContactsEntity { +/// 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 Function( _DeviceCapabilitiesContactsEntity value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _DeviceCapabilitiesContactsEntity() 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 Function( _DeviceCapabilitiesContactsEntity value) $default,){ +final _that = this; +switch (_that) { +case _DeviceCapabilitiesContactsEntity(): +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? Function( _DeviceCapabilitiesContactsEntity value)? $default,){ +final _that = this; +switch (_that) { +case _DeviceCapabilitiesContactsEntity() 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 Function( bool enabled, List types)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _DeviceCapabilitiesContactsEntity() when $default != null: +return $default(_that.enabled,_that.types);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 Function( bool enabled, List types) $default,) {final _that = this; +switch (_that) { +case _DeviceCapabilitiesContactsEntity(): +return $default(_that.enabled,_that.types);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? Function( bool enabled, List types)? $default,) {final _that = this; +switch (_that) { +case _DeviceCapabilitiesContactsEntity() when $default != null: +return $default(_that.enabled,_that.types);case _: + return null; + +} +} + +} + +/// @nodoc + + +class _DeviceCapabilitiesContactsEntity implements DeviceCapabilitiesContactsEntity { + const _DeviceCapabilitiesContactsEntity({required this.enabled, required final List types}): _types = types; + + +@override final bool enabled; + final List _types; +@override List get types { + if (_types is EqualUnmodifiableListView) return _types; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_types); +} + + +/// Create a copy of DeviceCapabilitiesContactsEntity +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$DeviceCapabilitiesContactsEntityCopyWith<_DeviceCapabilitiesContactsEntity> get copyWith => __$DeviceCapabilitiesContactsEntityCopyWithImpl<_DeviceCapabilitiesContactsEntity>(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceCapabilitiesContactsEntity&&(identical(other.enabled, enabled) || other.enabled == enabled)&&const DeepCollectionEquality().equals(other._types, _types)); +} + + +@override +int get hashCode => Object.hash(runtimeType,enabled,const DeepCollectionEquality().hash(_types)); + +@override +String toString() { + return 'DeviceCapabilitiesContactsEntity(enabled: $enabled, types: $types)'; +} + + +} + +/// @nodoc +abstract mixin class _$DeviceCapabilitiesContactsEntityCopyWith<$Res> implements $DeviceCapabilitiesContactsEntityCopyWith<$Res> { + factory _$DeviceCapabilitiesContactsEntityCopyWith(_DeviceCapabilitiesContactsEntity value, $Res Function(_DeviceCapabilitiesContactsEntity) _then) = __$DeviceCapabilitiesContactsEntityCopyWithImpl; +@override @useResult +$Res call({ + bool enabled, List types +}); + + + + +} +/// @nodoc +class __$DeviceCapabilitiesContactsEntityCopyWithImpl<$Res> + implements _$DeviceCapabilitiesContactsEntityCopyWith<$Res> { + __$DeviceCapabilitiesContactsEntityCopyWithImpl(this._self, this._then); + + final _DeviceCapabilitiesContactsEntity _self; + final $Res Function(_DeviceCapabilitiesContactsEntity) _then; + +/// Create a copy of DeviceCapabilitiesContactsEntity +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? enabled = null,Object? types = null,}) { + return _then(_DeviceCapabilitiesContactsEntity( +enabled: null == enabled ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable +as bool,types: null == types ? _self._types : types // ignore: cast_nullable_to_non_nullable +as List, + )); +} + + +} + +/// @nodoc +mixin _$DeviceCapabilitiesContactTypeEntity { + + String get type; int get amount; +/// Create a copy of DeviceCapabilitiesContactTypeEntity +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$DeviceCapabilitiesContactTypeEntityCopyWith get copyWith => _$DeviceCapabilitiesContactTypeEntityCopyWithImpl(this as DeviceCapabilitiesContactTypeEntity, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceCapabilitiesContactTypeEntity&&(identical(other.type, type) || other.type == type)&&(identical(other.amount, amount) || other.amount == amount)); +} + + +@override +int get hashCode => Object.hash(runtimeType,type,amount); + +@override +String toString() { + return 'DeviceCapabilitiesContactTypeEntity(type: $type, amount: $amount)'; +} + + +} + +/// @nodoc +abstract mixin class $DeviceCapabilitiesContactTypeEntityCopyWith<$Res> { + factory $DeviceCapabilitiesContactTypeEntityCopyWith(DeviceCapabilitiesContactTypeEntity value, $Res Function(DeviceCapabilitiesContactTypeEntity) _then) = _$DeviceCapabilitiesContactTypeEntityCopyWithImpl; +@useResult +$Res call({ + String type, int amount +}); + + + + +} +/// @nodoc +class _$DeviceCapabilitiesContactTypeEntityCopyWithImpl<$Res> + implements $DeviceCapabilitiesContactTypeEntityCopyWith<$Res> { + _$DeviceCapabilitiesContactTypeEntityCopyWithImpl(this._self, this._then); + + final DeviceCapabilitiesContactTypeEntity _self; + final $Res Function(DeviceCapabilitiesContactTypeEntity) _then; + +/// Create a copy of DeviceCapabilitiesContactTypeEntity +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? type = null,Object? amount = null,}) { + return _then(_self.copyWith( +type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String,amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as int, + )); +} + +} + + +/// Adds pattern-matching-related methods to [DeviceCapabilitiesContactTypeEntity]. +extension DeviceCapabilitiesContactTypeEntityPatterns on DeviceCapabilitiesContactTypeEntity { +/// 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 Function( _DeviceCapabilitiesContactTypeEntity value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _DeviceCapabilitiesContactTypeEntity() 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 Function( _DeviceCapabilitiesContactTypeEntity value) $default,){ +final _that = this; +switch (_that) { +case _DeviceCapabilitiesContactTypeEntity(): +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? Function( _DeviceCapabilitiesContactTypeEntity value)? $default,){ +final _that = this; +switch (_that) { +case _DeviceCapabilitiesContactTypeEntity() 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 Function( String type, int amount)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _DeviceCapabilitiesContactTypeEntity() when $default != null: +return $default(_that.type,_that.amount);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 Function( String type, int amount) $default,) {final _that = this; +switch (_that) { +case _DeviceCapabilitiesContactTypeEntity(): +return $default(_that.type,_that.amount);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? Function( String type, int amount)? $default,) {final _that = this; +switch (_that) { +case _DeviceCapabilitiesContactTypeEntity() when $default != null: +return $default(_that.type,_that.amount);case _: + return null; + +} +} + +} + +/// @nodoc + + +class _DeviceCapabilitiesContactTypeEntity implements DeviceCapabilitiesContactTypeEntity { + const _DeviceCapabilitiesContactTypeEntity({required this.type, required this.amount}); + + +@override final String type; +@override final int amount; + +/// Create a copy of DeviceCapabilitiesContactTypeEntity +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$DeviceCapabilitiesContactTypeEntityCopyWith<_DeviceCapabilitiesContactTypeEntity> get copyWith => __$DeviceCapabilitiesContactTypeEntityCopyWithImpl<_DeviceCapabilitiesContactTypeEntity>(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceCapabilitiesContactTypeEntity&&(identical(other.type, type) || other.type == type)&&(identical(other.amount, amount) || other.amount == amount)); +} + + +@override +int get hashCode => Object.hash(runtimeType,type,amount); + +@override +String toString() { + return 'DeviceCapabilitiesContactTypeEntity(type: $type, amount: $amount)'; +} + + +} + +/// @nodoc +abstract mixin class _$DeviceCapabilitiesContactTypeEntityCopyWith<$Res> implements $DeviceCapabilitiesContactTypeEntityCopyWith<$Res> { + factory _$DeviceCapabilitiesContactTypeEntityCopyWith(_DeviceCapabilitiesContactTypeEntity value, $Res Function(_DeviceCapabilitiesContactTypeEntity) _then) = __$DeviceCapabilitiesContactTypeEntityCopyWithImpl; +@override @useResult +$Res call({ + String type, int amount +}); + + + + +} +/// @nodoc +class __$DeviceCapabilitiesContactTypeEntityCopyWithImpl<$Res> + implements _$DeviceCapabilitiesContactTypeEntityCopyWith<$Res> { + __$DeviceCapabilitiesContactTypeEntityCopyWithImpl(this._self, this._then); + + final _DeviceCapabilitiesContactTypeEntity _self; + final $Res Function(_DeviceCapabilitiesContactTypeEntity) _then; + +/// Create a copy of DeviceCapabilitiesContactTypeEntity +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? type = null,Object? amount = null,}) { + return _then(_DeviceCapabilitiesContactTypeEntity( +type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String,amount: null == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable +as int, + )); +} + + +} + +/// @nodoc +mixin _$DeviceCapabilitiesCommandsEntity { + + bool get enabled; List get types; +/// Create a copy of DeviceCapabilitiesCommandsEntity +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$DeviceCapabilitiesCommandsEntityCopyWith get copyWith => _$DeviceCapabilitiesCommandsEntityCopyWithImpl(this as DeviceCapabilitiesCommandsEntity, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceCapabilitiesCommandsEntity&&(identical(other.enabled, enabled) || other.enabled == enabled)&&const DeepCollectionEquality().equals(other.types, types)); +} + + +@override +int get hashCode => Object.hash(runtimeType,enabled,const DeepCollectionEquality().hash(types)); + +@override +String toString() { + return 'DeviceCapabilitiesCommandsEntity(enabled: $enabled, types: $types)'; +} + + +} + +/// @nodoc +abstract mixin class $DeviceCapabilitiesCommandsEntityCopyWith<$Res> { + factory $DeviceCapabilitiesCommandsEntityCopyWith(DeviceCapabilitiesCommandsEntity value, $Res Function(DeviceCapabilitiesCommandsEntity) _then) = _$DeviceCapabilitiesCommandsEntityCopyWithImpl; +@useResult +$Res call({ + bool enabled, List types +}); + + + + +} +/// @nodoc +class _$DeviceCapabilitiesCommandsEntityCopyWithImpl<$Res> + implements $DeviceCapabilitiesCommandsEntityCopyWith<$Res> { + _$DeviceCapabilitiesCommandsEntityCopyWithImpl(this._self, this._then); + + final DeviceCapabilitiesCommandsEntity _self; + final $Res Function(DeviceCapabilitiesCommandsEntity) _then; + +/// Create a copy of DeviceCapabilitiesCommandsEntity +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? enabled = null,Object? types = null,}) { + return _then(_self.copyWith( +enabled: null == enabled ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable +as bool,types: null == types ? _self.types : types // ignore: cast_nullable_to_non_nullable +as List, + )); +} + +} + + +/// Adds pattern-matching-related methods to [DeviceCapabilitiesCommandsEntity]. +extension DeviceCapabilitiesCommandsEntityPatterns on DeviceCapabilitiesCommandsEntity { +/// 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 Function( _DeviceCapabilitiesCommandsEntity value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _DeviceCapabilitiesCommandsEntity() 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 Function( _DeviceCapabilitiesCommandsEntity value) $default,){ +final _that = this; +switch (_that) { +case _DeviceCapabilitiesCommandsEntity(): +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? Function( _DeviceCapabilitiesCommandsEntity value)? $default,){ +final _that = this; +switch (_that) { +case _DeviceCapabilitiesCommandsEntity() 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 Function( bool enabled, List types)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _DeviceCapabilitiesCommandsEntity() when $default != null: +return $default(_that.enabled,_that.types);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 Function( bool enabled, List types) $default,) {final _that = this; +switch (_that) { +case _DeviceCapabilitiesCommandsEntity(): +return $default(_that.enabled,_that.types);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? Function( bool enabled, List types)? $default,) {final _that = this; +switch (_that) { +case _DeviceCapabilitiesCommandsEntity() when $default != null: +return $default(_that.enabled,_that.types);case _: + return null; + +} +} + +} + +/// @nodoc + + +class _DeviceCapabilitiesCommandsEntity implements DeviceCapabilitiesCommandsEntity { + const _DeviceCapabilitiesCommandsEntity({required this.enabled, required final List types}): _types = types; + + +@override final bool enabled; + final List _types; +@override List get types { + if (_types is EqualUnmodifiableListView) return _types; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_types); +} + + +/// Create a copy of DeviceCapabilitiesCommandsEntity +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$DeviceCapabilitiesCommandsEntityCopyWith<_DeviceCapabilitiesCommandsEntity> get copyWith => __$DeviceCapabilitiesCommandsEntityCopyWithImpl<_DeviceCapabilitiesCommandsEntity>(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceCapabilitiesCommandsEntity&&(identical(other.enabled, enabled) || other.enabled == enabled)&&const DeepCollectionEquality().equals(other._types, _types)); +} + + +@override +int get hashCode => Object.hash(runtimeType,enabled,const DeepCollectionEquality().hash(_types)); + +@override +String toString() { + return 'DeviceCapabilitiesCommandsEntity(enabled: $enabled, types: $types)'; +} + + +} + +/// @nodoc +abstract mixin class _$DeviceCapabilitiesCommandsEntityCopyWith<$Res> implements $DeviceCapabilitiesCommandsEntityCopyWith<$Res> { + factory _$DeviceCapabilitiesCommandsEntityCopyWith(_DeviceCapabilitiesCommandsEntity value, $Res Function(_DeviceCapabilitiesCommandsEntity) _then) = __$DeviceCapabilitiesCommandsEntityCopyWithImpl; +@override @useResult +$Res call({ + bool enabled, List types +}); + + + + +} +/// @nodoc +class __$DeviceCapabilitiesCommandsEntityCopyWithImpl<$Res> + implements _$DeviceCapabilitiesCommandsEntityCopyWith<$Res> { + __$DeviceCapabilitiesCommandsEntityCopyWithImpl(this._self, this._then); + + final _DeviceCapabilitiesCommandsEntity _self; + final $Res Function(_DeviceCapabilitiesCommandsEntity) _then; + +/// Create a copy of DeviceCapabilitiesCommandsEntity +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? enabled = null,Object? types = null,}) { + return _then(_DeviceCapabilitiesCommandsEntity( +enabled: null == enabled ? _self.enabled : enabled // ignore: cast_nullable_to_non_nullable +as bool,types: null == types ? _self._types : types // ignore: cast_nullable_to_non_nullable +as List, + )); +} + + +} + +/// @nodoc +mixin _$DeviceCapabilitiesSettingsEntity { + + bool get locationFrequency; bool get timezone; bool get language; +/// Create a copy of DeviceCapabilitiesSettingsEntity +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$DeviceCapabilitiesSettingsEntityCopyWith get copyWith => _$DeviceCapabilitiesSettingsEntityCopyWithImpl(this as DeviceCapabilitiesSettingsEntity, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceCapabilitiesSettingsEntity&&(identical(other.locationFrequency, locationFrequency) || other.locationFrequency == locationFrequency)&&(identical(other.timezone, timezone) || other.timezone == timezone)&&(identical(other.language, language) || other.language == language)); +} + + +@override +int get hashCode => Object.hash(runtimeType,locationFrequency,timezone,language); + +@override +String toString() { + return 'DeviceCapabilitiesSettingsEntity(locationFrequency: $locationFrequency, timezone: $timezone, language: $language)'; +} + + +} + +/// @nodoc +abstract mixin class $DeviceCapabilitiesSettingsEntityCopyWith<$Res> { + factory $DeviceCapabilitiesSettingsEntityCopyWith(DeviceCapabilitiesSettingsEntity value, $Res Function(DeviceCapabilitiesSettingsEntity) _then) = _$DeviceCapabilitiesSettingsEntityCopyWithImpl; +@useResult +$Res call({ + bool locationFrequency, bool timezone, bool language +}); + + + + +} +/// @nodoc +class _$DeviceCapabilitiesSettingsEntityCopyWithImpl<$Res> + implements $DeviceCapabilitiesSettingsEntityCopyWith<$Res> { + _$DeviceCapabilitiesSettingsEntityCopyWithImpl(this._self, this._then); + + final DeviceCapabilitiesSettingsEntity _self; + final $Res Function(DeviceCapabilitiesSettingsEntity) _then; + +/// Create a copy of DeviceCapabilitiesSettingsEntity +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? locationFrequency = null,Object? timezone = null,Object? language = null,}) { + return _then(_self.copyWith( +locationFrequency: null == locationFrequency ? _self.locationFrequency : locationFrequency // ignore: cast_nullable_to_non_nullable +as bool,timezone: null == timezone ? _self.timezone : timezone // ignore: cast_nullable_to_non_nullable +as bool,language: null == language ? _self.language : language // ignore: cast_nullable_to_non_nullable +as bool, + )); +} + +} + + +/// Adds pattern-matching-related methods to [DeviceCapabilitiesSettingsEntity]. +extension DeviceCapabilitiesSettingsEntityPatterns on DeviceCapabilitiesSettingsEntity { +/// 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 Function( _DeviceCapabilitiesSettingsEntity value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _DeviceCapabilitiesSettingsEntity() 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 Function( _DeviceCapabilitiesSettingsEntity value) $default,){ +final _that = this; +switch (_that) { +case _DeviceCapabilitiesSettingsEntity(): +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? Function( _DeviceCapabilitiesSettingsEntity value)? $default,){ +final _that = this; +switch (_that) { +case _DeviceCapabilitiesSettingsEntity() 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 Function( bool locationFrequency, bool timezone, bool language)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _DeviceCapabilitiesSettingsEntity() when $default != null: +return $default(_that.locationFrequency,_that.timezone,_that.language);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 Function( bool locationFrequency, bool timezone, bool language) $default,) {final _that = this; +switch (_that) { +case _DeviceCapabilitiesSettingsEntity(): +return $default(_that.locationFrequency,_that.timezone,_that.language);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? Function( bool locationFrequency, bool timezone, bool language)? $default,) {final _that = this; +switch (_that) { +case _DeviceCapabilitiesSettingsEntity() when $default != null: +return $default(_that.locationFrequency,_that.timezone,_that.language);case _: + return null; + +} +} + +} + +/// @nodoc + + +class _DeviceCapabilitiesSettingsEntity implements DeviceCapabilitiesSettingsEntity { + const _DeviceCapabilitiesSettingsEntity({required this.locationFrequency, required this.timezone, required this.language}); + + +@override final bool locationFrequency; +@override final bool timezone; +@override final bool language; + +/// Create a copy of DeviceCapabilitiesSettingsEntity +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$DeviceCapabilitiesSettingsEntityCopyWith<_DeviceCapabilitiesSettingsEntity> get copyWith => __$DeviceCapabilitiesSettingsEntityCopyWithImpl<_DeviceCapabilitiesSettingsEntity>(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceCapabilitiesSettingsEntity&&(identical(other.locationFrequency, locationFrequency) || other.locationFrequency == locationFrequency)&&(identical(other.timezone, timezone) || other.timezone == timezone)&&(identical(other.language, language) || other.language == language)); +} + + +@override +int get hashCode => Object.hash(runtimeType,locationFrequency,timezone,language); + +@override +String toString() { + return 'DeviceCapabilitiesSettingsEntity(locationFrequency: $locationFrequency, timezone: $timezone, language: $language)'; +} + + +} + +/// @nodoc +abstract mixin class _$DeviceCapabilitiesSettingsEntityCopyWith<$Res> implements $DeviceCapabilitiesSettingsEntityCopyWith<$Res> { + factory _$DeviceCapabilitiesSettingsEntityCopyWith(_DeviceCapabilitiesSettingsEntity value, $Res Function(_DeviceCapabilitiesSettingsEntity) _then) = __$DeviceCapabilitiesSettingsEntityCopyWithImpl; +@override @useResult +$Res call({ + bool locationFrequency, bool timezone, bool language +}); + + + + +} +/// @nodoc +class __$DeviceCapabilitiesSettingsEntityCopyWithImpl<$Res> + implements _$DeviceCapabilitiesSettingsEntityCopyWith<$Res> { + __$DeviceCapabilitiesSettingsEntityCopyWithImpl(this._self, this._then); + + final _DeviceCapabilitiesSettingsEntity _self; + final $Res Function(_DeviceCapabilitiesSettingsEntity) _then; + +/// Create a copy of DeviceCapabilitiesSettingsEntity +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? locationFrequency = null,Object? timezone = null,Object? language = null,}) { + return _then(_DeviceCapabilitiesSettingsEntity( +locationFrequency: null == locationFrequency ? _self.locationFrequency : locationFrequency // ignore: cast_nullable_to_non_nullable +as bool,timezone: null == timezone ? _self.timezone : timezone // ignore: cast_nullable_to_non_nullable +as bool,language: null == language ? _self.language : language // ignore: cast_nullable_to_non_nullable +as bool, + )); +} + + +} + +// dart format on diff --git a/modules/legacy/packages/legacy_shared/lib/src/providers/selected_device_provider.dart b/modules/legacy/packages/legacy_shared/lib/src/providers/selected_device_provider.dart new file mode 100644 index 00000000..860393cd --- /dev/null +++ b/modules/legacy/packages/legacy_shared/lib/src/providers/selected_device_provider.dart @@ -0,0 +1,18 @@ +import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:legacy_shared/src/data/models/entities/device_entity.dart'; + +final selectedDeviceProvider = NotifierProvider( + SelectedDeviceNotifier.new, +); + +class SelectedDeviceNotifier extends Notifier { + + @override + DeviceEntity? build() { + return null; + } + + void setSelectedDevice(DeviceEntity device) { + state = device; + } +} diff --git a/modules/legacy/packages/legacy_shared/lib/src/widgets/layouts/page_layout.dart b/modules/legacy/packages/legacy_shared/lib/src/widgets/layouts/page_layout.dart index 52564e18..08732649 100644 --- a/modules/legacy/packages/legacy_shared/lib/src/widgets/layouts/page_layout.dart +++ b/modules/legacy/packages/legacy_shared/lib/src/widgets/layouts/page_layout.dart @@ -6,12 +6,16 @@ class PageLayout extends StatelessWidget{ final String title; final Widget body; final Widget? footer; + final bool showEdit; + final VoidCallback? onEditChange; const PageLayout({ super.key, required this.title, required this.body, - this.footer + this.footer, + this.showEdit = false, + this.onEditChange }); @override @@ -28,12 +32,30 @@ class PageLayout extends StatelessWidget{ ), child: Stack( children: [ - IconButton(onPressed: () {Navigator.pop(context);}, - icon: Icon(Icons.arrow_back, - color: Color(0xFF588EA5), - size: 32, - ), - padding: EdgeInsets.zero, + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + IconButton(onPressed: () {Navigator.pop(context);}, + icon: Icon(Icons.arrow_back, + color: Color(0xFF588EA5), + size: 32, + ), + padding: EdgeInsets.zero, + ), + if (showEdit) + DecoratedBox( + decoration: BoxDecoration( + color: Color(0xFF588EA5), + shape: BoxShape.circle + ), + child: IconButton(onPressed: onEditChange, + icon: Icon(Icons.edit_outlined, + color: Colors.white, + size: SizeUtils.getByScreen(small: 30, big: 28), + ) + ), + ) + ], ), SizedBox( height: 50, diff --git a/packages/sf_localizations/assets/l10n/en.json b/packages/sf_localizations/assets/l10n/en.json index 2228d99c..81cd554c 100755 --- a/packages/sf_localizations/assets/l10n/en.json +++ b/packages/sf_localizations/assets/l10n/en.json @@ -167,7 +167,6 @@ "userNameLabel": "User name", "userPhoneLabel": "User phone number", "contactEmailLabel": "Contact email", - "passwordLabel": "Password (6 to 12 digits)", "submit": "Submit", "save": "Save", "editDeviceTitle": "Edit Device", diff --git a/packages/sf_localizations/assets/l10n/es.json b/packages/sf_localizations/assets/l10n/es.json index bf90f499..1a142310 100644 --- a/packages/sf_localizations/assets/l10n/es.json +++ b/packages/sf_localizations/assets/l10n/es.json @@ -164,9 +164,6 @@ "deleteAccount": "Eliminar cuenta", "logOut": "Cerrar sesión", "loginEmail": "(Correo electrónico)", - "userNameLabel": "Nombre del usuario", - "userPhoneLabel": "Número de teléfono del usuario", - "contactEmailLabel": "Correo de contacto", "passwordLabel": "Contraseña (de 6 a 12 caracteres)", "submit": "Enviar", "save": "Guardar", diff --git a/packages/sf_localizations/lib/src/generated/i18n.dart b/packages/sf_localizations/lib/src/generated/i18n.dart index b27bdf70..d0631f95 100755 --- a/packages/sf_localizations/lib/src/generated/i18n.dart +++ b/packages/sf_localizations/lib/src/generated/i18n.dart @@ -191,10 +191,6 @@ class I18n { static const String legacyAppUsers = 'appUsers'; static const String legacyPrivacyPolicy = 'privacyPolicy'; static const String legacyLogOut = 'logOut'; - static const String legacyLoginEmail = 'loginEmail'; - static const String legacyUserNameLabel = 'userNameLabel'; - static const String legacyUserPhoneLabel = 'userPhoneLabel'; - static const String legacyContactEmailLabel = 'contactEmailLabel'; static const String passwordLabel = 'passwordLabel'; static const String legacySubmit = 'submit'; static const String legacySave = 'save';