From 48d2430c9cd522a47dbf33b74a39c002f95c00ee Mon Sep 17 00:00:00 2001 From: aitorarana Date: Wed, 18 Mar 2026 17:09:03 +0100 Subject: [PATCH] remote call command --- .../device_management_screen.dart | 16 +++---- .../domain/get_pictures_use_case.dart | 5 --- .../domain/get_pictures_use_case_impl.dart | 44 ------------------- .../domain/take_picture_use_case.dart | 5 --- .../domain/take_picture_use_case_impl.dart | 14 ------ .../get_pictures_use_case_provider.dart | 9 ---- .../take_picture_use_case_provider.dart | 9 ---- .../state/remote_connection_view_model.dart | 39 ++++++++++++---- .../state/remote_connection_view_state.dart | 1 + .../remote_connection_view_state.freezed.dart | 43 +++++++++--------- .../models/send_command_request_model.dart | 2 + 11 files changed, 65 insertions(+), 122 deletions(-) delete mode 100644 modules/legacy/modules/device_management/lib/src/features/remote_connection/domain/get_pictures_use_case.dart delete mode 100644 modules/legacy/modules/device_management/lib/src/features/remote_connection/domain/get_pictures_use_case_impl.dart delete mode 100644 modules/legacy/modules/device_management/lib/src/features/remote_connection/domain/take_picture_use_case.dart delete mode 100644 modules/legacy/modules/device_management/lib/src/features/remote_connection/domain/take_picture_use_case_impl.dart delete mode 100644 modules/legacy/modules/device_management/lib/src/features/remote_connection/presentation/providers/get_pictures_use_case_provider.dart delete mode 100644 modules/legacy/modules/device_management/lib/src/features/remote_connection/presentation/providers/take_picture_use_case_provider.dart diff --git a/modules/legacy/modules/device_management/lib/src/features/device_management/device_management_screen.dart b/modules/legacy/modules/device_management/lib/src/features/device_management/device_management_screen.dart index 8b68f252..d3f2a350 100644 --- a/modules/legacy/modules/device_management/lib/src/features/device_management/device_management_screen.dart +++ b/modules/legacy/modules/device_management/lib/src/features/device_management/device_management_screen.dart @@ -27,14 +27,14 @@ class DeviceManagementScreen extends ConsumerWidget { ), child: Column( children: [ - // AppMenuButton( - // color: theme.getColorFor(ThemeCode.legacyPrimary), - // onPressed: () => - // navigationContract.pushTo(AppRoutes.remoteConnection), - // icon: SFIcons.connection, - // text: context.translate(I18n.remoteConnection), - // ), - // SizedBox(height: SizeUtils.getByScreen(small: 16, big: 15)), + AppMenuButton( + color: theme.getColorFor(ThemeCode.legacyPrimary), + onPressed: () => + navigationContract.pushTo(AppRoutes.remoteConnection), + icon: SFIcons.connection, + text: context.translate(I18n.remoteConnection), + ), + SizedBox(height: SizeUtils.getByScreen(small: 16, big: 15)), AppMenuButton( color: theme.getColorFor(ThemeCode.legacyPrimary), onPressed: () => diff --git a/modules/legacy/modules/device_management/lib/src/features/remote_connection/domain/get_pictures_use_case.dart b/modules/legacy/modules/device_management/lib/src/features/remote_connection/domain/get_pictures_use_case.dart deleted file mode 100644 index 73c57508..00000000 --- a/modules/legacy/modules/device_management/lib/src/features/remote_connection/domain/get_pictures_use_case.dart +++ /dev/null @@ -1,5 +0,0 @@ -import 'package:device_management/src/features/remote_connection/domain/entities/picture_entity.dart'; - -abstract class GetPicturesUseCase { - Future> getPictures({required String userId}); -} diff --git a/modules/legacy/modules/device_management/lib/src/features/remote_connection/domain/get_pictures_use_case_impl.dart b/modules/legacy/modules/device_management/lib/src/features/remote_connection/domain/get_pictures_use_case_impl.dart deleted file mode 100644 index fb37593e..00000000 --- a/modules/legacy/modules/device_management/lib/src/features/remote_connection/domain/get_pictures_use_case_impl.dart +++ /dev/null @@ -1,44 +0,0 @@ -import 'package:device_management/src/core/domain/repositories/functions_repository.dart'; -import 'package:device_management/src/features/remote_connection/domain/entities/picture_entity.dart'; -import 'package:device_management/src/features/remote_connection/domain/get_pictures_use_case.dart'; - -class GetPicturesUseCaseImpl implements GetPicturesUseCase { - GetPicturesUseCaseImpl(this._repository); - - final FunctionsRepository _repository; - - @override - Future> getPictures({required String userId}) async { - // return _repository.getPictures(userId: userId); - return [ - PictureEntity( - id: '1', - deviceId: '1111', - createdAt: DateTime.now(), - asset: 'assets/shared/images/iso_sf.png', - takenAt: DateTime.now(), - ), - PictureEntity( - id: '2', - deviceId: '1111', - createdAt: DateTime.now(), - asset: 'assets/shared/images/iso_sf.png', - takenAt: DateTime.now(), - ), - PictureEntity( - id: '3', - deviceId: '1111', - createdAt: DateTime.now(), - asset: 'assets/shared/images/iso_sf.png', - takenAt: DateTime.now(), - ), - PictureEntity( - id: '4', - deviceId: '1111', - createdAt: DateTime.now(), - asset: 'assets/shared/images/iso_sf.png', - takenAt: DateTime.now(), - ), - ]; - } -} diff --git a/modules/legacy/modules/device_management/lib/src/features/remote_connection/domain/take_picture_use_case.dart b/modules/legacy/modules/device_management/lib/src/features/remote_connection/domain/take_picture_use_case.dart deleted file mode 100644 index aaef5b9d..00000000 --- a/modules/legacy/modules/device_management/lib/src/features/remote_connection/domain/take_picture_use_case.dart +++ /dev/null @@ -1,5 +0,0 @@ -import 'package:device_management/src/features/remote_connection/domain/entities/picture_entity.dart'; - -abstract class TakePictureUseCase { - Future takePicture({required String userId}); -} diff --git a/modules/legacy/modules/device_management/lib/src/features/remote_connection/domain/take_picture_use_case_impl.dart b/modules/legacy/modules/device_management/lib/src/features/remote_connection/domain/take_picture_use_case_impl.dart deleted file mode 100644 index 7a1b7a81..00000000 --- a/modules/legacy/modules/device_management/lib/src/features/remote_connection/domain/take_picture_use_case_impl.dart +++ /dev/null @@ -1,14 +0,0 @@ -import 'package:device_management/src/core/domain/repositories/functions_repository.dart'; -import 'package:device_management/src/features/remote_connection/domain/entities/picture_entity.dart'; -import 'package:device_management/src/features/remote_connection/domain/take_picture_use_case.dart'; - -class TakePictureUseCaseImpl implements TakePictureUseCase { - TakePictureUseCaseImpl(this._repository); - - final FunctionsRepository _repository; - - @override - Future takePicture({required String userId}) { - return _repository.takePicture(userId: userId); - } -} \ No newline at end of file diff --git a/modules/legacy/modules/device_management/lib/src/features/remote_connection/presentation/providers/get_pictures_use_case_provider.dart b/modules/legacy/modules/device_management/lib/src/features/remote_connection/presentation/providers/get_pictures_use_case_provider.dart deleted file mode 100644 index 9af3b9aa..00000000 --- a/modules/legacy/modules/device_management/lib/src/features/remote_connection/presentation/providers/get_pictures_use_case_provider.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:device_management/src/core/providers/functions_repository_provider.dart'; -import 'package:device_management/src/features/remote_connection/domain/get_pictures_use_case.dart'; -import 'package:device_management/src/features/remote_connection/domain/get_pictures_use_case_impl.dart'; - -final getPicturesUseCaseProvider = Provider.autoDispose((ref) { - final functionsRepository = ref.read(functionsRepositoryProvider); - return GetPicturesUseCaseImpl(functionsRepository); -}); diff --git a/modules/legacy/modules/device_management/lib/src/features/remote_connection/presentation/providers/take_picture_use_case_provider.dart b/modules/legacy/modules/device_management/lib/src/features/remote_connection/presentation/providers/take_picture_use_case_provider.dart deleted file mode 100644 index 01ab9f5e..00000000 --- a/modules/legacy/modules/device_management/lib/src/features/remote_connection/presentation/providers/take_picture_use_case_provider.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:device_management/src/core/providers/functions_repository_provider.dart'; -import 'package:device_management/src/features/remote_connection/domain/take_picture_use_case.dart'; -import 'package:device_management/src/features/remote_connection/domain/take_picture_use_case_impl.dart'; - -final takePictureUseCaseProvider = Provider.autoDispose((ref) { - final functionsRepository = ref.read(functionsRepositoryProvider); - return TakePictureUseCaseImpl(functionsRepository); -}); diff --git a/modules/legacy/modules/device_management/lib/src/features/remote_connection/presentation/state/remote_connection_view_model.dart b/modules/legacy/modules/device_management/lib/src/features/remote_connection/presentation/state/remote_connection_view_model.dart index 2ff4e4df..234fa38f 100644 --- a/modules/legacy/modules/device_management/lib/src/features/remote_connection/presentation/state/remote_connection_view_model.dart +++ b/modules/legacy/modules/device_management/lib/src/features/remote_connection/presentation/state/remote_connection_view_model.dart @@ -1,10 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:device_management/src/features/remote_connection/domain/entities/picture_entity.dart'; -import 'package:device_management/src/features/remote_connection/domain/get_pictures_use_case.dart'; -import 'package:device_management/src/features/remote_connection/domain/take_picture_use_case.dart'; -import 'package:device_management/src/features/remote_connection/presentation/providers/get_pictures_use_case_provider.dart'; -import 'package:device_management/src/features/remote_connection/presentation/providers/take_picture_use_case_provider.dart'; import 'package:device_management/src/features/remote_connection/presentation/state/remote_connection_view_state.dart'; import 'package:legacy_shared/legacy_shared.dart'; import 'package:sf_shared/sf_shared.dart'; @@ -15,17 +11,15 @@ NotifierProvider.autoDispose { - late final GetPicturesUseCase _getPicturesUseCase; - late final TakePictureUseCase _takePictureUseCase; late final TextEditingController phoneController; + late final CommandsRepository _commandsRepository; static final RegExp _phoneRegex = RegExp(r'^\+?\d{6,15}$'); @override RemoteConnectionViewState build() { - _getPicturesUseCase = ref.read(getPicturesUseCaseProvider); - _takePictureUseCase = ref.read(takePictureUseCaseProvider); + _commandsRepository = ref.read(commandsRepositoryProvider); phoneController = TextEditingController(); phoneController.addListener(_onPhoneChanged); @@ -106,6 +100,7 @@ class RemoteConnectionViewModel extends Notifier { Future call() async { final phone = phoneController.text; + final dialCode = state.dialCode; if (phone.isEmpty){ state = state.copyWith(errorMessage: 'errorMessagePhoneIsEmpty'); return; @@ -114,6 +109,34 @@ class RemoteConnectionViewModel extends Notifier { state = state.copyWith(errorMessage: 'errorMessagePhoneIsInvalid'); return; } + + final identificator = ref.read(selectedDeviceProvider)?.identificator; + if (identificator == null) { + return; + } + + try { + state = state.copyWith( + isCalling: true, + ); + + final fullPhone = dialCode + phone; + final request = SendCommandRequestModel( + device: identificator, + command: DeviceCommand.callCenter, + data: { + 'phone_number': fullPhone, + } + ); + _commandsRepository.send(request: request); + + } catch (e) { + state = state.copyWith( + isCalling: false, + errorMessage: e.toString(), + ); + } + } void disposeControllers() { diff --git a/modules/legacy/modules/device_management/lib/src/features/remote_connection/presentation/state/remote_connection_view_state.dart b/modules/legacy/modules/device_management/lib/src/features/remote_connection/presentation/state/remote_connection_view_state.dart index 687e65d4..6c7b2424 100644 --- a/modules/legacy/modules/device_management/lib/src/features/remote_connection/presentation/state/remote_connection_view_state.dart +++ b/modules/legacy/modules/device_management/lib/src/features/remote_connection/presentation/state/remote_connection_view_state.dart @@ -6,6 +6,7 @@ part 'remote_connection_view_state.freezed.dart'; @freezed abstract class RemoteConnectionViewState with _$RemoteConnectionViewState { const factory RemoteConnectionViewState({ + @Default('+34') String dialCode, @Default('') String phone, @Default([]) List pictures, @Default(0) int pictureIndex, diff --git a/modules/legacy/modules/device_management/lib/src/features/remote_connection/presentation/state/remote_connection_view_state.freezed.dart b/modules/legacy/modules/device_management/lib/src/features/remote_connection/presentation/state/remote_connection_view_state.freezed.dart index b578eb3a..aa284843 100644 --- a/modules/legacy/modules/device_management/lib/src/features/remote_connection/presentation/state/remote_connection_view_state.freezed.dart +++ b/modules/legacy/modules/device_management/lib/src/features/remote_connection/presentation/state/remote_connection_view_state.freezed.dart @@ -14,7 +14,7 @@ T _$identity(T value) => value; /// @nodoc mixin _$RemoteConnectionViewState { - String get phone; List get pictures; int get pictureIndex; bool get isLoadingPictures; bool get isTakingPicture; bool get isCalling; String get errorMessage; + String get dialCode; String get phone; List get pictures; int get pictureIndex; bool get isLoadingPictures; bool get isTakingPicture; bool get isCalling; String get errorMessage; /// Create a copy of RemoteConnectionViewState /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -25,16 +25,16 @@ $RemoteConnectionViewStateCopyWith get copyWith => _$ @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is RemoteConnectionViewState&&(identical(other.phone, phone) || other.phone == phone)&&const DeepCollectionEquality().equals(other.pictures, pictures)&&(identical(other.pictureIndex, pictureIndex) || other.pictureIndex == pictureIndex)&&(identical(other.isLoadingPictures, isLoadingPictures) || other.isLoadingPictures == isLoadingPictures)&&(identical(other.isTakingPicture, isTakingPicture) || other.isTakingPicture == isTakingPicture)&&(identical(other.isCalling, isCalling) || other.isCalling == isCalling)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is RemoteConnectionViewState&&(identical(other.dialCode, dialCode) || other.dialCode == dialCode)&&(identical(other.phone, phone) || other.phone == phone)&&const DeepCollectionEquality().equals(other.pictures, pictures)&&(identical(other.pictureIndex, pictureIndex) || other.pictureIndex == pictureIndex)&&(identical(other.isLoadingPictures, isLoadingPictures) || other.isLoadingPictures == isLoadingPictures)&&(identical(other.isTakingPicture, isTakingPicture) || other.isTakingPicture == isTakingPicture)&&(identical(other.isCalling, isCalling) || other.isCalling == isCalling)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override -int get hashCode => Object.hash(runtimeType,phone,const DeepCollectionEquality().hash(pictures),pictureIndex,isLoadingPictures,isTakingPicture,isCalling,errorMessage); +int get hashCode => Object.hash(runtimeType,dialCode,phone,const DeepCollectionEquality().hash(pictures),pictureIndex,isLoadingPictures,isTakingPicture,isCalling,errorMessage); @override String toString() { - return 'RemoteConnectionViewState(phone: $phone, pictures: $pictures, pictureIndex: $pictureIndex, isLoadingPictures: $isLoadingPictures, isTakingPicture: $isTakingPicture, isCalling: $isCalling, errorMessage: $errorMessage)'; + return 'RemoteConnectionViewState(dialCode: $dialCode, phone: $phone, pictures: $pictures, pictureIndex: $pictureIndex, isLoadingPictures: $isLoadingPictures, isTakingPicture: $isTakingPicture, isCalling: $isCalling, errorMessage: $errorMessage)'; } @@ -45,7 +45,7 @@ abstract mixin class $RemoteConnectionViewStateCopyWith<$Res> { factory $RemoteConnectionViewStateCopyWith(RemoteConnectionViewState value, $Res Function(RemoteConnectionViewState) _then) = _$RemoteConnectionViewStateCopyWithImpl; @useResult $Res call({ - String phone, List pictures, int pictureIndex, bool isLoadingPictures, bool isTakingPicture, bool isCalling, String errorMessage + String dialCode, String phone, List pictures, int pictureIndex, bool isLoadingPictures, bool isTakingPicture, bool isCalling, String errorMessage }); @@ -62,9 +62,10 @@ class _$RemoteConnectionViewStateCopyWithImpl<$Res> /// Create a copy of RemoteConnectionViewState /// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? phone = null,Object? pictures = null,Object? pictureIndex = null,Object? isLoadingPictures = null,Object? isTakingPicture = null,Object? isCalling = null,Object? errorMessage = null,}) { +@pragma('vm:prefer-inline') @override $Res call({Object? dialCode = null,Object? phone = null,Object? pictures = null,Object? pictureIndex = null,Object? isLoadingPictures = null,Object? isTakingPicture = null,Object? isCalling = null,Object? errorMessage = null,}) { return _then(_self.copyWith( -phone: null == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +dialCode: null == dialCode ? _self.dialCode : dialCode // ignore: cast_nullable_to_non_nullable +as String,phone: null == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable as String,pictures: null == pictures ? _self.pictures : pictures // ignore: cast_nullable_to_non_nullable as List,pictureIndex: null == pictureIndex ? _self.pictureIndex : pictureIndex // ignore: cast_nullable_to_non_nullable as int,isLoadingPictures: null == isLoadingPictures ? _self.isLoadingPictures : isLoadingPictures // ignore: cast_nullable_to_non_nullable @@ -156,10 +157,10 @@ return $default(_that);case _: /// } /// ``` -@optionalTypeArgs TResult maybeWhen(TResult Function( String phone, List pictures, int pictureIndex, bool isLoadingPictures, bool isTakingPicture, bool isCalling, String errorMessage)? $default,{required TResult orElse(),}) {final _that = this; +@optionalTypeArgs TResult maybeWhen(TResult Function( String dialCode, String phone, List pictures, int pictureIndex, bool isLoadingPictures, bool isTakingPicture, bool isCalling, String errorMessage)? $default,{required TResult orElse(),}) {final _that = this; switch (_that) { case _RemoteConnectionViewState() when $default != null: -return $default(_that.phone,_that.pictures,_that.pictureIndex,_that.isLoadingPictures,_that.isTakingPicture,_that.isCalling,_that.errorMessage);case _: +return $default(_that.dialCode,_that.phone,_that.pictures,_that.pictureIndex,_that.isLoadingPictures,_that.isTakingPicture,_that.isCalling,_that.errorMessage);case _: return orElse(); } @@ -177,10 +178,10 @@ return $default(_that.phone,_that.pictures,_that.pictureIndex,_that.isLoadingPic /// } /// ``` -@optionalTypeArgs TResult when(TResult Function( String phone, List pictures, int pictureIndex, bool isLoadingPictures, bool isTakingPicture, bool isCalling, String errorMessage) $default,) {final _that = this; +@optionalTypeArgs TResult when(TResult Function( String dialCode, String phone, List pictures, int pictureIndex, bool isLoadingPictures, bool isTakingPicture, bool isCalling, String errorMessage) $default,) {final _that = this; switch (_that) { case _RemoteConnectionViewState(): -return $default(_that.phone,_that.pictures,_that.pictureIndex,_that.isLoadingPictures,_that.isTakingPicture,_that.isCalling,_that.errorMessage);case _: +return $default(_that.dialCode,_that.phone,_that.pictures,_that.pictureIndex,_that.isLoadingPictures,_that.isTakingPicture,_that.isCalling,_that.errorMessage);case _: throw StateError('Unexpected subclass'); } @@ -197,10 +198,10 @@ return $default(_that.phone,_that.pictures,_that.pictureIndex,_that.isLoadingPic /// } /// ``` -@optionalTypeArgs TResult? whenOrNull(TResult? Function( String phone, List pictures, int pictureIndex, bool isLoadingPictures, bool isTakingPicture, bool isCalling, String errorMessage)? $default,) {final _that = this; +@optionalTypeArgs TResult? whenOrNull(TResult? Function( String dialCode, String phone, List pictures, int pictureIndex, bool isLoadingPictures, bool isTakingPicture, bool isCalling, String errorMessage)? $default,) {final _that = this; switch (_that) { case _RemoteConnectionViewState() when $default != null: -return $default(_that.phone,_that.pictures,_that.pictureIndex,_that.isLoadingPictures,_that.isTakingPicture,_that.isCalling,_that.errorMessage);case _: +return $default(_that.dialCode,_that.phone,_that.pictures,_that.pictureIndex,_that.isLoadingPictures,_that.isTakingPicture,_that.isCalling,_that.errorMessage);case _: return null; } @@ -212,9 +213,10 @@ return $default(_that.phone,_that.pictures,_that.pictureIndex,_that.isLoadingPic class _RemoteConnectionViewState implements RemoteConnectionViewState { - const _RemoteConnectionViewState({this.phone = '', final List pictures = const [], this.pictureIndex = 0, this.isLoadingPictures = true, this.isTakingPicture = false, this.isCalling = false, this.errorMessage = ''}): _pictures = pictures; + const _RemoteConnectionViewState({this.dialCode = '+34', this.phone = '', final List pictures = const [], this.pictureIndex = 0, this.isLoadingPictures = true, this.isTakingPicture = false, this.isCalling = false, this.errorMessage = ''}): _pictures = pictures; +@override@JsonKey() final String dialCode; @override@JsonKey() final String phone; final List _pictures; @override@JsonKey() List get pictures { @@ -239,16 +241,16 @@ _$RemoteConnectionViewStateCopyWith<_RemoteConnectionViewState> get copyWith => @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _RemoteConnectionViewState&&(identical(other.phone, phone) || other.phone == phone)&&const DeepCollectionEquality().equals(other._pictures, _pictures)&&(identical(other.pictureIndex, pictureIndex) || other.pictureIndex == pictureIndex)&&(identical(other.isLoadingPictures, isLoadingPictures) || other.isLoadingPictures == isLoadingPictures)&&(identical(other.isTakingPicture, isTakingPicture) || other.isTakingPicture == isTakingPicture)&&(identical(other.isCalling, isCalling) || other.isCalling == isCalling)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is _RemoteConnectionViewState&&(identical(other.dialCode, dialCode) || other.dialCode == dialCode)&&(identical(other.phone, phone) || other.phone == phone)&&const DeepCollectionEquality().equals(other._pictures, _pictures)&&(identical(other.pictureIndex, pictureIndex) || other.pictureIndex == pictureIndex)&&(identical(other.isLoadingPictures, isLoadingPictures) || other.isLoadingPictures == isLoadingPictures)&&(identical(other.isTakingPicture, isTakingPicture) || other.isTakingPicture == isTakingPicture)&&(identical(other.isCalling, isCalling) || other.isCalling == isCalling)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)); } @override -int get hashCode => Object.hash(runtimeType,phone,const DeepCollectionEquality().hash(_pictures),pictureIndex,isLoadingPictures,isTakingPicture,isCalling,errorMessage); +int get hashCode => Object.hash(runtimeType,dialCode,phone,const DeepCollectionEquality().hash(_pictures),pictureIndex,isLoadingPictures,isTakingPicture,isCalling,errorMessage); @override String toString() { - return 'RemoteConnectionViewState(phone: $phone, pictures: $pictures, pictureIndex: $pictureIndex, isLoadingPictures: $isLoadingPictures, isTakingPicture: $isTakingPicture, isCalling: $isCalling, errorMessage: $errorMessage)'; + return 'RemoteConnectionViewState(dialCode: $dialCode, phone: $phone, pictures: $pictures, pictureIndex: $pictureIndex, isLoadingPictures: $isLoadingPictures, isTakingPicture: $isTakingPicture, isCalling: $isCalling, errorMessage: $errorMessage)'; } @@ -259,7 +261,7 @@ abstract mixin class _$RemoteConnectionViewStateCopyWith<$Res> implements $Remot factory _$RemoteConnectionViewStateCopyWith(_RemoteConnectionViewState value, $Res Function(_RemoteConnectionViewState) _then) = __$RemoteConnectionViewStateCopyWithImpl; @override @useResult $Res call({ - String phone, List pictures, int pictureIndex, bool isLoadingPictures, bool isTakingPicture, bool isCalling, String errorMessage + String dialCode, String phone, List pictures, int pictureIndex, bool isLoadingPictures, bool isTakingPicture, bool isCalling, String errorMessage }); @@ -276,9 +278,10 @@ class __$RemoteConnectionViewStateCopyWithImpl<$Res> /// Create a copy of RemoteConnectionViewState /// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? phone = null,Object? pictures = null,Object? pictureIndex = null,Object? isLoadingPictures = null,Object? isTakingPicture = null,Object? isCalling = null,Object? errorMessage = null,}) { +@override @pragma('vm:prefer-inline') $Res call({Object? dialCode = null,Object? phone = null,Object? pictures = null,Object? pictureIndex = null,Object? isLoadingPictures = null,Object? isTakingPicture = null,Object? isCalling = null,Object? errorMessage = null,}) { return _then(_RemoteConnectionViewState( -phone: null == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable +dialCode: null == dialCode ? _self.dialCode : dialCode // ignore: cast_nullable_to_non_nullable +as String,phone: null == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable as String,pictures: null == pictures ? _self._pictures : pictures // ignore: cast_nullable_to_non_nullable as List,pictureIndex: null == pictureIndex ? _self.pictureIndex : pictureIndex // ignore: cast_nullable_to_non_nullable as int,isLoadingPictures: null == isLoadingPictures ? _self.isLoadingPictures : isLoadingPictures // ignore: cast_nullable_to_non_nullable diff --git a/modules/legacy/packages/legacy_shared/lib/src/data/models/send_command_request_model.dart b/modules/legacy/packages/legacy_shared/lib/src/data/models/send_command_request_model.dart index 358627ae..15461164 100644 --- a/modules/legacy/packages/legacy_shared/lib/src/data/models/send_command_request_model.dart +++ b/modules/legacy/packages/legacy_shared/lib/src/data/models/send_command_request_model.dart @@ -4,6 +4,8 @@ part 'send_command_request_model.freezed.dart'; part 'send_command_request_model.g.dart'; enum DeviceCommand { + @JsonValue('CALL_CENTER') + callCenter, @JsonValue('FACTORY') factory, @JsonValue('FIND_DEVICE')