Compare commits
5 Commits
v1.0.0(6)
...
feature/co
| Author | SHA1 | Date | |
|---|---|---|---|
| 6a29c75630 | |||
| 1810dc6e2a | |||
| 4d2d25f47b | |||
| 429b67a536 | |||
| 75df4736e2 |
@@ -1,22 +1,26 @@
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'package:legacy_shared/legacy_shared.dart';
|
||||
import 'package:sf_shared/sf_shared.dart';
|
||||
|
||||
import '../../../../core/domain/repositories/background_image_repository.dart';
|
||||
import '../../../../core/providers/background_image_repository_provider.dart';
|
||||
import 'background_image_view_state.dart';
|
||||
|
||||
final backgroundImageViewModelProvider =
|
||||
NotifierProvider.autoDispose<BackgroundImageViewModel, BackgroundImageViewState>(
|
||||
BackgroundImageViewModel.new,
|
||||
);
|
||||
NotifierProvider.autoDispose<
|
||||
BackgroundImageViewModel,
|
||||
BackgroundImageViewState
|
||||
>(BackgroundImageViewModel.new);
|
||||
|
||||
class BackgroundImageViewModel extends Notifier<BackgroundImageViewState> {
|
||||
late final BackgroundImageRepository _repository;
|
||||
late final SharedDevicesRepository _devicesRepository;
|
||||
|
||||
@override
|
||||
BackgroundImageViewState build() {
|
||||
_repository = ref.read(backgroundImageRepositoryProvider);
|
||||
_devicesRepository = ref.read(sharedDevicesRepositoryProvider);
|
||||
Future.microtask(_load);
|
||||
return const BackgroundImageViewState();
|
||||
}
|
||||
@@ -31,7 +35,7 @@ class BackgroundImageViewModel extends Notifier<BackgroundImageViewState> {
|
||||
|
||||
state = state.copyWith(
|
||||
photos: photos,
|
||||
currentBackgroundId: device.settings.backgroundImageId,
|
||||
currentBackgroundId: device.backgroundImageId,
|
||||
isLoading: false,
|
||||
);
|
||||
} catch (e) {
|
||||
@@ -62,7 +66,11 @@ class BackgroundImageViewModel extends Notifier<BackgroundImageViewState> {
|
||||
final device = ref.read(selectedDeviceProvider);
|
||||
if (device == null) return;
|
||||
|
||||
state = state.copyWith(isSaving: true, errorEvent: null, successEvent: null);
|
||||
state = state.copyWith(
|
||||
isSaving: true,
|
||||
errorEvent: null,
|
||||
successEvent: null,
|
||||
);
|
||||
|
||||
try {
|
||||
final photoId = await _repository.uploadImage(path: image.path);
|
||||
@@ -74,14 +82,11 @@ class BackgroundImageViewModel extends Notifier<BackgroundImageViewState> {
|
||||
);
|
||||
if (!ref.mounted) return;
|
||||
|
||||
ref.syncDeviceSettings(
|
||||
device,
|
||||
device.settings.copyWith(backgroundImageId: photoId),
|
||||
);
|
||||
await _refreshDevice(device);
|
||||
if (!ref.mounted) return;
|
||||
|
||||
state = state.copyWith(
|
||||
isSaving: false,
|
||||
currentBackgroundId: photoId,
|
||||
successEvent: BackgroundImageSuccessEvent.uploaded,
|
||||
);
|
||||
|
||||
@@ -99,7 +104,11 @@ class BackgroundImageViewModel extends Notifier<BackgroundImageViewState> {
|
||||
final device = ref.read(selectedDeviceProvider);
|
||||
if (device == null) return;
|
||||
|
||||
state = state.copyWith(isSaving: true, errorEvent: null, successEvent: null);
|
||||
state = state.copyWith(
|
||||
isSaving: true,
|
||||
errorEvent: null,
|
||||
successEvent: null,
|
||||
);
|
||||
|
||||
try {
|
||||
await _repository.setBackgroundImage(
|
||||
@@ -108,16 +117,15 @@ class BackgroundImageViewModel extends Notifier<BackgroundImageViewState> {
|
||||
);
|
||||
if (!ref.mounted) return;
|
||||
|
||||
ref.syncDeviceSettings(
|
||||
device,
|
||||
device.settings.copyWith(backgroundImageId: photoId),
|
||||
);
|
||||
await _refreshDevice(device);
|
||||
if (!ref.mounted) return;
|
||||
|
||||
state = state.copyWith(
|
||||
isSaving: false,
|
||||
currentBackgroundId: photoId,
|
||||
successEvent: BackgroundImageSuccessEvent.backgroundSet,
|
||||
);
|
||||
|
||||
await reload();
|
||||
} catch (e) {
|
||||
if (!ref.mounted) return;
|
||||
state = state.copyWith(
|
||||
@@ -126,4 +134,15 @@ class BackgroundImageViewModel extends Notifier<BackgroundImageViewState> {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _refreshDevice(DeviceEntity currentDevice) async {
|
||||
final devices = await _devicesRepository.getDevices();
|
||||
if (!ref.mounted) return;
|
||||
|
||||
final updated = devices.firstWhere(
|
||||
(d) => d.identificator == currentDevice.identificator,
|
||||
orElse: () => currentDevice,
|
||||
);
|
||||
ref.read(selectedDeviceProvider.notifier).setSelectedDevice(updated);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ import 'package:dio/dio.dart';
|
||||
import 'package:legacy_shared/legacy_shared.dart';
|
||||
import 'package:sf_infrastructure/sf_infrastructure.dart';
|
||||
|
||||
import 'call_history_entity.dart';
|
||||
import 'call_history_response_model.dart';
|
||||
|
||||
class CallHistoryDatasource {
|
||||
|
||||
@@ -4,7 +4,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:legacy_shared/legacy_shared.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
|
||||
import '../data/call_history_entity.dart';
|
||||
import 'state/call_history_view_model.dart';
|
||||
import 'state/call_history_view_state.dart';
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import 'package:legacy_shared/legacy_shared.dart';
|
||||
|
||||
import '../../data/call_history_datasource.dart';
|
||||
import '../../data/call_history_datasource_provider.dart';
|
||||
import '../../data/call_history_entity.dart';
|
||||
import 'call_history_view_state.dart';
|
||||
|
||||
final callHistoryViewModelProvider =
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
import '../../data/call_history_entity.dart';
|
||||
import 'package:legacy_shared/legacy_shared.dart';
|
||||
|
||||
part 'call_history_view_state.freezed.dart';
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
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:settings/src/features/block_phone/presentation/blocked_calls_screen.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
import 'package:utils/utils.dart';
|
||||
|
||||
@@ -75,186 +77,120 @@ class BlockPhoneScreen extends ConsumerWidget {
|
||||
color: primaryColor,
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
right: SizeUtils.getByScreen(small: 16, big: 14),
|
||||
),
|
||||
child: DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
color: primaryColor,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: IconButton(
|
||||
onPressed: () => showAddContactSheet(context),
|
||||
icon: Icon(
|
||||
Icons.add,
|
||||
color: Colors.white,
|
||||
size: SizeUtils.getByScreen(small: 24, big: 22),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
body: SafeArea(
|
||||
top: false,
|
||||
child: state.isLoading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: state.contacts.isEmpty
|
||||
? _EmptyState(primaryColor: primaryColor)
|
||||
: _ContactList(),
|
||||
: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 14),
|
||||
child: Column(
|
||||
children: [
|
||||
const _AllowContactsSection(),
|
||||
SizedBox(height: 10),
|
||||
const _BlockedCallsSection()
|
||||
],
|
||||
)
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _EmptyState extends StatelessWidget {
|
||||
final Color primaryColor;
|
||||
class _AllowContactsSection extends ConsumerWidget {
|
||||
|
||||
const _EmptyState({required this.primaryColor});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: SizeUtils.getByScreen(small: 32, big: 30),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.phone_locked_outlined,
|
||||
color: primaryColor,
|
||||
size: SizeUtils.getByScreen(small: 120, big: 140),
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 20, big: 24)),
|
||||
Text(
|
||||
context.translate(I18n.noBlockedNumbers),
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 16, big: 17),
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 8, big: 10)),
|
||||
Text(
|
||||
context.translate(I18n.noBlockedNumbersDescription),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 14, big: 15),
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _ContactList extends ConsumerWidget {
|
||||
const _ContactList();
|
||||
const _AllowContactsSection();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final contacts = ref.watch(
|
||||
blockPhoneViewModelProvider.select((s) => s.contacts),
|
||||
final theme = ref.read(themePortProvider);
|
||||
|
||||
final vm = ref.read(blockPhoneViewModelProvider.notifier);
|
||||
final allowContacts = ref.watch(
|
||||
blockPhoneViewModelProvider.select((s)=>s.allowContacts)
|
||||
);
|
||||
final primaryColor = theme.getColorFor(ThemeCode.legacyPrimary);
|
||||
|
||||
return SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: SizeUtils.getByScreen(
|
||||
small: EdgeInsets.symmetric(horizontal: 22, vertical: 10),
|
||||
big: EdgeInsets.symmetric(horizontal: 21, vertical: 8),
|
||||
return SectionButton(
|
||||
onPressed: vm.toggleAllowContacts,
|
||||
icon: Icon(Icons.phone_callback_outlined,
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
size: 36,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
iconPadding: 8,
|
||||
body: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: SizeUtils.getByScreen(small: 12, big: 10),
|
||||
),
|
||||
child: Text(
|
||||
context.translate(I18n.whitelistDescription),
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 14, big: 15),
|
||||
color:
|
||||
theme.getColorFor(ThemeCode.textPrimary).withAlpha(178),
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(context.translate(I18n.allowContacts),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 14,
|
||||
color: theme.getColorFor(ThemeCode.textPrimary)
|
||||
)
|
||||
),
|
||||
),
|
||||
),
|
||||
...List.generate(contacts.length, (index) {
|
||||
final contact = contacts[index];
|
||||
return ContactListContactCard(
|
||||
contact: contact,
|
||||
onDelete: () =>
|
||||
_confirmDelete(context, ref, index, contact.name),
|
||||
theme: theme,
|
||||
);
|
||||
}),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 12, big: 10)),
|
||||
Text(
|
||||
context.translate(
|
||||
I18n.allowedNumbersCount,
|
||||
args: {'count': contacts.length.toString()},
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 13, big: 14),
|
||||
color: primaryColor,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
Text(context.translate(I18n.allowContactsMessage),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 12,
|
||||
color: theme.getColorFor(ThemeCode.textTertiary)
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
Switch(
|
||||
value: allowContacts,
|
||||
onChanged: (_) {
|
||||
vm.toggleAllowContacts();
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void _confirmDelete(
|
||||
BuildContext context,
|
||||
WidgetRef ref,
|
||||
int index,
|
||||
String name,
|
||||
) {
|
||||
class _BlockedCallsSection extends ConsumerWidget {
|
||||
|
||||
const _BlockedCallsSection();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.read(themePortProvider);
|
||||
final primaryColor = theme.getColorFor(ThemeCode.legacyPrimary);
|
||||
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text(context.translate(I18n.removeAllowedNumber)),
|
||||
content: Text(
|
||||
context.translate(
|
||||
I18n.removeAllowedNumberConfirm,
|
||||
args: {'name': name},
|
||||
return SectionButton(
|
||||
onPressed: (){
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => BlockedCallsScreen(),
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
child: Text(
|
||||
context.translate(I18n.cancel),
|
||||
style: TextStyle(color: primaryColor),
|
||||
),
|
||||
);
|
||||
},
|
||||
icon: Icon(Icons.phone_callback_outlined,
|
||||
color: theme.getColorFor(ThemeCode.legacyPrimary),
|
||||
size: 36,
|
||||
),
|
||||
iconPadding: 8,
|
||||
body: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(context.translate(I18n.allowContacts),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 14,
|
||||
color: theme.getColorFor(ThemeCode.textPrimary)
|
||||
)
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
ref
|
||||
.read(blockPhoneViewModelProvider.notifier)
|
||||
.removeContact(index);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Text(
|
||||
context.translate(I18n.delete),
|
||||
style: TextStyle(color: Colors.red),
|
||||
),
|
||||
Text(context.translate(I18n.allowContactsMessage),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w500,
|
||||
fontSize: 12,
|
||||
color: theme.getColorFor(ThemeCode.textTertiary)
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,182 @@
|
||||
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:settings/src/features/block_phone/presentation/state/block_phone_view_model.dart';
|
||||
import 'package:sf_localizations/sf_localizations.dart';
|
||||
import 'package:utils/utils.dart';
|
||||
|
||||
import '../../../core/presentation/widgets/contact_list_contact_card.dart';
|
||||
|
||||
class BlockedCallsScreen extends ConsumerWidget {
|
||||
|
||||
const BlockedCallsScreen({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.read(themePortProvider);
|
||||
|
||||
final state = ref.watch(blockPhoneViewModelProvider);
|
||||
final vm = ref.read(blockPhoneViewModelProvider.notifier);
|
||||
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
title: context.translate(I18n.blockedCallsList),
|
||||
body: state.isLoading
|
||||
? const Center(child: CircularProgressIndicator())
|
||||
: state.blockedCalls.isEmpty
|
||||
? _EmptyState(primaryColor: theme.getColorFor(ThemeCode.legacyPrimary))
|
||||
: const _ContactList(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _EmptyState extends StatelessWidget {
|
||||
final Color primaryColor;
|
||||
|
||||
const _EmptyState({required this.primaryColor});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: SizeUtils.getByScreen(small: 32, big: 30),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.phone_locked_outlined,
|
||||
color: primaryColor,
|
||||
size: SizeUtils.getByScreen(small: 120, big: 140),
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 20, big: 24)),
|
||||
Text(
|
||||
context.translate(I18n.noBlockedNumbers),
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 16, big: 17),
|
||||
fontWeight: FontWeight.w500,
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 8, big: 10)),
|
||||
Text(
|
||||
context.translate(I18n.noBlockedNumbersDescription),
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 14, big: 15),
|
||||
color: Colors.grey,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _ContactList extends ConsumerWidget {
|
||||
const _ContactList();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final theme = ref.watch(themePortProvider);
|
||||
final contacts = ref.watch(
|
||||
blockPhoneViewModelProvider.select((s) => s.contacts),
|
||||
);
|
||||
final primaryColor = theme.getColorFor(ThemeCode.legacyPrimary);
|
||||
|
||||
return SingleChildScrollView(
|
||||
child: Padding(
|
||||
padding: SizeUtils.getByScreen(
|
||||
small: EdgeInsets.symmetric(horizontal: 22, vertical: 10),
|
||||
big: EdgeInsets.symmetric(horizontal: 21, vertical: 8),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: SizeUtils.getByScreen(small: 12, big: 10),
|
||||
),
|
||||
child: Text(
|
||||
context.translate(I18n.whitelistDescription),
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 14, big: 15),
|
||||
color:
|
||||
theme.getColorFor(ThemeCode.textPrimary).withAlpha(178),
|
||||
),
|
||||
),
|
||||
),
|
||||
...List.generate(contacts.length, (index) {
|
||||
final contact = contacts[index];
|
||||
return ContactListContactCard(
|
||||
contact: contact,
|
||||
onDelete: () =>
|
||||
_confirmDelete(context, ref, index, contact.name),
|
||||
theme: theme,
|
||||
);
|
||||
}),
|
||||
SizedBox(height: SizeUtils.getByScreen(small: 12, big: 10)),
|
||||
Text(
|
||||
context.translate(
|
||||
I18n.allowedNumbersCount,
|
||||
args: {'count': contacts.length.toString()},
|
||||
),
|
||||
style: TextStyle(
|
||||
fontSize: SizeUtils.getByScreen(small: 13, big: 14),
|
||||
color: primaryColor,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _confirmDelete(
|
||||
BuildContext context,
|
||||
WidgetRef ref,
|
||||
int index,
|
||||
String name,
|
||||
) {
|
||||
final theme = ref.read(themePortProvider);
|
||||
final primaryColor = theme.getColorFor(ThemeCode.legacyPrimary);
|
||||
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
title: Text(context.translate(I18n.removeAllowedNumber)),
|
||||
content: Text(
|
||||
context.translate(
|
||||
I18n.removeAllowedNumberConfirm,
|
||||
args: {'name': name},
|
||||
),
|
||||
),
|
||||
actions: [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.pop(context),
|
||||
child: Text(
|
||||
context.translate(I18n.cancel),
|
||||
style: TextStyle(color: primaryColor),
|
||||
),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
ref
|
||||
.read(blockPhoneViewModelProvider.notifier)
|
||||
.removeContact(index);
|
||||
Navigator.pop(context);
|
||||
},
|
||||
child: Text(
|
||||
context.translate(I18n.delete),
|
||||
style: TextStyle(color: Colors.red),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -26,8 +26,9 @@ class BlockPhoneViewModel extends Notifier<BlockPhoneViewState> {
|
||||
final device = ref.read(selectedDeviceProvider);
|
||||
if (device == null) return;
|
||||
|
||||
final contacts = await _repository.getWhitelist(deviceId: device.id);
|
||||
state = state.copyWith(contacts: contacts, isLoading: false);
|
||||
// final contacts = await _contactsRepository
|
||||
final whitelist = await _repository.getWhitelist(deviceId: device.id);
|
||||
state = state.copyWith(whitelist: whitelist, isLoading: false);
|
||||
} catch (e) {
|
||||
state = state.copyWith(
|
||||
isLoading: false,
|
||||
@@ -43,7 +44,7 @@ class BlockPhoneViewModel extends Notifier<BlockPhoneViewState> {
|
||||
final device = ref.read(selectedDeviceProvider);
|
||||
if (device == null) return;
|
||||
|
||||
final updatedContacts = [...state.contacts, contact];
|
||||
final updatedContacts = [...state.whitelist, contact];
|
||||
|
||||
await _repository.upsertWhitelist(
|
||||
userId: device.userId ?? '',
|
||||
@@ -52,7 +53,7 @@ class BlockPhoneViewModel extends Notifier<BlockPhoneViewState> {
|
||||
);
|
||||
|
||||
state = state.copyWith(
|
||||
contacts: updatedContacts,
|
||||
whitelist: updatedContacts,
|
||||
isSaving: false,
|
||||
successMessage: I18n.numberAdded,
|
||||
);
|
||||
@@ -71,7 +72,7 @@ class BlockPhoneViewModel extends Notifier<BlockPhoneViewState> {
|
||||
final device = ref.read(selectedDeviceProvider);
|
||||
if (device == null) return;
|
||||
|
||||
final updatedContacts = [...state.contacts]..removeAt(index);
|
||||
final updatedContacts = [...state.whitelist]..removeAt(index);
|
||||
|
||||
await _repository.upsertWhitelist(
|
||||
userId: device.userId ?? '',
|
||||
@@ -80,7 +81,7 @@ class BlockPhoneViewModel extends Notifier<BlockPhoneViewState> {
|
||||
);
|
||||
|
||||
state = state.copyWith(
|
||||
contacts: updatedContacts,
|
||||
whitelist: updatedContacts,
|
||||
isSaving: false,
|
||||
successMessage: I18n.numberRemoved,
|
||||
);
|
||||
@@ -92,6 +93,33 @@ class BlockPhoneViewModel extends Notifier<BlockPhoneViewState> {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> toggleAllowContacts() async {
|
||||
final device = ref.read(selectedDeviceProvider);
|
||||
if (device == null) return;
|
||||
|
||||
try {
|
||||
state = state.copyWith(
|
||||
isSaving: true,
|
||||
);
|
||||
|
||||
await _repository.upsertWhitelist(
|
||||
userId: device.userId ?? '',
|
||||
deviceId: device.id,
|
||||
contacts: state.whitelist,
|
||||
);
|
||||
|
||||
state = state.copyWith(
|
||||
isSaving: false,
|
||||
allowContacts: !state.allowContacts
|
||||
);
|
||||
} catch(e) {
|
||||
state = state.copyWith(
|
||||
isSaving: false,
|
||||
errorMessage: e.toString(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
void clearSuccess() {
|
||||
state = state.copyWith(successMessage: '');
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:legacy_shared/legacy_shared.dart';
|
||||
import 'package:settings/src/core/domain/entities/contact_list_contact_entity.dart';
|
||||
|
||||
part 'block_phone_view_state.freezed.dart';
|
||||
@@ -7,8 +8,12 @@ part 'block_phone_view_state.freezed.dart';
|
||||
abstract class BlockPhoneViewState with _$BlockPhoneViewState {
|
||||
const factory BlockPhoneViewState({
|
||||
@Default([]) List<ContactListContactEntity> contacts,
|
||||
@Default([]) List<ContactListContactEntity> whitelist,
|
||||
@Default([]) List<CallHistoryEntity> blockedCalls,
|
||||
@Default(10) int maxLimit,
|
||||
@Default(true) bool isLoading,
|
||||
@Default(false) bool isSaving,
|
||||
@Default(false) bool allowContacts,
|
||||
@Default('') String successMessage,
|
||||
@Default('') String errorMessage,
|
||||
}) = _BlockPhoneViewState;
|
||||
|
||||
@@ -14,7 +14,7 @@ T _$identity<T>(T value) => value;
|
||||
/// @nodoc
|
||||
mixin _$BlockPhoneViewState {
|
||||
|
||||
List<ContactListContactEntity> get contacts; bool get isLoading; bool get isSaving; String get successMessage; String get errorMessage;
|
||||
List<ContactListContactEntity> get contacts; List<ContactListContactEntity> get whitelist; List<CallHistoryEntity> get blockedCalls; int get maxLimit; bool get isLoading; bool get isSaving; bool get allowContacts; String get successMessage; String get errorMessage;
|
||||
/// Create a copy of BlockPhoneViewState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@@ -25,16 +25,16 @@ $BlockPhoneViewStateCopyWith<BlockPhoneViewState> get copyWith => _$BlockPhoneVi
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is BlockPhoneViewState&&const DeepCollectionEquality().equals(other.contacts, contacts)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.isSaving, isSaving) || other.isSaving == isSaving)&&(identical(other.successMessage, successMessage) || other.successMessage == successMessage)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is BlockPhoneViewState&&const DeepCollectionEquality().equals(other.contacts, contacts)&&const DeepCollectionEquality().equals(other.whitelist, whitelist)&&const DeepCollectionEquality().equals(other.blockedCalls, blockedCalls)&&(identical(other.maxLimit, maxLimit) || other.maxLimit == maxLimit)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.isSaving, isSaving) || other.isSaving == isSaving)&&(identical(other.allowContacts, allowContacts) || other.allowContacts == allowContacts)&&(identical(other.successMessage, successMessage) || other.successMessage == successMessage)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(contacts),isLoading,isSaving,successMessage,errorMessage);
|
||||
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(contacts),const DeepCollectionEquality().hash(whitelist),const DeepCollectionEquality().hash(blockedCalls),maxLimit,isLoading,isSaving,allowContacts,successMessage,errorMessage);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'BlockPhoneViewState(contacts: $contacts, isLoading: $isLoading, isSaving: $isSaving, successMessage: $successMessage, errorMessage: $errorMessage)';
|
||||
return 'BlockPhoneViewState(contacts: $contacts, whitelist: $whitelist, blockedCalls: $blockedCalls, maxLimit: $maxLimit, isLoading: $isLoading, isSaving: $isSaving, allowContacts: $allowContacts, successMessage: $successMessage, errorMessage: $errorMessage)';
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ abstract mixin class $BlockPhoneViewStateCopyWith<$Res> {
|
||||
factory $BlockPhoneViewStateCopyWith(BlockPhoneViewState value, $Res Function(BlockPhoneViewState) _then) = _$BlockPhoneViewStateCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
List<ContactListContactEntity> contacts, bool isLoading, bool isSaving, String successMessage, String errorMessage
|
||||
List<ContactListContactEntity> contacts, List<ContactListContactEntity> whitelist, List<CallHistoryEntity> blockedCalls, int maxLimit, bool isLoading, bool isSaving, bool allowContacts, String successMessage, String errorMessage
|
||||
});
|
||||
|
||||
|
||||
@@ -62,11 +62,15 @@ class _$BlockPhoneViewStateCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of BlockPhoneViewState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? contacts = null,Object? isLoading = null,Object? isSaving = null,Object? successMessage = null,Object? errorMessage = null,}) {
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? contacts = null,Object? whitelist = null,Object? blockedCalls = null,Object? maxLimit = null,Object? isLoading = null,Object? isSaving = null,Object? allowContacts = null,Object? successMessage = null,Object? errorMessage = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
contacts: null == contacts ? _self.contacts : contacts // ignore: cast_nullable_to_non_nullable
|
||||
as List<ContactListContactEntity>,isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as List<ContactListContactEntity>,whitelist: null == whitelist ? _self.whitelist : whitelist // ignore: cast_nullable_to_non_nullable
|
||||
as List<ContactListContactEntity>,blockedCalls: null == blockedCalls ? _self.blockedCalls : blockedCalls // ignore: cast_nullable_to_non_nullable
|
||||
as List<CallHistoryEntity>,maxLimit: null == maxLimit ? _self.maxLimit : maxLimit // ignore: cast_nullable_to_non_nullable
|
||||
as int,isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,isSaving: null == isSaving ? _self.isSaving : isSaving // ignore: cast_nullable_to_non_nullable
|
||||
as bool,allowContacts: null == allowContacts ? _self.allowContacts : allowContacts // ignore: cast_nullable_to_non_nullable
|
||||
as bool,successMessage: null == successMessage ? _self.successMessage : successMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String,errorMessage: null == errorMessage ? _self.errorMessage : errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
@@ -154,10 +158,10 @@ return $default(_that);case _:
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( List<ContactListContactEntity> contacts, bool isLoading, bool isSaving, String successMessage, String errorMessage)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( List<ContactListContactEntity> contacts, List<ContactListContactEntity> whitelist, List<CallHistoryEntity> blockedCalls, int maxLimit, bool isLoading, bool isSaving, bool allowContacts, String successMessage, String errorMessage)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _BlockPhoneViewState() when $default != null:
|
||||
return $default(_that.contacts,_that.isLoading,_that.isSaving,_that.successMessage,_that.errorMessage);case _:
|
||||
return $default(_that.contacts,_that.whitelist,_that.blockedCalls,_that.maxLimit,_that.isLoading,_that.isSaving,_that.allowContacts,_that.successMessage,_that.errorMessage);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
@@ -175,10 +179,10 @@ return $default(_that.contacts,_that.isLoading,_that.isSaving,_that.successMessa
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( List<ContactListContactEntity> contacts, bool isLoading, bool isSaving, String successMessage, String errorMessage) $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( List<ContactListContactEntity> contacts, List<ContactListContactEntity> whitelist, List<CallHistoryEntity> blockedCalls, int maxLimit, bool isLoading, bool isSaving, bool allowContacts, String successMessage, String errorMessage) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _BlockPhoneViewState():
|
||||
return $default(_that.contacts,_that.isLoading,_that.isSaving,_that.successMessage,_that.errorMessage);case _:
|
||||
return $default(_that.contacts,_that.whitelist,_that.blockedCalls,_that.maxLimit,_that.isLoading,_that.isSaving,_that.allowContacts,_that.successMessage,_that.errorMessage);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
@@ -195,10 +199,10 @@ return $default(_that.contacts,_that.isLoading,_that.isSaving,_that.successMessa
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( List<ContactListContactEntity> contacts, bool isLoading, bool isSaving, String successMessage, String errorMessage)? $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( List<ContactListContactEntity> contacts, List<ContactListContactEntity> whitelist, List<CallHistoryEntity> blockedCalls, int maxLimit, bool isLoading, bool isSaving, bool allowContacts, String successMessage, String errorMessage)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _BlockPhoneViewState() when $default != null:
|
||||
return $default(_that.contacts,_that.isLoading,_that.isSaving,_that.successMessage,_that.errorMessage);case _:
|
||||
return $default(_that.contacts,_that.whitelist,_that.blockedCalls,_that.maxLimit,_that.isLoading,_that.isSaving,_that.allowContacts,_that.successMessage,_that.errorMessage);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
@@ -210,7 +214,7 @@ return $default(_that.contacts,_that.isLoading,_that.isSaving,_that.successMessa
|
||||
|
||||
|
||||
class _BlockPhoneViewState implements BlockPhoneViewState {
|
||||
const _BlockPhoneViewState({final List<ContactListContactEntity> contacts = const [], this.isLoading = true, this.isSaving = false, this.successMessage = '', this.errorMessage = ''}): _contacts = contacts;
|
||||
const _BlockPhoneViewState({final List<ContactListContactEntity> contacts = const [], final List<ContactListContactEntity> whitelist = const [], final List<CallHistoryEntity> blockedCalls = const [], this.maxLimit = 10, this.isLoading = true, this.isSaving = false, this.allowContacts = false, this.successMessage = '', this.errorMessage = ''}): _contacts = contacts,_whitelist = whitelist,_blockedCalls = blockedCalls;
|
||||
|
||||
|
||||
final List<ContactListContactEntity> _contacts;
|
||||
@@ -220,8 +224,24 @@ class _BlockPhoneViewState implements BlockPhoneViewState {
|
||||
return EqualUnmodifiableListView(_contacts);
|
||||
}
|
||||
|
||||
final List<ContactListContactEntity> _whitelist;
|
||||
@override@JsonKey() List<ContactListContactEntity> get whitelist {
|
||||
if (_whitelist is EqualUnmodifiableListView) return _whitelist;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_whitelist);
|
||||
}
|
||||
|
||||
final List<CallHistoryEntity> _blockedCalls;
|
||||
@override@JsonKey() List<CallHistoryEntity> get blockedCalls {
|
||||
if (_blockedCalls is EqualUnmodifiableListView) return _blockedCalls;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(_blockedCalls);
|
||||
}
|
||||
|
||||
@override@JsonKey() final int maxLimit;
|
||||
@override@JsonKey() final bool isLoading;
|
||||
@override@JsonKey() final bool isSaving;
|
||||
@override@JsonKey() final bool allowContacts;
|
||||
@override@JsonKey() final String successMessage;
|
||||
@override@JsonKey() final String errorMessage;
|
||||
|
||||
@@ -235,16 +255,16 @@ _$BlockPhoneViewStateCopyWith<_BlockPhoneViewState> get copyWith => __$BlockPhon
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _BlockPhoneViewState&&const DeepCollectionEquality().equals(other._contacts, _contacts)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.isSaving, isSaving) || other.isSaving == isSaving)&&(identical(other.successMessage, successMessage) || other.successMessage == successMessage)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _BlockPhoneViewState&&const DeepCollectionEquality().equals(other._contacts, _contacts)&&const DeepCollectionEquality().equals(other._whitelist, _whitelist)&&const DeepCollectionEquality().equals(other._blockedCalls, _blockedCalls)&&(identical(other.maxLimit, maxLimit) || other.maxLimit == maxLimit)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.isSaving, isSaving) || other.isSaving == isSaving)&&(identical(other.allowContacts, allowContacts) || other.allowContacts == allowContacts)&&(identical(other.successMessage, successMessage) || other.successMessage == successMessage)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_contacts),isLoading,isSaving,successMessage,errorMessage);
|
||||
int get hashCode => Object.hash(runtimeType,const DeepCollectionEquality().hash(_contacts),const DeepCollectionEquality().hash(_whitelist),const DeepCollectionEquality().hash(_blockedCalls),maxLimit,isLoading,isSaving,allowContacts,successMessage,errorMessage);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'BlockPhoneViewState(contacts: $contacts, isLoading: $isLoading, isSaving: $isSaving, successMessage: $successMessage, errorMessage: $errorMessage)';
|
||||
return 'BlockPhoneViewState(contacts: $contacts, whitelist: $whitelist, blockedCalls: $blockedCalls, maxLimit: $maxLimit, isLoading: $isLoading, isSaving: $isSaving, allowContacts: $allowContacts, successMessage: $successMessage, errorMessage: $errorMessage)';
|
||||
}
|
||||
|
||||
|
||||
@@ -255,7 +275,7 @@ abstract mixin class _$BlockPhoneViewStateCopyWith<$Res> implements $BlockPhoneV
|
||||
factory _$BlockPhoneViewStateCopyWith(_BlockPhoneViewState value, $Res Function(_BlockPhoneViewState) _then) = __$BlockPhoneViewStateCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
List<ContactListContactEntity> contacts, bool isLoading, bool isSaving, String successMessage, String errorMessage
|
||||
List<ContactListContactEntity> contacts, List<ContactListContactEntity> whitelist, List<CallHistoryEntity> blockedCalls, int maxLimit, bool isLoading, bool isSaving, bool allowContacts, String successMessage, String errorMessage
|
||||
});
|
||||
|
||||
|
||||
@@ -272,11 +292,15 @@ class __$BlockPhoneViewStateCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of BlockPhoneViewState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? contacts = null,Object? isLoading = null,Object? isSaving = null,Object? successMessage = null,Object? errorMessage = null,}) {
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? contacts = null,Object? whitelist = null,Object? blockedCalls = null,Object? maxLimit = null,Object? isLoading = null,Object? isSaving = null,Object? allowContacts = null,Object? successMessage = null,Object? errorMessage = null,}) {
|
||||
return _then(_BlockPhoneViewState(
|
||||
contacts: null == contacts ? _self._contacts : contacts // ignore: cast_nullable_to_non_nullable
|
||||
as List<ContactListContactEntity>,isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as List<ContactListContactEntity>,whitelist: null == whitelist ? _self._whitelist : whitelist // ignore: cast_nullable_to_non_nullable
|
||||
as List<ContactListContactEntity>,blockedCalls: null == blockedCalls ? _self._blockedCalls : blockedCalls // ignore: cast_nullable_to_non_nullable
|
||||
as List<CallHistoryEntity>,maxLimit: null == maxLimit ? _self.maxLimit : maxLimit // ignore: cast_nullable_to_non_nullable
|
||||
as int,isLoading: null == isLoading ? _self.isLoading : isLoading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,isSaving: null == isSaving ? _self.isSaving : isSaving // ignore: cast_nullable_to_non_nullable
|
||||
as bool,allowContacts: null == allowContacts ? _self.allowContacts : allowContacts // ignore: cast_nullable_to_non_nullable
|
||||
as bool,successMessage: null == successMessage ? _self.successMessage : successMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String,errorMessage: null == errorMessage ? _self.errorMessage : errorMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
|
||||
@@ -14,8 +14,10 @@ class RemoteOnOffScreen extends ConsumerWidget {
|
||||
return LegacyPageLayout(
|
||||
theme: theme,
|
||||
title: context.translate(I18n.remoteOnOff),
|
||||
body: const Center(
|
||||
child: Text('Coming soon'),
|
||||
body: Column(
|
||||
children: [
|
||||
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -17,4 +17,5 @@ export 'src/providers/commands_repository_provider.dart';
|
||||
export 'src/domain/repositories/devices_repository.dart';
|
||||
export 'src/providers/devices_repository_provider.dart';
|
||||
export 'src/data/datasources/device_settings_update_datasource.dart';
|
||||
export 'src/providers/device_settings_update_provider.dart';
|
||||
export 'src/providers/device_settings_update_provider.dart';
|
||||
export 'src/data/models/entities/call_history_entity.dart';
|
||||
@@ -43,6 +43,7 @@ abstract class GetDevicesItemResponseModel with _$GetDevicesItemResponseModel {
|
||||
required String protocol,
|
||||
required String type,
|
||||
Map<String, dynamic>? capabilities,
|
||||
String? backgroundImageId,
|
||||
required int createdAt,
|
||||
int? updatedAt,
|
||||
}) = _GetDevicesItemResponseModel;
|
||||
@@ -82,6 +83,7 @@ extension GetDevicesResponseModelMapper on GetDevicesResponseModel {
|
||||
capabilities: item.capabilities != null
|
||||
? DeviceCapabilitiesModel.fromJson(item.capabilities!).toEntity()
|
||||
: null,
|
||||
backgroundImageId: item.backgroundImageId,
|
||||
createdAt: item.createdAt.toString(),
|
||||
updatedAt: item.updatedAt?.toString(),
|
||||
),
|
||||
|
||||
@@ -284,7 +284,7 @@ as List<GetDevicesItemResponseModel>,
|
||||
/// @nodoc
|
||||
mixin _$GetDevicesItemResponseModel {
|
||||
|
||||
String get id; String get identificator; int? get battery; String? get userId; String? get companyId; String? get delegationId; String? get groupId; Map<String, dynamic> get flags; List<String>? get tags; 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; Map<String, dynamic>? get paymentOptions; bool get queueCommands; Map<String, dynamic> get settings; String get connectionServer; String get protocol; String get type; Map<String, dynamic>? get capabilities; int get createdAt; int? get updatedAt;
|
||||
String get id; String get identificator; int? get battery; String? get userId; String? get companyId; String? get delegationId; String? get groupId; Map<String, dynamic> get flags; List<String>? get tags; 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; Map<String, dynamic>? get paymentOptions; bool get queueCommands; Map<String, dynamic> get settings; String get connectionServer; String get protocol; String get type; Map<String, dynamic>? get capabilities; String? get backgroundImageId; int get createdAt; int? get updatedAt;
|
||||
/// 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<GetDevicesItemResponseModel> 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.battery, battery) || other.battery == battery)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.delegationId, delegationId) || other.delegationId == delegationId)&&(identical(other.groupId, groupId) || other.groupId == groupId)&&const DeepCollectionEquality().equals(other.flags, flags)&&const DeepCollectionEquality().equals(other.tags, tags)&&(identical(other.lastConnection, lastConnection) || other.lastConnection == lastConnection)&&(identical(other.carrierGenre, carrierGenre) || other.carrierGenre == carrierGenre)&&(identical(other.carrierBirthday, carrierBirthday) || other.carrierBirthday == carrierBirthday)&&(identical(other.carrierWeight, carrierWeight) || other.carrierWeight == carrierWeight)&&(identical(other.carrierStepLength, carrierStepLength) || other.carrierStepLength == carrierStepLength)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName)&&(identical(other.comment, comment) || other.comment == comment)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.simId, simId) || other.simId == simId)&&(identical(other.simStatus, simStatus) || other.simStatus == simStatus)&&const DeepCollectionEquality().equals(other.paymentOptions, paymentOptions)&&(identical(other.queueCommands, queueCommands) || other.queueCommands == queueCommands)&&const DeepCollectionEquality().equals(other.settings, settings)&&(identical(other.connectionServer, connectionServer) || other.connectionServer == connectionServer)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other.capabilities, capabilities)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is GetDevicesItemResponseModel&&(identical(other.id, id) || other.id == id)&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.battery, battery) || other.battery == battery)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.delegationId, delegationId) || other.delegationId == delegationId)&&(identical(other.groupId, groupId) || other.groupId == groupId)&&const DeepCollectionEquality().equals(other.flags, flags)&&const DeepCollectionEquality().equals(other.tags, tags)&&(identical(other.lastConnection, lastConnection) || other.lastConnection == lastConnection)&&(identical(other.carrierGenre, carrierGenre) || other.carrierGenre == carrierGenre)&&(identical(other.carrierBirthday, carrierBirthday) || other.carrierBirthday == carrierBirthday)&&(identical(other.carrierWeight, carrierWeight) || other.carrierWeight == carrierWeight)&&(identical(other.carrierStepLength, carrierStepLength) || other.carrierStepLength == carrierStepLength)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName)&&(identical(other.comment, comment) || other.comment == comment)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.simId, simId) || other.simId == simId)&&(identical(other.simStatus, simStatus) || other.simStatus == simStatus)&&const DeepCollectionEquality().equals(other.paymentOptions, paymentOptions)&&(identical(other.queueCommands, queueCommands) || other.queueCommands == queueCommands)&&const DeepCollectionEquality().equals(other.settings, settings)&&(identical(other.connectionServer, connectionServer) || other.connectionServer == connectionServer)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other.capabilities, capabilities)&&(identical(other.backgroundImageId, backgroundImageId) || other.backgroundImageId == backgroundImageId)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hashAll([runtimeType,id,identificator,battery,userId,companyId,delegationId,groupId,const DeepCollectionEquality().hash(flags),const DeepCollectionEquality().hash(tags),lastConnection,carrierGenre,carrierBirthday,carrierWeight,carrierStepLength,carrierName,comment,phone,simId,simStatus,const DeepCollectionEquality().hash(paymentOptions),queueCommands,const DeepCollectionEquality().hash(settings),connectionServer,protocol,type,const DeepCollectionEquality().hash(capabilities),createdAt,updatedAt]);
|
||||
int get hashCode => Object.hashAll([runtimeType,id,identificator,battery,userId,companyId,delegationId,groupId,const DeepCollectionEquality().hash(flags),const DeepCollectionEquality().hash(tags),lastConnection,carrierGenre,carrierBirthday,carrierWeight,carrierStepLength,carrierName,comment,phone,simId,simStatus,const DeepCollectionEquality().hash(paymentOptions),queueCommands,const DeepCollectionEquality().hash(settings),connectionServer,protocol,type,const DeepCollectionEquality().hash(capabilities),backgroundImageId,createdAt,updatedAt]);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GetDevicesItemResponseModel(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, queueCommands: $queueCommands, settings: $settings, connectionServer: $connectionServer, protocol: $protocol, type: $type, capabilities: $capabilities, createdAt: $createdAt, updatedAt: $updatedAt)';
|
||||
return 'GetDevicesItemResponseModel(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, queueCommands: $queueCommands, settings: $settings, connectionServer: $connectionServer, protocol: $protocol, type: $type, capabilities: $capabilities, backgroundImageId: $backgroundImageId, createdAt: $createdAt, updatedAt: $updatedAt)';
|
||||
}
|
||||
|
||||
|
||||
@@ -317,7 +317,7 @@ abstract mixin class $GetDevicesItemResponseModelCopyWith<$Res> {
|
||||
factory $GetDevicesItemResponseModelCopyWith(GetDevicesItemResponseModel value, $Res Function(GetDevicesItemResponseModel) _then) = _$GetDevicesItemResponseModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, int? lastConnection, String? carrierGenre, int? carrierBirthday, int? carrierWeight, int? carrierStepLength, String carrierName, String? comment, String? phone, String? simId, String? simStatus, Map<String, dynamic>? paymentOptions, bool queueCommands, Map<String, dynamic> settings, String connectionServer, String protocol, String type, Map<String, dynamic>? capabilities, int createdAt, int? updatedAt
|
||||
String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, int? lastConnection, String? carrierGenre, int? carrierBirthday, int? carrierWeight, int? carrierStepLength, String carrierName, String? comment, String? phone, String? simId, String? simStatus, Map<String, dynamic>? paymentOptions, bool queueCommands, Map<String, dynamic> settings, String connectionServer, String protocol, String type, Map<String, dynamic>? capabilities, String? backgroundImageId, int createdAt, int? updatedAt
|
||||
});
|
||||
|
||||
|
||||
@@ -334,7 +334,7 @@ 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? 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? queueCommands = null,Object? settings = null,Object? connectionServer = null,Object? protocol = null,Object? type = null,Object? capabilities = freezed,Object? createdAt = null,Object? updatedAt = freezed,}) {
|
||||
@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? queueCommands = null,Object? settings = null,Object? connectionServer = null,Object? protocol = null,Object? type = null,Object? capabilities = freezed,Object? backgroundImageId = 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
|
||||
@@ -362,7 +362,8 @@ as Map<String, dynamic>,connectionServer: null == connectionServer ? _self.conne
|
||||
as String,protocol: null == protocol ? _self.protocol : protocol // ignore: cast_nullable_to_non_nullable
|
||||
as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
||||
as String,capabilities: freezed == capabilities ? _self.capabilities : capabilities // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, dynamic>?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, dynamic>?,backgroundImageId: freezed == backgroundImageId ? _self.backgroundImageId : backgroundImageId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,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?,
|
||||
));
|
||||
@@ -449,10 +450,10 @@ return $default(_that);case _:
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, int? lastConnection, String? carrierGenre, int? carrierBirthday, int? carrierWeight, int? carrierStepLength, String carrierName, String? comment, String? phone, String? simId, String? simStatus, Map<String, dynamic>? paymentOptions, bool queueCommands, Map<String, dynamic> settings, String connectionServer, String protocol, String type, Map<String, dynamic>? capabilities, int createdAt, int? updatedAt)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, int? lastConnection, String? carrierGenre, int? carrierBirthday, int? carrierWeight, int? carrierStepLength, String carrierName, String? comment, String? phone, String? simId, String? simStatus, Map<String, dynamic>? paymentOptions, bool queueCommands, Map<String, dynamic> settings, String connectionServer, String protocol, String type, Map<String, dynamic>? capabilities, String? backgroundImageId, int createdAt, int? updatedAt)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GetDevicesItemResponseModel() 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.queueCommands,_that.settings,_that.connectionServer,_that.protocol,_that.type,_that.capabilities,_that.createdAt,_that.updatedAt);case _:
|
||||
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.queueCommands,_that.settings,_that.connectionServer,_that.protocol,_that.type,_that.capabilities,_that.backgroundImageId,_that.createdAt,_that.updatedAt);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
@@ -470,10 +471,10 @@ return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.co
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, int? lastConnection, String? carrierGenre, int? carrierBirthday, int? carrierWeight, int? carrierStepLength, String carrierName, String? comment, String? phone, String? simId, String? simStatus, Map<String, dynamic>? paymentOptions, bool queueCommands, Map<String, dynamic> settings, String connectionServer, String protocol, String type, Map<String, dynamic>? capabilities, int createdAt, int? updatedAt) $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, int? lastConnection, String? carrierGenre, int? carrierBirthday, int? carrierWeight, int? carrierStepLength, String carrierName, String? comment, String? phone, String? simId, String? simStatus, Map<String, dynamic>? paymentOptions, bool queueCommands, Map<String, dynamic> settings, String connectionServer, String protocol, String type, Map<String, dynamic>? capabilities, String? backgroundImageId, int createdAt, int? updatedAt) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GetDevicesItemResponseModel():
|
||||
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.queueCommands,_that.settings,_that.connectionServer,_that.protocol,_that.type,_that.capabilities,_that.createdAt,_that.updatedAt);case _:
|
||||
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.queueCommands,_that.settings,_that.connectionServer,_that.protocol,_that.type,_that.capabilities,_that.backgroundImageId,_that.createdAt,_that.updatedAt);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
@@ -490,10 +491,10 @@ return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.co
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, int? lastConnection, String? carrierGenre, int? carrierBirthday, int? carrierWeight, int? carrierStepLength, String carrierName, String? comment, String? phone, String? simId, String? simStatus, Map<String, dynamic>? paymentOptions, bool queueCommands, Map<String, dynamic> settings, String connectionServer, String protocol, String type, Map<String, dynamic>? capabilities, int createdAt, int? updatedAt)? $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, int? lastConnection, String? carrierGenre, int? carrierBirthday, int? carrierWeight, int? carrierStepLength, String carrierName, String? comment, String? phone, String? simId, String? simStatus, Map<String, dynamic>? paymentOptions, bool queueCommands, Map<String, dynamic> settings, String connectionServer, String protocol, String type, Map<String, dynamic>? capabilities, String? backgroundImageId, int createdAt, int? updatedAt)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GetDevicesItemResponseModel() 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.queueCommands,_that.settings,_that.connectionServer,_that.protocol,_that.type,_that.capabilities,_that.createdAt,_that.updatedAt);case _:
|
||||
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.queueCommands,_that.settings,_that.connectionServer,_that.protocol,_that.type,_that.capabilities,_that.backgroundImageId,_that.createdAt,_that.updatedAt);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
@@ -505,7 +506,7 @@ return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.co
|
||||
@JsonSerializable()
|
||||
|
||||
class _GetDevicesItemResponseModel implements GetDevicesItemResponseModel {
|
||||
const _GetDevicesItemResponseModel({required this.id, required this.identificator, this.battery, this.userId, this.companyId, this.delegationId, this.groupId, required final Map<String, dynamic> flags, final List<String>? tags, this.lastConnection, this.carrierGenre, this.carrierBirthday, this.carrierWeight, this.carrierStepLength, required this.carrierName, this.comment, this.phone, this.simId, this.simStatus, final Map<String, dynamic>? paymentOptions, required this.queueCommands, required final Map<String, dynamic> settings, required this.connectionServer, required this.protocol, required this.type, final Map<String, dynamic>? capabilities, required this.createdAt, this.updatedAt}): _flags = flags,_tags = tags,_paymentOptions = paymentOptions,_settings = settings,_capabilities = capabilities;
|
||||
const _GetDevicesItemResponseModel({required this.id, required this.identificator, this.battery, this.userId, this.companyId, this.delegationId, this.groupId, required final Map<String, dynamic> flags, final List<String>? tags, this.lastConnection, this.carrierGenre, this.carrierBirthday, this.carrierWeight, this.carrierStepLength, required this.carrierName, this.comment, this.phone, this.simId, this.simStatus, final Map<String, dynamic>? paymentOptions, required this.queueCommands, required final Map<String, dynamic> settings, required this.connectionServer, required this.protocol, required this.type, final Map<String, dynamic>? capabilities, this.backgroundImageId, required this.createdAt, this.updatedAt}): _flags = flags,_tags = tags,_paymentOptions = paymentOptions,_settings = settings,_capabilities = capabilities;
|
||||
factory _GetDevicesItemResponseModel.fromJson(Map<String, dynamic> json) => _$GetDevicesItemResponseModelFromJson(json);
|
||||
|
||||
@override final String id;
|
||||
@@ -570,6 +571,7 @@ class _GetDevicesItemResponseModel implements GetDevicesItemResponseModel {
|
||||
return EqualUnmodifiableMapView(value);
|
||||
}
|
||||
|
||||
@override final String? backgroundImageId;
|
||||
@override final int createdAt;
|
||||
@override final int? updatedAt;
|
||||
|
||||
@@ -586,16 +588,16 @@ Map<String, dynamic> 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.battery, battery) || other.battery == battery)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.delegationId, delegationId) || other.delegationId == delegationId)&&(identical(other.groupId, groupId) || other.groupId == groupId)&&const DeepCollectionEquality().equals(other._flags, _flags)&&const DeepCollectionEquality().equals(other._tags, _tags)&&(identical(other.lastConnection, lastConnection) || other.lastConnection == lastConnection)&&(identical(other.carrierGenre, carrierGenre) || other.carrierGenre == carrierGenre)&&(identical(other.carrierBirthday, carrierBirthday) || other.carrierBirthday == carrierBirthday)&&(identical(other.carrierWeight, carrierWeight) || other.carrierWeight == carrierWeight)&&(identical(other.carrierStepLength, carrierStepLength) || other.carrierStepLength == carrierStepLength)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName)&&(identical(other.comment, comment) || other.comment == comment)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.simId, simId) || other.simId == simId)&&(identical(other.simStatus, simStatus) || other.simStatus == simStatus)&&const DeepCollectionEquality().equals(other._paymentOptions, _paymentOptions)&&(identical(other.queueCommands, queueCommands) || other.queueCommands == queueCommands)&&const DeepCollectionEquality().equals(other._settings, _settings)&&(identical(other.connectionServer, connectionServer) || other.connectionServer == connectionServer)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other._capabilities, _capabilities)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _GetDevicesItemResponseModel&&(identical(other.id, id) || other.id == id)&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.battery, battery) || other.battery == battery)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.delegationId, delegationId) || other.delegationId == delegationId)&&(identical(other.groupId, groupId) || other.groupId == groupId)&&const DeepCollectionEquality().equals(other._flags, _flags)&&const DeepCollectionEquality().equals(other._tags, _tags)&&(identical(other.lastConnection, lastConnection) || other.lastConnection == lastConnection)&&(identical(other.carrierGenre, carrierGenre) || other.carrierGenre == carrierGenre)&&(identical(other.carrierBirthday, carrierBirthday) || other.carrierBirthday == carrierBirthday)&&(identical(other.carrierWeight, carrierWeight) || other.carrierWeight == carrierWeight)&&(identical(other.carrierStepLength, carrierStepLength) || other.carrierStepLength == carrierStepLength)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName)&&(identical(other.comment, comment) || other.comment == comment)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.simId, simId) || other.simId == simId)&&(identical(other.simStatus, simStatus) || other.simStatus == simStatus)&&const DeepCollectionEquality().equals(other._paymentOptions, _paymentOptions)&&(identical(other.queueCommands, queueCommands) || other.queueCommands == queueCommands)&&const DeepCollectionEquality().equals(other._settings, _settings)&&(identical(other.connectionServer, connectionServer) || other.connectionServer == connectionServer)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other._capabilities, _capabilities)&&(identical(other.backgroundImageId, backgroundImageId) || other.backgroundImageId == backgroundImageId)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hashAll([runtimeType,id,identificator,battery,userId,companyId,delegationId,groupId,const DeepCollectionEquality().hash(_flags),const DeepCollectionEquality().hash(_tags),lastConnection,carrierGenre,carrierBirthday,carrierWeight,carrierStepLength,carrierName,comment,phone,simId,simStatus,const DeepCollectionEquality().hash(_paymentOptions),queueCommands,const DeepCollectionEquality().hash(_settings),connectionServer,protocol,type,const DeepCollectionEquality().hash(_capabilities),createdAt,updatedAt]);
|
||||
int get hashCode => Object.hashAll([runtimeType,id,identificator,battery,userId,companyId,delegationId,groupId,const DeepCollectionEquality().hash(_flags),const DeepCollectionEquality().hash(_tags),lastConnection,carrierGenre,carrierBirthday,carrierWeight,carrierStepLength,carrierName,comment,phone,simId,simStatus,const DeepCollectionEquality().hash(_paymentOptions),queueCommands,const DeepCollectionEquality().hash(_settings),connectionServer,protocol,type,const DeepCollectionEquality().hash(_capabilities),backgroundImageId,createdAt,updatedAt]);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GetDevicesItemResponseModel(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, queueCommands: $queueCommands, settings: $settings, connectionServer: $connectionServer, protocol: $protocol, type: $type, capabilities: $capabilities, createdAt: $createdAt, updatedAt: $updatedAt)';
|
||||
return 'GetDevicesItemResponseModel(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, queueCommands: $queueCommands, settings: $settings, connectionServer: $connectionServer, protocol: $protocol, type: $type, capabilities: $capabilities, backgroundImageId: $backgroundImageId, createdAt: $createdAt, updatedAt: $updatedAt)';
|
||||
}
|
||||
|
||||
|
||||
@@ -606,7 +608,7 @@ abstract mixin class _$GetDevicesItemResponseModelCopyWith<$Res> implements $Get
|
||||
factory _$GetDevicesItemResponseModelCopyWith(_GetDevicesItemResponseModel value, $Res Function(_GetDevicesItemResponseModel) _then) = __$GetDevicesItemResponseModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, int? lastConnection, String? carrierGenre, int? carrierBirthday, int? carrierWeight, int? carrierStepLength, String carrierName, String? comment, String? phone, String? simId, String? simStatus, Map<String, dynamic>? paymentOptions, bool queueCommands, Map<String, dynamic> settings, String connectionServer, String protocol, String type, Map<String, dynamic>? capabilities, int createdAt, int? updatedAt
|
||||
String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, int? lastConnection, String? carrierGenre, int? carrierBirthday, int? carrierWeight, int? carrierStepLength, String carrierName, String? comment, String? phone, String? simId, String? simStatus, Map<String, dynamic>? paymentOptions, bool queueCommands, Map<String, dynamic> settings, String connectionServer, String protocol, String type, Map<String, dynamic>? capabilities, String? backgroundImageId, int createdAt, int? updatedAt
|
||||
});
|
||||
|
||||
|
||||
@@ -623,7 +625,7 @@ 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? 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? queueCommands = null,Object? settings = null,Object? connectionServer = null,Object? protocol = null,Object? type = null,Object? capabilities = freezed,Object? createdAt = null,Object? updatedAt = freezed,}) {
|
||||
@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? queueCommands = null,Object? settings = null,Object? connectionServer = null,Object? protocol = null,Object? type = null,Object? capabilities = freezed,Object? backgroundImageId = freezed,Object? createdAt = null,Object? updatedAt = freezed,}) {
|
||||
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
|
||||
@@ -651,7 +653,8 @@ as Map<String, dynamic>,connectionServer: null == connectionServer ? _self.conne
|
||||
as String,protocol: null == protocol ? _self.protocol : protocol // ignore: cast_nullable_to_non_nullable
|
||||
as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
||||
as String,capabilities: freezed == capabilities ? _self._capabilities : capabilities // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, dynamic>?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as Map<String, dynamic>?,backgroundImageId: freezed == backgroundImageId ? _self.backgroundImageId : backgroundImageId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,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?,
|
||||
));
|
||||
|
||||
@@ -49,6 +49,7 @@ _GetDevicesItemResponseModel _$GetDevicesItemResponseModelFromJson(
|
||||
protocol: json['protocol'] as String,
|
||||
type: json['type'] as String,
|
||||
capabilities: json['capabilities'] as Map<String, dynamic>?,
|
||||
backgroundImageId: json['backgroundImageId'] as String?,
|
||||
createdAt: (json['createdAt'] as num).toInt(),
|
||||
updatedAt: (json['updatedAt'] as num?)?.toInt(),
|
||||
);
|
||||
@@ -82,6 +83,7 @@ Map<String, dynamic> _$GetDevicesItemResponseModelToJson(
|
||||
'protocol': instance.protocol,
|
||||
'type': instance.type,
|
||||
'capabilities': instance.capabilities,
|
||||
'backgroundImageId': instance.backgroundImageId,
|
||||
'createdAt': instance.createdAt,
|
||||
'updatedAt': instance.updatedAt,
|
||||
};
|
||||
|
||||
@@ -837,5 +837,6 @@
|
||||
"takingPhoto": "Taking photo...",
|
||||
"errorTakePicture": "Error taking photo",
|
||||
"errorFetchPhotos": "Error fetching photos",
|
||||
"errorCall": "Error making call"
|
||||
"errorCall": "Error making call",
|
||||
"blockedCallsList": "Blocked calls list"
|
||||
}
|
||||
|
||||
@@ -835,5 +835,6 @@
|
||||
"takingPhoto": "Tomando foto...",
|
||||
"errorTakePicture": "Error al tomar la foto",
|
||||
"errorFetchPhotos": "Error al obtener las fotos",
|
||||
"errorCall": "Error al realizar la llamada"
|
||||
"errorCall": "Error al realizar la llamada",
|
||||
"blockedCallsList": "Lista de llamadas bloqueados"
|
||||
}
|
||||
|
||||
@@ -840,4 +840,7 @@ class I18n {
|
||||
static const String errorTakePicture = 'errorTakePicture';
|
||||
static const String errorFetchPhotos = 'errorFetchPhotos';
|
||||
static const String errorCall = 'errorCall';
|
||||
static const String blockedCallsList = 'blockedCallsList';
|
||||
static const String allowContacts = 'allowContacts';
|
||||
static const String allowContactsMessage = 'allowContactsMessage';
|
||||
}
|
||||
|
||||
@@ -18,7 +18,6 @@ abstract class DeviceSettingsModel with _$DeviceSettingsModel {
|
||||
@Default(true) bool keyboard,
|
||||
@Default(true) bool gps,
|
||||
@Default(false) bool nightMode,
|
||||
String? backgroundImageId,
|
||||
}) = _DeviceSettingsModel;
|
||||
|
||||
factory DeviceSettingsModel.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -54,7 +53,6 @@ extension DeviceSettingsModelMapper on DeviceSettingsModel {
|
||||
keyboard: keyboard,
|
||||
gps: gps,
|
||||
nightMode: nightMode,
|
||||
backgroundImageId: backgroundImageId,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ T _$identity<T>(T value) => value;
|
||||
/// @nodoc
|
||||
mixin _$DeviceSettingsModel {
|
||||
|
||||
int get frequency; int get frequencyHeartRate; int get timezone; bool get pedometer; String get language; List<String> get alerts; DeviceVolumeModel get volume; String? get soundMode; bool get keyboard; bool get gps; bool get nightMode; String? get backgroundImageId;
|
||||
int get frequency; int get frequencyHeartRate; int get timezone; bool get pedometer; String get language; List<String> get alerts; DeviceVolumeModel get volume; String? get soundMode; bool get keyboard; bool get gps; bool get nightMode;
|
||||
/// Create a copy of DeviceSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@@ -28,16 +28,16 @@ $DeviceSettingsModelCopyWith<DeviceSettingsModel> get copyWith => _$DeviceSettin
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceSettingsModel&&(identical(other.frequency, frequency) || other.frequency == frequency)&&(identical(other.frequencyHeartRate, frequencyHeartRate) || other.frequencyHeartRate == frequencyHeartRate)&&(identical(other.timezone, timezone) || other.timezone == timezone)&&(identical(other.pedometer, pedometer) || other.pedometer == pedometer)&&(identical(other.language, language) || other.language == language)&&const DeepCollectionEquality().equals(other.alerts, alerts)&&(identical(other.volume, volume) || other.volume == volume)&&(identical(other.soundMode, soundMode) || other.soundMode == soundMode)&&(identical(other.keyboard, keyboard) || other.keyboard == keyboard)&&(identical(other.gps, gps) || other.gps == gps)&&(identical(other.nightMode, nightMode) || other.nightMode == nightMode)&&(identical(other.backgroundImageId, backgroundImageId) || other.backgroundImageId == backgroundImageId));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceSettingsModel&&(identical(other.frequency, frequency) || other.frequency == frequency)&&(identical(other.frequencyHeartRate, frequencyHeartRate) || other.frequencyHeartRate == frequencyHeartRate)&&(identical(other.timezone, timezone) || other.timezone == timezone)&&(identical(other.pedometer, pedometer) || other.pedometer == pedometer)&&(identical(other.language, language) || other.language == language)&&const DeepCollectionEquality().equals(other.alerts, alerts)&&(identical(other.volume, volume) || other.volume == volume)&&(identical(other.soundMode, soundMode) || other.soundMode == soundMode)&&(identical(other.keyboard, keyboard) || other.keyboard == keyboard)&&(identical(other.gps, gps) || other.gps == gps)&&(identical(other.nightMode, nightMode) || other.nightMode == nightMode));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(alerts),volume,soundMode,keyboard,gps,nightMode,backgroundImageId);
|
||||
int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(alerts),volume,soundMode,keyboard,gps,nightMode);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DeviceSettingsModel(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts, volume: $volume, soundMode: $soundMode, keyboard: $keyboard, gps: $gps, nightMode: $nightMode, backgroundImageId: $backgroundImageId)';
|
||||
return 'DeviceSettingsModel(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts, volume: $volume, soundMode: $soundMode, keyboard: $keyboard, gps: $gps, nightMode: $nightMode)';
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ abstract mixin class $DeviceSettingsModelCopyWith<$Res> {
|
||||
factory $DeviceSettingsModelCopyWith(DeviceSettingsModel value, $Res Function(DeviceSettingsModel) _then) = _$DeviceSettingsModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeModel volume, String? soundMode, bool keyboard, bool gps, bool nightMode, String? backgroundImageId
|
||||
int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeModel volume, String? soundMode, bool keyboard, bool gps, bool nightMode
|
||||
});
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ class _$DeviceSettingsModelCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of DeviceSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? frequency = null,Object? frequencyHeartRate = null,Object? timezone = null,Object? pedometer = null,Object? language = null,Object? alerts = null,Object? volume = null,Object? soundMode = freezed,Object? keyboard = null,Object? gps = null,Object? nightMode = null,Object? backgroundImageId = freezed,}) {
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? frequency = null,Object? frequencyHeartRate = null,Object? timezone = null,Object? pedometer = null,Object? language = null,Object? alerts = null,Object? volume = null,Object? soundMode = freezed,Object? keyboard = null,Object? gps = null,Object? nightMode = null,}) {
|
||||
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
|
||||
@@ -78,8 +78,7 @@ as DeviceVolumeModel,soundMode: freezed == soundMode ? _self.soundMode : soundMo
|
||||
as String?,keyboard: null == keyboard ? _self.keyboard : keyboard // ignore: cast_nullable_to_non_nullable
|
||||
as bool,gps: null == gps ? _self.gps : gps // ignore: cast_nullable_to_non_nullable
|
||||
as bool,nightMode: null == nightMode ? _self.nightMode : nightMode // ignore: cast_nullable_to_non_nullable
|
||||
as bool,backgroundImageId: freezed == backgroundImageId ? _self.backgroundImageId : backgroundImageId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
as bool,
|
||||
));
|
||||
}
|
||||
/// Create a copy of DeviceSettingsModel
|
||||
@@ -173,10 +172,10 @@ return $default(_that);case _:
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeModel volume, String? soundMode, bool keyboard, bool gps, bool nightMode, String? backgroundImageId)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeModel volume, String? soundMode, bool keyboard, bool gps, bool nightMode)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceSettingsModel() when $default != null:
|
||||
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode,_that.keyboard,_that.gps,_that.nightMode,_that.backgroundImageId);case _:
|
||||
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode,_that.keyboard,_that.gps,_that.nightMode);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
@@ -194,10 +193,10 @@ return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pe
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeModel volume, String? soundMode, bool keyboard, bool gps, bool nightMode, String? backgroundImageId) $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeModel volume, String? soundMode, bool keyboard, bool gps, bool nightMode) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceSettingsModel():
|
||||
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode,_that.keyboard,_that.gps,_that.nightMode,_that.backgroundImageId);case _:
|
||||
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode,_that.keyboard,_that.gps,_that.nightMode);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
@@ -214,10 +213,10 @@ return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pe
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeModel volume, String? soundMode, bool keyboard, bool gps, bool nightMode, String? backgroundImageId)? $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeModel volume, String? soundMode, bool keyboard, bool gps, bool nightMode)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceSettingsModel() when $default != null:
|
||||
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode,_that.keyboard,_that.gps,_that.nightMode,_that.backgroundImageId);case _:
|
||||
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode,_that.keyboard,_that.gps,_that.nightMode);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
@@ -229,7 +228,7 @@ return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pe
|
||||
@JsonSerializable()
|
||||
|
||||
class _DeviceSettingsModel implements DeviceSettingsModel {
|
||||
const _DeviceSettingsModel({this.frequency = 60, this.frequencyHeartRate = 120, this.timezone = 0, this.pedometer = false, this.language = 'es', final List<String> alerts = const [], this.volume = const DeviceVolumeModel(), this.soundMode, this.keyboard = true, this.gps = true, this.nightMode = false, this.backgroundImageId}): _alerts = alerts;
|
||||
const _DeviceSettingsModel({this.frequency = 60, this.frequencyHeartRate = 120, this.timezone = 0, this.pedometer = false, this.language = 'es', final List<String> alerts = const [], this.volume = const DeviceVolumeModel(), this.soundMode, this.keyboard = true, this.gps = true, this.nightMode = false}): _alerts = alerts;
|
||||
factory _DeviceSettingsModel.fromJson(Map<String, dynamic> json) => _$DeviceSettingsModelFromJson(json);
|
||||
|
||||
@override@JsonKey() final int frequency;
|
||||
@@ -249,7 +248,6 @@ class _DeviceSettingsModel implements DeviceSettingsModel {
|
||||
@override@JsonKey() final bool keyboard;
|
||||
@override@JsonKey() final bool gps;
|
||||
@override@JsonKey() final bool nightMode;
|
||||
@override final String? backgroundImageId;
|
||||
|
||||
/// Create a copy of DeviceSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -264,16 +262,16 @@ Map<String, dynamic> toJson() {
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceSettingsModel&&(identical(other.frequency, frequency) || other.frequency == frequency)&&(identical(other.frequencyHeartRate, frequencyHeartRate) || other.frequencyHeartRate == frequencyHeartRate)&&(identical(other.timezone, timezone) || other.timezone == timezone)&&(identical(other.pedometer, pedometer) || other.pedometer == pedometer)&&(identical(other.language, language) || other.language == language)&&const DeepCollectionEquality().equals(other._alerts, _alerts)&&(identical(other.volume, volume) || other.volume == volume)&&(identical(other.soundMode, soundMode) || other.soundMode == soundMode)&&(identical(other.keyboard, keyboard) || other.keyboard == keyboard)&&(identical(other.gps, gps) || other.gps == gps)&&(identical(other.nightMode, nightMode) || other.nightMode == nightMode)&&(identical(other.backgroundImageId, backgroundImageId) || other.backgroundImageId == backgroundImageId));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceSettingsModel&&(identical(other.frequency, frequency) || other.frequency == frequency)&&(identical(other.frequencyHeartRate, frequencyHeartRate) || other.frequencyHeartRate == frequencyHeartRate)&&(identical(other.timezone, timezone) || other.timezone == timezone)&&(identical(other.pedometer, pedometer) || other.pedometer == pedometer)&&(identical(other.language, language) || other.language == language)&&const DeepCollectionEquality().equals(other._alerts, _alerts)&&(identical(other.volume, volume) || other.volume == volume)&&(identical(other.soundMode, soundMode) || other.soundMode == soundMode)&&(identical(other.keyboard, keyboard) || other.keyboard == keyboard)&&(identical(other.gps, gps) || other.gps == gps)&&(identical(other.nightMode, nightMode) || other.nightMode == nightMode));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(_alerts),volume,soundMode,keyboard,gps,nightMode,backgroundImageId);
|
||||
int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(_alerts),volume,soundMode,keyboard,gps,nightMode);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DeviceSettingsModel(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts, volume: $volume, soundMode: $soundMode, keyboard: $keyboard, gps: $gps, nightMode: $nightMode, backgroundImageId: $backgroundImageId)';
|
||||
return 'DeviceSettingsModel(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts, volume: $volume, soundMode: $soundMode, keyboard: $keyboard, gps: $gps, nightMode: $nightMode)';
|
||||
}
|
||||
|
||||
|
||||
@@ -284,7 +282,7 @@ abstract mixin class _$DeviceSettingsModelCopyWith<$Res> implements $DeviceSetti
|
||||
factory _$DeviceSettingsModelCopyWith(_DeviceSettingsModel value, $Res Function(_DeviceSettingsModel) _then) = __$DeviceSettingsModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeModel volume, String? soundMode, bool keyboard, bool gps, bool nightMode, String? backgroundImageId
|
||||
int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeModel volume, String? soundMode, bool keyboard, bool gps, bool nightMode
|
||||
});
|
||||
|
||||
|
||||
@@ -301,7 +299,7 @@ class __$DeviceSettingsModelCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of DeviceSettingsModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? frequency = null,Object? frequencyHeartRate = null,Object? timezone = null,Object? pedometer = null,Object? language = null,Object? alerts = null,Object? volume = null,Object? soundMode = freezed,Object? keyboard = null,Object? gps = null,Object? nightMode = null,Object? backgroundImageId = freezed,}) {
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? frequency = null,Object? frequencyHeartRate = null,Object? timezone = null,Object? pedometer = null,Object? language = null,Object? alerts = null,Object? volume = null,Object? soundMode = freezed,Object? keyboard = null,Object? gps = null,Object? nightMode = null,}) {
|
||||
return _then(_DeviceSettingsModel(
|
||||
frequency: null == frequency ? _self.frequency : frequency // ignore: cast_nullable_to_non_nullable
|
||||
as int,frequencyHeartRate: null == frequencyHeartRate ? _self.frequencyHeartRate : frequencyHeartRate // ignore: cast_nullable_to_non_nullable
|
||||
@@ -314,8 +312,7 @@ as DeviceVolumeModel,soundMode: freezed == soundMode ? _self.soundMode : soundMo
|
||||
as String?,keyboard: null == keyboard ? _self.keyboard : keyboard // ignore: cast_nullable_to_non_nullable
|
||||
as bool,gps: null == gps ? _self.gps : gps // ignore: cast_nullable_to_non_nullable
|
||||
as bool,nightMode: null == nightMode ? _self.nightMode : nightMode // ignore: cast_nullable_to_non_nullable
|
||||
as bool,backgroundImageId: freezed == backgroundImageId ? _self.backgroundImageId : backgroundImageId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
as bool,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ _DeviceSettingsModel _$DeviceSettingsModelFromJson(Map<String, dynamic> json) =>
|
||||
keyboard: json['keyboard'] as bool? ?? true,
|
||||
gps: json['gps'] as bool? ?? true,
|
||||
nightMode: json['nightMode'] as bool? ?? false,
|
||||
backgroundImageId: json['backgroundImageId'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$DeviceSettingsModelToJson(
|
||||
@@ -42,7 +41,6 @@ Map<String, dynamic> _$DeviceSettingsModelToJson(
|
||||
'keyboard': instance.keyboard,
|
||||
'gps': instance.gps,
|
||||
'nightMode': instance.nightMode,
|
||||
'backgroundImageId': instance.backgroundImageId,
|
||||
};
|
||||
|
||||
_DeviceVolumeModel _$DeviceVolumeModelFromJson(Map<String, dynamic> json) =>
|
||||
|
||||
@@ -32,6 +32,7 @@ abstract class DeviceEntity with _$DeviceEntity {
|
||||
@Default('') String protocol,
|
||||
@Default('') String type,
|
||||
DeviceCapabilitiesEntity? capabilities,
|
||||
String? backgroundImageId,
|
||||
@Default('') String createdAt,
|
||||
String? updatedAt,
|
||||
}) = _DeviceEntity;
|
||||
|
||||
@@ -14,7 +14,7 @@ T _$identity<T>(T value) => value;
|
||||
/// @nodoc
|
||||
mixin _$DeviceEntity {
|
||||
|
||||
String get id; String get identificator; int? get battery; String? get userId; String? get companyId; String? get delegationId; String? get groupId; Map<String, dynamic> get flags; List<String>? get tags; String? get lastConnection; String? get carrierGenre; String? get carrierBirthday; int? get carrierWeight; int? get carrierStepLength; String? get carrierName; String? get comment; String? get phone; String? get simId; Map<String, dynamic>? get paymentOptions; DeviceSettingsEntity get settings; String get connectionServer; String get protocol; String get type; DeviceCapabilitiesEntity? get capabilities; String get createdAt; String? get updatedAt;
|
||||
String get id; String get identificator; int? get battery; String? get userId; String? get companyId; String? get delegationId; String? get groupId; Map<String, dynamic> get flags; List<String>? get tags; String? get lastConnection; String? get carrierGenre; String? get carrierBirthday; int? get carrierWeight; int? get carrierStepLength; String? get carrierName; String? get comment; String? get phone; String? get simId; Map<String, dynamic>? get paymentOptions; DeviceSettingsEntity get settings; String get connectionServer; String get protocol; String get type; DeviceCapabilitiesEntity? get capabilities; String? get backgroundImageId; String get createdAt; String? get updatedAt;
|
||||
/// Create a copy of DeviceEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@@ -25,16 +25,16 @@ $DeviceEntityCopyWith<DeviceEntity> get copyWith => _$DeviceEntityCopyWithImpl<D
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceEntity&&(identical(other.id, id) || other.id == id)&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.battery, battery) || other.battery == battery)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.delegationId, delegationId) || other.delegationId == delegationId)&&(identical(other.groupId, groupId) || other.groupId == groupId)&&const DeepCollectionEquality().equals(other.flags, flags)&&const DeepCollectionEquality().equals(other.tags, tags)&&(identical(other.lastConnection, lastConnection) || other.lastConnection == lastConnection)&&(identical(other.carrierGenre, carrierGenre) || other.carrierGenre == carrierGenre)&&(identical(other.carrierBirthday, carrierBirthday) || other.carrierBirthday == carrierBirthday)&&(identical(other.carrierWeight, carrierWeight) || other.carrierWeight == carrierWeight)&&(identical(other.carrierStepLength, carrierStepLength) || other.carrierStepLength == carrierStepLength)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName)&&(identical(other.comment, comment) || other.comment == comment)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.simId, simId) || other.simId == simId)&&const DeepCollectionEquality().equals(other.paymentOptions, paymentOptions)&&(identical(other.settings, settings) || other.settings == settings)&&(identical(other.connectionServer, connectionServer) || other.connectionServer == connectionServer)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.type, type) || other.type == type)&&(identical(other.capabilities, capabilities) || other.capabilities == capabilities)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceEntity&&(identical(other.id, id) || other.id == id)&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.battery, battery) || other.battery == battery)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.delegationId, delegationId) || other.delegationId == delegationId)&&(identical(other.groupId, groupId) || other.groupId == groupId)&&const DeepCollectionEquality().equals(other.flags, flags)&&const DeepCollectionEquality().equals(other.tags, tags)&&(identical(other.lastConnection, lastConnection) || other.lastConnection == lastConnection)&&(identical(other.carrierGenre, carrierGenre) || other.carrierGenre == carrierGenre)&&(identical(other.carrierBirthday, carrierBirthday) || other.carrierBirthday == carrierBirthday)&&(identical(other.carrierWeight, carrierWeight) || other.carrierWeight == carrierWeight)&&(identical(other.carrierStepLength, carrierStepLength) || other.carrierStepLength == carrierStepLength)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName)&&(identical(other.comment, comment) || other.comment == comment)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.simId, simId) || other.simId == simId)&&const DeepCollectionEquality().equals(other.paymentOptions, paymentOptions)&&(identical(other.settings, settings) || other.settings == settings)&&(identical(other.connectionServer, connectionServer) || other.connectionServer == connectionServer)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.type, type) || other.type == type)&&(identical(other.capabilities, capabilities) || other.capabilities == capabilities)&&(identical(other.backgroundImageId, backgroundImageId) || other.backgroundImageId == backgroundImageId)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hashAll([runtimeType,id,identificator,battery,userId,companyId,delegationId,groupId,const DeepCollectionEquality().hash(flags),const DeepCollectionEquality().hash(tags),lastConnection,carrierGenre,carrierBirthday,carrierWeight,carrierStepLength,carrierName,comment,phone,simId,const DeepCollectionEquality().hash(paymentOptions),settings,connectionServer,protocol,type,capabilities,createdAt,updatedAt]);
|
||||
int get hashCode => Object.hashAll([runtimeType,id,identificator,battery,userId,companyId,delegationId,groupId,const DeepCollectionEquality().hash(flags),const DeepCollectionEquality().hash(tags),lastConnection,carrierGenre,carrierBirthday,carrierWeight,carrierStepLength,carrierName,comment,phone,simId,const DeepCollectionEquality().hash(paymentOptions),settings,connectionServer,protocol,type,capabilities,backgroundImageId,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, paymentOptions: $paymentOptions, settings: $settings, connectionServer: $connectionServer, protocol: $protocol, type: $type, capabilities: $capabilities, createdAt: $createdAt, updatedAt: $updatedAt)';
|
||||
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, paymentOptions: $paymentOptions, settings: $settings, connectionServer: $connectionServer, protocol: $protocol, type: $type, capabilities: $capabilities, backgroundImageId: $backgroundImageId, createdAt: $createdAt, updatedAt: $updatedAt)';
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ abstract mixin class $DeviceEntityCopyWith<$Res> {
|
||||
factory $DeviceEntityCopyWith(DeviceEntity value, $Res Function(DeviceEntity) _then) = _$DeviceEntityCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, DeviceSettingsEntity settings, String connectionServer, String protocol, String type, DeviceCapabilitiesEntity? capabilities, String createdAt, String? updatedAt
|
||||
String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, DeviceSettingsEntity settings, String connectionServer, String protocol, String type, DeviceCapabilitiesEntity? capabilities, String? backgroundImageId, String createdAt, String? updatedAt
|
||||
});
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ class _$DeviceEntityCopyWithImpl<$Res>
|
||||
|
||||
/// 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 = freezed,Object? comment = freezed,Object? phone = freezed,Object? simId = freezed,Object? paymentOptions = freezed,Object? settings = null,Object? connectionServer = null,Object? protocol = null,Object? type = null,Object? capabilities = freezed,Object? createdAt = null,Object? updatedAt = freezed,}) {
|
||||
@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 = freezed,Object? comment = freezed,Object? phone = freezed,Object? simId = freezed,Object? paymentOptions = freezed,Object? settings = null,Object? connectionServer = null,Object? protocol = null,Object? type = null,Object? capabilities = freezed,Object? backgroundImageId = 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
|
||||
@@ -88,7 +88,8 @@ as DeviceSettingsEntity,connectionServer: null == connectionServer ? _self.conne
|
||||
as String,protocol: null == protocol ? _self.protocol : protocol // ignore: cast_nullable_to_non_nullable
|
||||
as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
||||
as String,capabilities: freezed == capabilities ? _self.capabilities : capabilities // ignore: cast_nullable_to_non_nullable
|
||||
as DeviceCapabilitiesEntity?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DeviceCapabilitiesEntity?,backgroundImageId: freezed == backgroundImageId ? _self.backgroundImageId : backgroundImageId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as String,updatedAt: freezed == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
@@ -196,10 +197,10 @@ return $default(_that);case _:
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, DeviceSettingsEntity settings, String connectionServer, String protocol, String type, DeviceCapabilitiesEntity? capabilities, String createdAt, String? updatedAt)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, DeviceSettingsEntity settings, String connectionServer, String protocol, String type, DeviceCapabilitiesEntity? capabilities, String? backgroundImageId, String createdAt, String? updatedAt)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceEntity() when $default != null:
|
||||
return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.companyId,_that.delegationId,_that.groupId,_that.flags,_that.tags,_that.lastConnection,_that.carrierGenre,_that.carrierBirthday,_that.carrierWeight,_that.carrierStepLength,_that.carrierName,_that.comment,_that.phone,_that.simId,_that.paymentOptions,_that.settings,_that.connectionServer,_that.protocol,_that.type,_that.capabilities,_that.createdAt,_that.updatedAt);case _:
|
||||
return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.companyId,_that.delegationId,_that.groupId,_that.flags,_that.tags,_that.lastConnection,_that.carrierGenre,_that.carrierBirthday,_that.carrierWeight,_that.carrierStepLength,_that.carrierName,_that.comment,_that.phone,_that.simId,_that.paymentOptions,_that.settings,_that.connectionServer,_that.protocol,_that.type,_that.capabilities,_that.backgroundImageId,_that.createdAt,_that.updatedAt);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
@@ -217,10 +218,10 @@ return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.co
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, DeviceSettingsEntity settings, String connectionServer, String protocol, String type, DeviceCapabilitiesEntity? capabilities, String createdAt, String? updatedAt) $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, DeviceSettingsEntity settings, String connectionServer, String protocol, String type, DeviceCapabilitiesEntity? capabilities, String? backgroundImageId, String createdAt, String? updatedAt) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceEntity():
|
||||
return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.companyId,_that.delegationId,_that.groupId,_that.flags,_that.tags,_that.lastConnection,_that.carrierGenre,_that.carrierBirthday,_that.carrierWeight,_that.carrierStepLength,_that.carrierName,_that.comment,_that.phone,_that.simId,_that.paymentOptions,_that.settings,_that.connectionServer,_that.protocol,_that.type,_that.capabilities,_that.createdAt,_that.updatedAt);case _:
|
||||
return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.companyId,_that.delegationId,_that.groupId,_that.flags,_that.tags,_that.lastConnection,_that.carrierGenre,_that.carrierBirthday,_that.carrierWeight,_that.carrierStepLength,_that.carrierName,_that.comment,_that.phone,_that.simId,_that.paymentOptions,_that.settings,_that.connectionServer,_that.protocol,_that.type,_that.capabilities,_that.backgroundImageId,_that.createdAt,_that.updatedAt);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
@@ -237,10 +238,10 @@ return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.co
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, DeviceSettingsEntity settings, String connectionServer, String protocol, String type, DeviceCapabilitiesEntity? capabilities, String createdAt, String? updatedAt)? $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, DeviceSettingsEntity settings, String connectionServer, String protocol, String type, DeviceCapabilitiesEntity? capabilities, String? backgroundImageId, String createdAt, String? updatedAt)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceEntity() when $default != null:
|
||||
return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.companyId,_that.delegationId,_that.groupId,_that.flags,_that.tags,_that.lastConnection,_that.carrierGenre,_that.carrierBirthday,_that.carrierWeight,_that.carrierStepLength,_that.carrierName,_that.comment,_that.phone,_that.simId,_that.paymentOptions,_that.settings,_that.connectionServer,_that.protocol,_that.type,_that.capabilities,_that.createdAt,_that.updatedAt);case _:
|
||||
return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.companyId,_that.delegationId,_that.groupId,_that.flags,_that.tags,_that.lastConnection,_that.carrierGenre,_that.carrierBirthday,_that.carrierWeight,_that.carrierStepLength,_that.carrierName,_that.comment,_that.phone,_that.simId,_that.paymentOptions,_that.settings,_that.connectionServer,_that.protocol,_that.type,_that.capabilities,_that.backgroundImageId,_that.createdAt,_that.updatedAt);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
@@ -252,7 +253,7 @@ return $default(_that.id,_that.identificator,_that.battery,_that.userId,_that.co
|
||||
|
||||
|
||||
class _DeviceEntity implements DeviceEntity {
|
||||
const _DeviceEntity({required this.id, required this.identificator, this.battery, this.userId, this.companyId, this.delegationId, this.groupId, final Map<String, dynamic> flags = const {}, final List<String>? tags, this.lastConnection, this.carrierGenre, this.carrierBirthday, this.carrierWeight, this.carrierStepLength, this.carrierName, this.comment, this.phone, this.simId, final Map<String, dynamic>? paymentOptions, this.settings = const DeviceSettingsEntity(), this.connectionServer = '', this.protocol = '', this.type = '', this.capabilities, this.createdAt = '', this.updatedAt}): _flags = flags,_tags = tags,_paymentOptions = paymentOptions;
|
||||
const _DeviceEntity({required this.id, required this.identificator, this.battery, this.userId, this.companyId, this.delegationId, this.groupId, final Map<String, dynamic> flags = const {}, final List<String>? tags, this.lastConnection, this.carrierGenre, this.carrierBirthday, this.carrierWeight, this.carrierStepLength, this.carrierName, this.comment, this.phone, this.simId, final Map<String, dynamic>? paymentOptions, this.settings = const DeviceSettingsEntity(), this.connectionServer = '', this.protocol = '', this.type = '', this.capabilities, this.backgroundImageId, this.createdAt = '', this.updatedAt}): _flags = flags,_tags = tags,_paymentOptions = paymentOptions;
|
||||
|
||||
|
||||
@override final String id;
|
||||
@@ -301,6 +302,7 @@ class _DeviceEntity implements DeviceEntity {
|
||||
@override@JsonKey() final String protocol;
|
||||
@override@JsonKey() final String type;
|
||||
@override final DeviceCapabilitiesEntity? capabilities;
|
||||
@override final String? backgroundImageId;
|
||||
@override@JsonKey() final String createdAt;
|
||||
@override final String? updatedAt;
|
||||
|
||||
@@ -314,16 +316,16 @@ _$DeviceEntityCopyWith<_DeviceEntity> get copyWith => __$DeviceEntityCopyWithImp
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceEntity&&(identical(other.id, id) || other.id == id)&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.battery, battery) || other.battery == battery)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.delegationId, delegationId) || other.delegationId == delegationId)&&(identical(other.groupId, groupId) || other.groupId == groupId)&&const DeepCollectionEquality().equals(other._flags, _flags)&&const DeepCollectionEquality().equals(other._tags, _tags)&&(identical(other.lastConnection, lastConnection) || other.lastConnection == lastConnection)&&(identical(other.carrierGenre, carrierGenre) || other.carrierGenre == carrierGenre)&&(identical(other.carrierBirthday, carrierBirthday) || other.carrierBirthday == carrierBirthday)&&(identical(other.carrierWeight, carrierWeight) || other.carrierWeight == carrierWeight)&&(identical(other.carrierStepLength, carrierStepLength) || other.carrierStepLength == carrierStepLength)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName)&&(identical(other.comment, comment) || other.comment == comment)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.simId, simId) || other.simId == simId)&&const DeepCollectionEquality().equals(other._paymentOptions, _paymentOptions)&&(identical(other.settings, settings) || other.settings == settings)&&(identical(other.connectionServer, connectionServer) || other.connectionServer == connectionServer)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.type, type) || other.type == type)&&(identical(other.capabilities, capabilities) || other.capabilities == capabilities)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceEntity&&(identical(other.id, id) || other.id == id)&&(identical(other.identificator, identificator) || other.identificator == identificator)&&(identical(other.battery, battery) || other.battery == battery)&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.companyId, companyId) || other.companyId == companyId)&&(identical(other.delegationId, delegationId) || other.delegationId == delegationId)&&(identical(other.groupId, groupId) || other.groupId == groupId)&&const DeepCollectionEquality().equals(other._flags, _flags)&&const DeepCollectionEquality().equals(other._tags, _tags)&&(identical(other.lastConnection, lastConnection) || other.lastConnection == lastConnection)&&(identical(other.carrierGenre, carrierGenre) || other.carrierGenre == carrierGenre)&&(identical(other.carrierBirthday, carrierBirthday) || other.carrierBirthday == carrierBirthday)&&(identical(other.carrierWeight, carrierWeight) || other.carrierWeight == carrierWeight)&&(identical(other.carrierStepLength, carrierStepLength) || other.carrierStepLength == carrierStepLength)&&(identical(other.carrierName, carrierName) || other.carrierName == carrierName)&&(identical(other.comment, comment) || other.comment == comment)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.simId, simId) || other.simId == simId)&&const DeepCollectionEquality().equals(other._paymentOptions, _paymentOptions)&&(identical(other.settings, settings) || other.settings == settings)&&(identical(other.connectionServer, connectionServer) || other.connectionServer == connectionServer)&&(identical(other.protocol, protocol) || other.protocol == protocol)&&(identical(other.type, type) || other.type == type)&&(identical(other.capabilities, capabilities) || other.capabilities == capabilities)&&(identical(other.backgroundImageId, backgroundImageId) || other.backgroundImageId == backgroundImageId)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hashAll([runtimeType,id,identificator,battery,userId,companyId,delegationId,groupId,const DeepCollectionEquality().hash(_flags),const DeepCollectionEquality().hash(_tags),lastConnection,carrierGenre,carrierBirthday,carrierWeight,carrierStepLength,carrierName,comment,phone,simId,const DeepCollectionEquality().hash(_paymentOptions),settings,connectionServer,protocol,type,capabilities,createdAt,updatedAt]);
|
||||
int get hashCode => Object.hashAll([runtimeType,id,identificator,battery,userId,companyId,delegationId,groupId,const DeepCollectionEquality().hash(_flags),const DeepCollectionEquality().hash(_tags),lastConnection,carrierGenre,carrierBirthday,carrierWeight,carrierStepLength,carrierName,comment,phone,simId,const DeepCollectionEquality().hash(_paymentOptions),settings,connectionServer,protocol,type,capabilities,backgroundImageId,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, paymentOptions: $paymentOptions, settings: $settings, connectionServer: $connectionServer, protocol: $protocol, type: $type, capabilities: $capabilities, createdAt: $createdAt, updatedAt: $updatedAt)';
|
||||
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, paymentOptions: $paymentOptions, settings: $settings, connectionServer: $connectionServer, protocol: $protocol, type: $type, capabilities: $capabilities, backgroundImageId: $backgroundImageId, createdAt: $createdAt, updatedAt: $updatedAt)';
|
||||
}
|
||||
|
||||
|
||||
@@ -334,7 +336,7 @@ abstract mixin class _$DeviceEntityCopyWith<$Res> implements $DeviceEntityCopyWi
|
||||
factory _$DeviceEntityCopyWith(_DeviceEntity value, $Res Function(_DeviceEntity) _then) = __$DeviceEntityCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, DeviceSettingsEntity settings, String connectionServer, String protocol, String type, DeviceCapabilitiesEntity? capabilities, String createdAt, String? updatedAt
|
||||
String id, String identificator, int? battery, String? userId, String? companyId, String? delegationId, String? groupId, Map<String, dynamic> flags, List<String>? tags, String? lastConnection, String? carrierGenre, String? carrierBirthday, int? carrierWeight, int? carrierStepLength, String? carrierName, String? comment, String? phone, String? simId, Map<String, dynamic>? paymentOptions, DeviceSettingsEntity settings, String connectionServer, String protocol, String type, DeviceCapabilitiesEntity? capabilities, String? backgroundImageId, String createdAt, String? updatedAt
|
||||
});
|
||||
|
||||
|
||||
@@ -351,7 +353,7 @@ class __$DeviceEntityCopyWithImpl<$Res>
|
||||
|
||||
/// 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 = freezed,Object? comment = freezed,Object? phone = freezed,Object? simId = freezed,Object? paymentOptions = freezed,Object? settings = null,Object? connectionServer = null,Object? protocol = null,Object? type = null,Object? capabilities = freezed,Object? createdAt = null,Object? updatedAt = freezed,}) {
|
||||
@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 = freezed,Object? comment = freezed,Object? phone = freezed,Object? simId = freezed,Object? paymentOptions = freezed,Object? settings = null,Object? connectionServer = null,Object? protocol = null,Object? type = null,Object? capabilities = freezed,Object? backgroundImageId = 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
|
||||
@@ -377,7 +379,8 @@ as DeviceSettingsEntity,connectionServer: null == connectionServer ? _self.conne
|
||||
as String,protocol: null == protocol ? _self.protocol : protocol // ignore: cast_nullable_to_non_nullable
|
||||
as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
||||
as String,capabilities: freezed == capabilities ? _self.capabilities : capabilities // ignore: cast_nullable_to_non_nullable
|
||||
as DeviceCapabilitiesEntity?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as DeviceCapabilitiesEntity?,backgroundImageId: freezed == backgroundImageId ? _self.backgroundImageId : backgroundImageId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable
|
||||
as String,updatedAt: freezed == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
|
||||
@@ -16,7 +16,6 @@ abstract class DeviceSettingsEntity with _$DeviceSettingsEntity {
|
||||
@Default(true) bool keyboard,
|
||||
@Default(true) bool gps,
|
||||
@Default(false) bool nightMode,
|
||||
String? backgroundImageId,
|
||||
}) = _DeviceSettingsEntity;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ T _$identity<T>(T value) => value;
|
||||
/// @nodoc
|
||||
mixin _$DeviceSettingsEntity {
|
||||
|
||||
int get frequency; int get frequencyHeartRate; int get timezone; bool get pedometer; String get language; List<String> get alerts; DeviceVolumeEntity get volume; String? get soundMode; bool get keyboard; bool get gps; bool get nightMode; String? get backgroundImageId;
|
||||
int get frequency; int get frequencyHeartRate; int get timezone; bool get pedometer; String get language; List<String> get alerts; DeviceVolumeEntity get volume; String? get soundMode; bool get keyboard; bool get gps; bool get nightMode;
|
||||
/// Create a copy of DeviceSettingsEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@@ -25,16 +25,16 @@ $DeviceSettingsEntityCopyWith<DeviceSettingsEntity> get copyWith => _$DeviceSett
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceSettingsEntity&&(identical(other.frequency, frequency) || other.frequency == frequency)&&(identical(other.frequencyHeartRate, frequencyHeartRate) || other.frequencyHeartRate == frequencyHeartRate)&&(identical(other.timezone, timezone) || other.timezone == timezone)&&(identical(other.pedometer, pedometer) || other.pedometer == pedometer)&&(identical(other.language, language) || other.language == language)&&const DeepCollectionEquality().equals(other.alerts, alerts)&&(identical(other.volume, volume) || other.volume == volume)&&(identical(other.soundMode, soundMode) || other.soundMode == soundMode)&&(identical(other.keyboard, keyboard) || other.keyboard == keyboard)&&(identical(other.gps, gps) || other.gps == gps)&&(identical(other.nightMode, nightMode) || other.nightMode == nightMode)&&(identical(other.backgroundImageId, backgroundImageId) || other.backgroundImageId == backgroundImageId));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is DeviceSettingsEntity&&(identical(other.frequency, frequency) || other.frequency == frequency)&&(identical(other.frequencyHeartRate, frequencyHeartRate) || other.frequencyHeartRate == frequencyHeartRate)&&(identical(other.timezone, timezone) || other.timezone == timezone)&&(identical(other.pedometer, pedometer) || other.pedometer == pedometer)&&(identical(other.language, language) || other.language == language)&&const DeepCollectionEquality().equals(other.alerts, alerts)&&(identical(other.volume, volume) || other.volume == volume)&&(identical(other.soundMode, soundMode) || other.soundMode == soundMode)&&(identical(other.keyboard, keyboard) || other.keyboard == keyboard)&&(identical(other.gps, gps) || other.gps == gps)&&(identical(other.nightMode, nightMode) || other.nightMode == nightMode));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(alerts),volume,soundMode,keyboard,gps,nightMode,backgroundImageId);
|
||||
int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(alerts),volume,soundMode,keyboard,gps,nightMode);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DeviceSettingsEntity(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts, volume: $volume, soundMode: $soundMode, keyboard: $keyboard, gps: $gps, nightMode: $nightMode, backgroundImageId: $backgroundImageId)';
|
||||
return 'DeviceSettingsEntity(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts, volume: $volume, soundMode: $soundMode, keyboard: $keyboard, gps: $gps, nightMode: $nightMode)';
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ abstract mixin class $DeviceSettingsEntityCopyWith<$Res> {
|
||||
factory $DeviceSettingsEntityCopyWith(DeviceSettingsEntity value, $Res Function(DeviceSettingsEntity) _then) = _$DeviceSettingsEntityCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeEntity volume, String? soundMode, bool keyboard, bool gps, bool nightMode, String? backgroundImageId
|
||||
int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeEntity volume, String? soundMode, bool keyboard, bool gps, bool nightMode
|
||||
});
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ class _$DeviceSettingsEntityCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of DeviceSettingsEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? frequency = null,Object? frequencyHeartRate = null,Object? timezone = null,Object? pedometer = null,Object? language = null,Object? alerts = null,Object? volume = null,Object? soundMode = freezed,Object? keyboard = null,Object? gps = null,Object? nightMode = null,Object? backgroundImageId = freezed,}) {
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? frequency = null,Object? frequencyHeartRate = null,Object? timezone = null,Object? pedometer = null,Object? language = null,Object? alerts = null,Object? volume = null,Object? soundMode = freezed,Object? keyboard = null,Object? gps = null,Object? nightMode = null,}) {
|
||||
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
|
||||
@@ -75,8 +75,7 @@ as DeviceVolumeEntity,soundMode: freezed == soundMode ? _self.soundMode : soundM
|
||||
as String?,keyboard: null == keyboard ? _self.keyboard : keyboard // ignore: cast_nullable_to_non_nullable
|
||||
as bool,gps: null == gps ? _self.gps : gps // ignore: cast_nullable_to_non_nullable
|
||||
as bool,nightMode: null == nightMode ? _self.nightMode : nightMode // ignore: cast_nullable_to_non_nullable
|
||||
as bool,backgroundImageId: freezed == backgroundImageId ? _self.backgroundImageId : backgroundImageId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
as bool,
|
||||
));
|
||||
}
|
||||
/// Create a copy of DeviceSettingsEntity
|
||||
@@ -170,10 +169,10 @@ return $default(_that);case _:
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeEntity volume, String? soundMode, bool keyboard, bool gps, bool nightMode, String? backgroundImageId)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeEntity volume, String? soundMode, bool keyboard, bool gps, bool nightMode)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceSettingsEntity() when $default != null:
|
||||
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode,_that.keyboard,_that.gps,_that.nightMode,_that.backgroundImageId);case _:
|
||||
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode,_that.keyboard,_that.gps,_that.nightMode);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
@@ -191,10 +190,10 @@ return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pe
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeEntity volume, String? soundMode, bool keyboard, bool gps, bool nightMode, String? backgroundImageId) $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeEntity volume, String? soundMode, bool keyboard, bool gps, bool nightMode) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceSettingsEntity():
|
||||
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode,_that.keyboard,_that.gps,_that.nightMode,_that.backgroundImageId);case _:
|
||||
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode,_that.keyboard,_that.gps,_that.nightMode);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
@@ -211,10 +210,10 @@ return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pe
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeEntity volume, String? soundMode, bool keyboard, bool gps, bool nightMode, String? backgroundImageId)? $default,) {final _that = this;
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeEntity volume, String? soundMode, bool keyboard, bool gps, bool nightMode)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DeviceSettingsEntity() when $default != null:
|
||||
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode,_that.keyboard,_that.gps,_that.nightMode,_that.backgroundImageId);case _:
|
||||
return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pedometer,_that.language,_that.alerts,_that.volume,_that.soundMode,_that.keyboard,_that.gps,_that.nightMode);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
@@ -226,7 +225,7 @@ return $default(_that.frequency,_that.frequencyHeartRate,_that.timezone,_that.pe
|
||||
|
||||
|
||||
class _DeviceSettingsEntity implements DeviceSettingsEntity {
|
||||
const _DeviceSettingsEntity({this.frequency = 60, this.frequencyHeartRate = 120, this.timezone = 0, this.pedometer = false, this.language = 'es', final List<String> alerts = const [], this.volume = const DeviceVolumeEntity(), this.soundMode, this.keyboard = true, this.gps = true, this.nightMode = false, this.backgroundImageId}): _alerts = alerts;
|
||||
const _DeviceSettingsEntity({this.frequency = 60, this.frequencyHeartRate = 120, this.timezone = 0, this.pedometer = false, this.language = 'es', final List<String> alerts = const [], this.volume = const DeviceVolumeEntity(), this.soundMode, this.keyboard = true, this.gps = true, this.nightMode = false}): _alerts = alerts;
|
||||
|
||||
|
||||
@override@JsonKey() final int frequency;
|
||||
@@ -246,7 +245,6 @@ class _DeviceSettingsEntity implements DeviceSettingsEntity {
|
||||
@override@JsonKey() final bool keyboard;
|
||||
@override@JsonKey() final bool gps;
|
||||
@override@JsonKey() final bool nightMode;
|
||||
@override final String? backgroundImageId;
|
||||
|
||||
/// Create a copy of DeviceSettingsEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -258,16 +256,16 @@ _$DeviceSettingsEntityCopyWith<_DeviceSettingsEntity> get copyWith => __$DeviceS
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceSettingsEntity&&(identical(other.frequency, frequency) || other.frequency == frequency)&&(identical(other.frequencyHeartRate, frequencyHeartRate) || other.frequencyHeartRate == frequencyHeartRate)&&(identical(other.timezone, timezone) || other.timezone == timezone)&&(identical(other.pedometer, pedometer) || other.pedometer == pedometer)&&(identical(other.language, language) || other.language == language)&&const DeepCollectionEquality().equals(other._alerts, _alerts)&&(identical(other.volume, volume) || other.volume == volume)&&(identical(other.soundMode, soundMode) || other.soundMode == soundMode)&&(identical(other.keyboard, keyboard) || other.keyboard == keyboard)&&(identical(other.gps, gps) || other.gps == gps)&&(identical(other.nightMode, nightMode) || other.nightMode == nightMode)&&(identical(other.backgroundImageId, backgroundImageId) || other.backgroundImageId == backgroundImageId));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _DeviceSettingsEntity&&(identical(other.frequency, frequency) || other.frequency == frequency)&&(identical(other.frequencyHeartRate, frequencyHeartRate) || other.frequencyHeartRate == frequencyHeartRate)&&(identical(other.timezone, timezone) || other.timezone == timezone)&&(identical(other.pedometer, pedometer) || other.pedometer == pedometer)&&(identical(other.language, language) || other.language == language)&&const DeepCollectionEquality().equals(other._alerts, _alerts)&&(identical(other.volume, volume) || other.volume == volume)&&(identical(other.soundMode, soundMode) || other.soundMode == soundMode)&&(identical(other.keyboard, keyboard) || other.keyboard == keyboard)&&(identical(other.gps, gps) || other.gps == gps)&&(identical(other.nightMode, nightMode) || other.nightMode == nightMode));
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(_alerts),volume,soundMode,keyboard,gps,nightMode,backgroundImageId);
|
||||
int get hashCode => Object.hash(runtimeType,frequency,frequencyHeartRate,timezone,pedometer,language,const DeepCollectionEquality().hash(_alerts),volume,soundMode,keyboard,gps,nightMode);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DeviceSettingsEntity(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts, volume: $volume, soundMode: $soundMode, keyboard: $keyboard, gps: $gps, nightMode: $nightMode, backgroundImageId: $backgroundImageId)';
|
||||
return 'DeviceSettingsEntity(frequency: $frequency, frequencyHeartRate: $frequencyHeartRate, timezone: $timezone, pedometer: $pedometer, language: $language, alerts: $alerts, volume: $volume, soundMode: $soundMode, keyboard: $keyboard, gps: $gps, nightMode: $nightMode)';
|
||||
}
|
||||
|
||||
|
||||
@@ -278,7 +276,7 @@ abstract mixin class _$DeviceSettingsEntityCopyWith<$Res> implements $DeviceSett
|
||||
factory _$DeviceSettingsEntityCopyWith(_DeviceSettingsEntity value, $Res Function(_DeviceSettingsEntity) _then) = __$DeviceSettingsEntityCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeEntity volume, String? soundMode, bool keyboard, bool gps, bool nightMode, String? backgroundImageId
|
||||
int frequency, int frequencyHeartRate, int timezone, bool pedometer, String language, List<String> alerts, DeviceVolumeEntity volume, String? soundMode, bool keyboard, bool gps, bool nightMode
|
||||
});
|
||||
|
||||
|
||||
@@ -295,7 +293,7 @@ class __$DeviceSettingsEntityCopyWithImpl<$Res>
|
||||
|
||||
/// Create a copy of DeviceSettingsEntity
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? frequency = null,Object? frequencyHeartRate = null,Object? timezone = null,Object? pedometer = null,Object? language = null,Object? alerts = null,Object? volume = null,Object? soundMode = freezed,Object? keyboard = null,Object? gps = null,Object? nightMode = null,Object? backgroundImageId = freezed,}) {
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? frequency = null,Object? frequencyHeartRate = null,Object? timezone = null,Object? pedometer = null,Object? language = null,Object? alerts = null,Object? volume = null,Object? soundMode = freezed,Object? keyboard = null,Object? gps = null,Object? nightMode = null,}) {
|
||||
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
|
||||
@@ -308,8 +306,7 @@ as DeviceVolumeEntity,soundMode: freezed == soundMode ? _self.soundMode : soundM
|
||||
as String?,keyboard: null == keyboard ? _self.keyboard : keyboard // ignore: cast_nullable_to_non_nullable
|
||||
as bool,gps: null == gps ? _self.gps : gps // ignore: cast_nullable_to_non_nullable
|
||||
as bool,nightMode: null == nightMode ? _self.nightMode : nightMode // ignore: cast_nullable_to_non_nullable
|
||||
as bool,backgroundImageId: freezed == backgroundImageId ? _self.backgroundImageId : backgroundImageId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
as bool,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user