mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-22 06:08:54 -04:00
scanning
This commit is contained in:
parent
e5f1619c65
commit
752392c02e
39 changed files with 1025 additions and 435 deletions
|
@ -75,8 +75,8 @@ class ChatSingleContactItemWidget extends ConsumerWidget {
|
|||
title: Text(contact.editedProfile.name),
|
||||
|
||||
/// xxx show last message here
|
||||
subtitle: (contact.editedProfile.title.isNotEmpty)
|
||||
? Text(contact.editedProfile.title)
|
||||
subtitle: (contact.editedProfile.pronouns.isNotEmpty)
|
||||
? Text(contact.editedProfile.pronouns)
|
||||
: null,
|
||||
iconColor: scale.tertiaryScale.background,
|
||||
textColor: scale.tertiaryScale.text,
|
||||
|
|
|
@ -59,7 +59,7 @@ class ChatSingleContactListWidget extends ConsumerWidget {
|
|||
return contact.editedProfile.name
|
||||
.toLowerCase()
|
||||
.contains(lowerValue) ||
|
||||
contact.editedProfile.title
|
||||
contact.editedProfile.pronouns
|
||||
.toLowerCase()
|
||||
.contains(lowerValue);
|
||||
}).toList();
|
||||
|
|
|
@ -105,8 +105,8 @@ class ContactItemWidget extends ConsumerWidget {
|
|||
// }
|
||||
},
|
||||
title: Text(contact.editedProfile.name),
|
||||
subtitle: (contact.editedProfile.title.isNotEmpty)
|
||||
? Text(contact.editedProfile.title)
|
||||
subtitle: (contact.editedProfile.pronouns.isNotEmpty)
|
||||
? Text(contact.editedProfile.pronouns)
|
||||
: null,
|
||||
iconColor: scale.tertiaryScale.background,
|
||||
textColor: scale.tertiaryScale.text,
|
||||
|
|
|
@ -45,7 +45,7 @@ class ContactListWidget extends ConsumerWidget {
|
|||
element.editedProfile.name
|
||||
.toLowerCase()
|
||||
.contains(lowerValue) ||
|
||||
element.editedProfile.title
|
||||
element.editedProfile.pronouns
|
||||
.toLowerCase()
|
||||
.contains(lowerValue))
|
||||
.toList();
|
||||
|
|
|
@ -304,14 +304,14 @@ class InviteDialogState extends ConsumerState<InviteDialog> {
|
|||
if (_validInvitation != null && !_isValidating)
|
||||
Column(children: [
|
||||
Container(
|
||||
constraints: const BoxConstraints(maxHeight: 64),
|
||||
width: double.infinity,
|
||||
child: ProfileWidget(
|
||||
name: _validInvitation!
|
||||
.contactRequestPrivate.profile.name,
|
||||
title: _validInvitation!
|
||||
.contactRequestPrivate.profile.title))
|
||||
.paddingLTRB(0, 0, 0, 8),
|
||||
constraints: const BoxConstraints(maxHeight: 64),
|
||||
width: double.infinity,
|
||||
child: ProfileWidget(
|
||||
name: _validInvitation!
|
||||
.contactRequestPrivate.profile.name,
|
||||
pronouns: _validInvitation!
|
||||
.contactRequestPrivate.profile.pronouns,
|
||||
)).paddingLTRB(0, 0, 0, 8),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
|
|
|
@ -8,12 +8,12 @@ import '../tools/tools.dart';
|
|||
class ProfileWidget extends ConsumerWidget {
|
||||
const ProfileWidget({
|
||||
required this.name,
|
||||
this.title,
|
||||
this.pronouns,
|
||||
super.key,
|
||||
});
|
||||
|
||||
final String name;
|
||||
final String? title;
|
||||
final String? pronouns;
|
||||
|
||||
@override
|
||||
// ignore: prefer_expression_function_bodies
|
||||
|
@ -33,8 +33,8 @@ class ProfileWidget extends ConsumerWidget {
|
|||
style: textTheme.headlineSmall,
|
||||
textAlign: TextAlign.left,
|
||||
).paddingAll(4),
|
||||
if (title != null && title!.isNotEmpty)
|
||||
Text(title!, style: textTheme.bodyMedium).paddingLTRB(4, 0, 4, 4),
|
||||
if (pronouns != null && pronouns!.isNotEmpty)
|
||||
Text(pronouns!, style: textTheme.bodyMedium).paddingLTRB(4, 0, 4, 4),
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
@ -44,6 +44,6 @@ class ProfileWidget extends ConsumerWidget {
|
|||
super.debugFillProperties(properties);
|
||||
properties
|
||||
..add(StringProperty('name', name))
|
||||
..add(StringProperty('title', title));
|
||||
..add(StringProperty('pronouns', pronouns));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,112 @@
|
|||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
import 'dart:math';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:awesome_extensions/awesome_extensions.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_translate/flutter_translate.dart';
|
||||
import 'package:pasteboard/pasteboard.dart';
|
||||
import 'package:zxing2/qrcode.dart';
|
||||
import 'package:mobile_scanner/mobile_scanner.dart';
|
||||
import 'package:image/image.dart' as img;
|
||||
|
||||
import '../tools/tools.dart';
|
||||
import 'invite_dialog.dart';
|
||||
|
||||
class BarcodeOverlay extends CustomPainter {
|
||||
BarcodeOverlay({
|
||||
required this.barcode,
|
||||
required this.arguments,
|
||||
required this.boxFit,
|
||||
required this.capture,
|
||||
});
|
||||
|
||||
final BarcodeCapture capture;
|
||||
final Barcode barcode;
|
||||
final MobileScannerArguments arguments;
|
||||
final BoxFit boxFit;
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Size size) {
|
||||
if (barcode.corners == null) {
|
||||
return;
|
||||
}
|
||||
final adjustedSize = applyBoxFit(boxFit, arguments.size, size);
|
||||
|
||||
var verticalPadding = size.height - adjustedSize.destination.height;
|
||||
var horizontalPadding = size.width - adjustedSize.destination.width;
|
||||
if (verticalPadding > 0) {
|
||||
verticalPadding = verticalPadding / 2;
|
||||
} else {
|
||||
verticalPadding = 0;
|
||||
}
|
||||
|
||||
if (horizontalPadding > 0) {
|
||||
horizontalPadding = horizontalPadding / 2;
|
||||
} else {
|
||||
horizontalPadding = 0;
|
||||
}
|
||||
|
||||
final ratioWidth =
|
||||
(Platform.isIOS ? capture.width! : arguments.size.width) /
|
||||
adjustedSize.destination.width;
|
||||
final ratioHeight =
|
||||
(Platform.isIOS ? capture.height! : arguments.size.height) /
|
||||
adjustedSize.destination.height;
|
||||
|
||||
final adjustedOffset = <Offset>[];
|
||||
for (final offset in barcode.corners!) {
|
||||
adjustedOffset.add(
|
||||
Offset(
|
||||
offset.dx / ratioWidth + horizontalPadding,
|
||||
offset.dy / ratioHeight + verticalPadding,
|
||||
),
|
||||
);
|
||||
}
|
||||
final cutoutPath = Path()..addPolygon(adjustedOffset, true);
|
||||
|
||||
final backgroundPaint = Paint()
|
||||
..color = Colors.red.withOpacity(0.3)
|
||||
..style = PaintingStyle.fill
|
||||
..blendMode = BlendMode.dstOut;
|
||||
|
||||
canvas.drawPath(cutoutPath, backgroundPaint);
|
||||
}
|
||||
|
||||
@override
|
||||
bool shouldRepaint(covariant CustomPainter oldDelegate) => false;
|
||||
}
|
||||
|
||||
class ScannerOverlay extends CustomPainter {
|
||||
ScannerOverlay(this.scanWindow);
|
||||
|
||||
final Rect scanWindow;
|
||||
|
||||
@override
|
||||
void paint(Canvas canvas, Size size) {
|
||||
final backgroundPath = Path()..addRect(Rect.largest);
|
||||
final cutoutPath = Path()..addRect(scanWindow);
|
||||
|
||||
final backgroundPaint = Paint()
|
||||
..color = Colors.black.withOpacity(0.5)
|
||||
..style = PaintingStyle.fill
|
||||
..blendMode = BlendMode.dstOut;
|
||||
|
||||
final backgroundWithCutout = Path.combine(
|
||||
PathOperation.difference,
|
||||
backgroundPath,
|
||||
cutoutPath,
|
||||
);
|
||||
canvas.drawPath(backgroundWithCutout, backgroundPaint);
|
||||
}
|
||||
|
||||
@override
|
||||
bool shouldRepaint(covariant CustomPainter oldDelegate) => false;
|
||||
}
|
||||
|
||||
class ScanInviteDialog extends ConsumerStatefulWidget {
|
||||
const ScanInviteDialog({super.key});
|
||||
|
||||
|
@ -24,53 +122,204 @@ class ScanInviteDialog extends ConsumerStatefulWidget {
|
|||
}
|
||||
|
||||
class ScanInviteDialogState extends ConsumerState<ScanInviteDialog> {
|
||||
// final _pasteTextController = TextEditingController();
|
||||
bool scanned = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
}
|
||||
|
||||
// Future<void> _onPasteChanged(
|
||||
// String text,
|
||||
// Future<void> Function({
|
||||
// required Uint8List inviteData,
|
||||
// }) validateInviteData) async {
|
||||
// final lines = text.split('\n');
|
||||
// if (lines.isEmpty) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
// var firstline =
|
||||
// lines.indexWhere((element) => element.contains('BEGIN VEILIDCHAT'));
|
||||
// firstline += 1;
|
||||
|
||||
// var lastline =
|
||||
// lines.indexWhere((element) => element.contains('END VEILIDCHAT'));
|
||||
// if (lastline == -1) {
|
||||
// lastline = lines.length;
|
||||
// }
|
||||
// if (lastline <= firstline) {
|
||||
// return;
|
||||
// }
|
||||
// final inviteDataBase64 = lines.sublist(firstline, lastline).join();
|
||||
// final inviteData = base64UrlNoPadDecode(inviteDataBase64);
|
||||
|
||||
// await validateInviteData(inviteData: inviteData);
|
||||
// }
|
||||
|
||||
void onValidationCancelled() {
|
||||
// _pasteTextController.clear();
|
||||
setState(() {
|
||||
scanned = false;
|
||||
});
|
||||
}
|
||||
|
||||
void onValidationSuccess() {
|
||||
//_pasteTextController.clear();
|
||||
}
|
||||
void onValidationSuccess() {}
|
||||
void onValidationFailed() {
|
||||
//_pasteTextController.clear();
|
||||
setState(() {
|
||||
scanned = false;
|
||||
});
|
||||
}
|
||||
|
||||
bool inviteControlIsValid() => false; // _pasteTextController.text.isNotEmpty;
|
||||
|
||||
Future<Uint8List?> scanQRImage(BuildContext context) async {
|
||||
final theme = Theme.of(context);
|
||||
//final textTheme = theme.textTheme;
|
||||
final scale = theme.extension<ScaleScheme>()!;
|
||||
final windowSize = MediaQuery.of(context).size;
|
||||
//final maxDialogWidth = min(windowSize.width - 64.0, 800.0 - 64.0);
|
||||
//final maxDialogHeight = windowSize.height - 64.0;
|
||||
|
||||
final scanWindow = Rect.fromCenter(
|
||||
center: MediaQuery.of(context).size.center(Offset.zero),
|
||||
width: 200,
|
||||
height: 200,
|
||||
);
|
||||
|
||||
final cameraController = MobileScannerController();
|
||||
try {
|
||||
return showDialog(
|
||||
context: context,
|
||||
builder: (context) => Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
MobileScanner(
|
||||
fit: BoxFit.contain,
|
||||
scanWindow: scanWindow,
|
||||
controller: cameraController,
|
||||
errorBuilder: (context, error, child) =>
|
||||
ScannerErrorWidget(error: error),
|
||||
onDetect: (c) {
|
||||
final barcode = c.barcodes.firstOrNull;
|
||||
|
||||
final barcodeBytes = barcode?.rawBytes;
|
||||
if (barcodeBytes != null) {
|
||||
cameraController.dispose();
|
||||
Navigator.pop(context, barcodeBytes);
|
||||
}
|
||||
}),
|
||||
CustomPaint(
|
||||
painter: ScannerOverlay(scanWindow),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.bottomCenter,
|
||||
child: Container(
|
||||
alignment: Alignment.bottomCenter,
|
||||
height: 100,
|
||||
color: Colors.black.withOpacity(0.4),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
IconButton(
|
||||
color: Colors.white,
|
||||
icon: ValueListenableBuilder(
|
||||
valueListenable: cameraController.torchState,
|
||||
builder: (context, state, child) {
|
||||
switch (state) {
|
||||
case TorchState.off:
|
||||
return Icon(Icons.flash_off,
|
||||
color:
|
||||
scale.grayScale.subtleBackground);
|
||||
case TorchState.on:
|
||||
return Icon(Icons.flash_on,
|
||||
color: scale.primaryScale.background);
|
||||
}
|
||||
},
|
||||
),
|
||||
iconSize: 32,
|
||||
onPressed: cameraController.toggleTorch,
|
||||
),
|
||||
SizedBox(
|
||||
width: windowSize.width - 120,
|
||||
height: 50,
|
||||
child: FittedBox(
|
||||
child: Text(
|
||||
translate('scan_invite_dialog.instructions'),
|
||||
overflow: TextOverflow.fade,
|
||||
style: Theme.of(context)
|
||||
.textTheme
|
||||
.labelLarge!
|
||||
.copyWith(color: Colors.white),
|
||||
),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
color: Colors.white,
|
||||
icon: ValueListenableBuilder(
|
||||
valueListenable:
|
||||
cameraController.cameraFacingState,
|
||||
builder: (context, state, child) {
|
||||
switch (state) {
|
||||
case CameraFacing.front:
|
||||
return const Icon(Icons.camera_front);
|
||||
case CameraFacing.back:
|
||||
return const Icon(Icons.camera_rear);
|
||||
}
|
||||
},
|
||||
),
|
||||
iconSize: 32,
|
||||
onPressed: cameraController.switchCamera,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Align(
|
||||
alignment: Alignment.topRight,
|
||||
child: IconButton(
|
||||
color: Colors.white,
|
||||
icon: Icon(Icons.close,
|
||||
color: scale.grayScale.background),
|
||||
iconSize: 32,
|
||||
onPressed: () => {
|
||||
SchedulerBinding.instance
|
||||
.addPostFrameCallback((_) {
|
||||
cameraController.dispose();
|
||||
Navigator.pop(context, null);
|
||||
})
|
||||
})),
|
||||
],
|
||||
));
|
||||
} on MobileScannerException catch (e) {
|
||||
if (e.errorCode == MobileScannerErrorCode.permissionDenied) {
|
||||
showErrorToast(
|
||||
context, translate('scan_invite_dialog.permission_error'));
|
||||
} else {
|
||||
showErrorToast(context, translate('scan_invite_dialog.error'));
|
||||
}
|
||||
} on Exception catch (_) {
|
||||
showErrorToast(context, translate('scan_invite_dialog.error'));
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
Future<Uint8List?> pasteQRImage(BuildContext context) async {
|
||||
final imageBytes = await Pasteboard.image;
|
||||
if (imageBytes == null) {
|
||||
if (context.mounted) {
|
||||
showErrorToast(context, translate('scan_invite_dialog.not_an_image'));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
final image = img.decodeImage(imageBytes);
|
||||
if (image == null) {
|
||||
if (context.mounted) {
|
||||
showErrorToast(
|
||||
context, translate('scan_invite_dialog.could_not_decode_image'));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
final source = RGBLuminanceSource(
|
||||
image.width,
|
||||
image.height,
|
||||
image
|
||||
.convert(numChannels: 4)
|
||||
.getBytes(order: img.ChannelOrder.abgr)
|
||||
.buffer
|
||||
.asInt32List());
|
||||
final bitmap = BinaryBitmap(HybridBinarizer(source));
|
||||
|
||||
final reader = QRCodeReader();
|
||||
final result = reader.decode(bitmap);
|
||||
|
||||
final segs = result.resultMetadata[ResultMetadataType.byteSegments]!
|
||||
as List<Int8List>;
|
||||
return Uint8List.fromList(segs[0].toList());
|
||||
} on Exception catch (_) {
|
||||
if (context.mounted) {
|
||||
showErrorToast(
|
||||
context, translate('scan_invite_dialog.not_a_valid_qr_code'));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Widget buildInviteControl(
|
||||
BuildContext context,
|
||||
InviteDialogState dialogState,
|
||||
|
@ -78,31 +327,56 @@ class ScanInviteDialogState extends ConsumerState<ScanInviteDialog> {
|
|||
validateInviteData) {
|
||||
final theme = Theme.of(context);
|
||||
//final scale = theme.extension<ScaleScheme>()!;
|
||||
final textTheme = theme.textTheme;
|
||||
//final textTheme = theme.textTheme;
|
||||
//final height = MediaQuery.of(context).size.height;
|
||||
|
||||
if (isiOS || isAndroid) {
|
||||
return Column(mainAxisSize: MainAxisSize.min, children: [
|
||||
if (!scanned)
|
||||
Text(
|
||||
translate('scan_invite_dialog.scan_qr_here'),
|
||||
).paddingLTRB(0, 0, 0, 8),
|
||||
if (!scanned)
|
||||
Container(
|
||||
constraints: const BoxConstraints(maxHeight: 200),
|
||||
child: ElevatedButton(
|
||||
onPressed: dialogState.isValidating
|
||||
? null
|
||||
: () async {
|
||||
final inviteData = await scanQRImage(context);
|
||||
if (inviteData != null) {
|
||||
setState(() {
|
||||
scanned = true;
|
||||
});
|
||||
await validateInviteData(inviteData: inviteData);
|
||||
}
|
||||
},
|
||||
child: Text(translate('scan_invite_dialog.scan'))),
|
||||
).paddingLTRB(0, 0, 0, 8)
|
||||
]);
|
||||
}
|
||||
return Column(mainAxisSize: MainAxisSize.min, children: [
|
||||
Text(
|
||||
translate('scan_invite_dialog.scan_invite_here'),
|
||||
).paddingLTRB(0, 0, 0, 8),
|
||||
// Container(
|
||||
// constraints: const BoxConstraints(maxHeight: 200),
|
||||
// child: TextField(
|
||||
// enabled: !dialogState.isValidating,
|
||||
// onChanged: (text) => _onPasteChanged(text, validateInviteData),
|
||||
// style: textTheme.labelSmall!
|
||||
// .copyWith(fontFamily: 'Victor Mono', fontSize: 11),
|
||||
// keyboardType: TextInputType.multiline,
|
||||
// maxLines: null,
|
||||
// controller: _pasteTextController,
|
||||
// decoration: const InputDecoration(
|
||||
// border: OutlineInputBorder(),
|
||||
// hintText: '--- BEGIN VEILIDCHAT CONTACT INVITE ----\n'
|
||||
// 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\n'
|
||||
// '---- END VEILIDCHAT CONTACT INVITE -----\n',
|
||||
// //labelText: translate('paste_invite_dialog.paste')
|
||||
// ),
|
||||
// )).paddingLTRB(0, 0, 0, 8)
|
||||
if (!scanned)
|
||||
Text(
|
||||
translate('scan_invite_dialog.paste_qr_here'),
|
||||
).paddingLTRB(0, 0, 0, 8),
|
||||
if (!scanned)
|
||||
Container(
|
||||
constraints: const BoxConstraints(maxHeight: 200),
|
||||
child: ElevatedButton(
|
||||
onPressed: dialogState.isValidating
|
||||
? null
|
||||
: () async {
|
||||
final inviteData = await pasteQRImage(context);
|
||||
if (inviteData != null) {
|
||||
setState(() {
|
||||
scanned = true;
|
||||
});
|
||||
await validateInviteData(inviteData: inviteData);
|
||||
}
|
||||
},
|
||||
child: Text(translate('scan_invite_dialog.paste'))),
|
||||
).paddingLTRB(0, 0, 0, 8)
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -117,11 +117,11 @@ class _$LocalAccountCopyWithImpl<$Res, $Val extends LocalAccount>
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$_LocalAccountCopyWith<$Res>
|
||||
abstract class _$$LocalAccountImplCopyWith<$Res>
|
||||
implements $LocalAccountCopyWith<$Res> {
|
||||
factory _$$_LocalAccountCopyWith(
|
||||
_$_LocalAccount value, $Res Function(_$_LocalAccount) then) =
|
||||
__$$_LocalAccountCopyWithImpl<$Res>;
|
||||
factory _$$LocalAccountImplCopyWith(
|
||||
_$LocalAccountImpl value, $Res Function(_$LocalAccountImpl) then) =
|
||||
__$$LocalAccountImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
|
@ -137,11 +137,11 @@ abstract class _$$_LocalAccountCopyWith<$Res>
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$_LocalAccountCopyWithImpl<$Res>
|
||||
extends _$LocalAccountCopyWithImpl<$Res, _$_LocalAccount>
|
||||
implements _$$_LocalAccountCopyWith<$Res> {
|
||||
__$$_LocalAccountCopyWithImpl(
|
||||
_$_LocalAccount _value, $Res Function(_$_LocalAccount) _then)
|
||||
class __$$LocalAccountImplCopyWithImpl<$Res>
|
||||
extends _$LocalAccountCopyWithImpl<$Res, _$LocalAccountImpl>
|
||||
implements _$$LocalAccountImplCopyWith<$Res> {
|
||||
__$$LocalAccountImplCopyWithImpl(
|
||||
_$LocalAccountImpl _value, $Res Function(_$LocalAccountImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
|
@ -154,7 +154,7 @@ class __$$_LocalAccountCopyWithImpl<$Res>
|
|||
Object? hiddenAccount = null,
|
||||
Object? name = null,
|
||||
}) {
|
||||
return _then(_$_LocalAccount(
|
||||
return _then(_$LocalAccountImpl(
|
||||
identityMaster: null == identityMaster
|
||||
? _value.identityMaster
|
||||
: identityMaster // ignore: cast_nullable_to_non_nullable
|
||||
|
@ -185,8 +185,8 @@ class __$$_LocalAccountCopyWithImpl<$Res>
|
|||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$_LocalAccount implements _LocalAccount {
|
||||
const _$_LocalAccount(
|
||||
class _$LocalAccountImpl implements _LocalAccount {
|
||||
const _$LocalAccountImpl(
|
||||
{required this.identityMaster,
|
||||
@Uint8ListJsonConverter() required this.identitySecretBytes,
|
||||
required this.encryptionKeyType,
|
||||
|
@ -194,8 +194,8 @@ class _$_LocalAccount implements _LocalAccount {
|
|||
required this.hiddenAccount,
|
||||
required this.name});
|
||||
|
||||
factory _$_LocalAccount.fromJson(Map<String, dynamic> json) =>
|
||||
_$$_LocalAccountFromJson(json);
|
||||
factory _$LocalAccountImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$LocalAccountImplFromJson(json);
|
||||
|
||||
// The master key record for the account, containing the identityPublicKey
|
||||
@override
|
||||
|
@ -228,7 +228,7 @@ class _$_LocalAccount implements _LocalAccount {
|
|||
bool operator ==(dynamic other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$_LocalAccount &&
|
||||
other is _$LocalAccountImpl &&
|
||||
(identical(other.identityMaster, identityMaster) ||
|
||||
other.identityMaster == identityMaster) &&
|
||||
const DeepCollectionEquality()
|
||||
|
@ -256,12 +256,12 @@ class _$_LocalAccount implements _LocalAccount {
|
|||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$_LocalAccountCopyWith<_$_LocalAccount> get copyWith =>
|
||||
__$$_LocalAccountCopyWithImpl<_$_LocalAccount>(this, _$identity);
|
||||
_$$LocalAccountImplCopyWith<_$LocalAccountImpl> get copyWith =>
|
||||
__$$LocalAccountImplCopyWithImpl<_$LocalAccountImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$_LocalAccountToJson(
|
||||
return _$$LocalAccountImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
|
@ -274,10 +274,10 @@ abstract class _LocalAccount implements LocalAccount {
|
|||
required final EncryptionKeyType encryptionKeyType,
|
||||
required final bool biometricsEnabled,
|
||||
required final bool hiddenAccount,
|
||||
required final String name}) = _$_LocalAccount;
|
||||
required final String name}) = _$LocalAccountImpl;
|
||||
|
||||
factory _LocalAccount.fromJson(Map<String, dynamic> json) =
|
||||
_$_LocalAccount.fromJson;
|
||||
_$LocalAccountImpl.fromJson;
|
||||
|
||||
@override // The master key record for the account, containing the identityPublicKey
|
||||
IdentityMaster get identityMaster;
|
||||
|
@ -296,6 +296,6 @@ abstract class _LocalAccount implements LocalAccount {
|
|||
String get name;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$_LocalAccountCopyWith<_$_LocalAccount> get copyWith =>
|
||||
_$$LocalAccountImplCopyWith<_$LocalAccountImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
|
|
@ -6,8 +6,8 @@ part of 'local_account.dart';
|
|||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$_LocalAccount _$$_LocalAccountFromJson(Map<String, dynamic> json) =>
|
||||
_$_LocalAccount(
|
||||
_$LocalAccountImpl _$$LocalAccountImplFromJson(Map<String, dynamic> json) =>
|
||||
_$LocalAccountImpl(
|
||||
identityMaster: IdentityMaster.fromJson(json['identity_master']),
|
||||
identitySecretBytes: const Uint8ListJsonConverter()
|
||||
.fromJson(json['identity_secret_bytes'] as String),
|
||||
|
@ -18,7 +18,7 @@ _$_LocalAccount _$$_LocalAccountFromJson(Map<String, dynamic> json) =>
|
|||
name: json['name'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$_LocalAccountToJson(_$_LocalAccount instance) =>
|
||||
Map<String, dynamic> _$$LocalAccountImplToJson(_$LocalAccountImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'identity_master': instance.identityMaster.toJson(),
|
||||
'identity_secret_bytes':
|
||||
|
|
|
@ -77,11 +77,11 @@ class _$LockPreferenceCopyWithImpl<$Res, $Val extends LockPreference>
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$_LockPreferenceCopyWith<$Res>
|
||||
abstract class _$$LockPreferenceImplCopyWith<$Res>
|
||||
implements $LockPreferenceCopyWith<$Res> {
|
||||
factory _$$_LockPreferenceCopyWith(
|
||||
_$_LockPreference value, $Res Function(_$_LockPreference) then) =
|
||||
__$$_LockPreferenceCopyWithImpl<$Res>;
|
||||
factory _$$LockPreferenceImplCopyWith(_$LockPreferenceImpl value,
|
||||
$Res Function(_$LockPreferenceImpl) then) =
|
||||
__$$LockPreferenceImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
|
@ -91,11 +91,11 @@ abstract class _$$_LockPreferenceCopyWith<$Res>
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$_LockPreferenceCopyWithImpl<$Res>
|
||||
extends _$LockPreferenceCopyWithImpl<$Res, _$_LockPreference>
|
||||
implements _$$_LockPreferenceCopyWith<$Res> {
|
||||
__$$_LockPreferenceCopyWithImpl(
|
||||
_$_LockPreference _value, $Res Function(_$_LockPreference) _then)
|
||||
class __$$LockPreferenceImplCopyWithImpl<$Res>
|
||||
extends _$LockPreferenceCopyWithImpl<$Res, _$LockPreferenceImpl>
|
||||
implements _$$LockPreferenceImplCopyWith<$Res> {
|
||||
__$$LockPreferenceImplCopyWithImpl(
|
||||
_$LockPreferenceImpl _value, $Res Function(_$LockPreferenceImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
|
@ -105,7 +105,7 @@ class __$$_LockPreferenceCopyWithImpl<$Res>
|
|||
Object? lockWhenSwitching = null,
|
||||
Object? lockWithSystemLock = null,
|
||||
}) {
|
||||
return _then(_$_LockPreference(
|
||||
return _then(_$LockPreferenceImpl(
|
||||
inactivityLockSecs: null == inactivityLockSecs
|
||||
? _value.inactivityLockSecs
|
||||
: inactivityLockSecs // ignore: cast_nullable_to_non_nullable
|
||||
|
@ -124,14 +124,14 @@ class __$$_LockPreferenceCopyWithImpl<$Res>
|
|||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$_LockPreference implements _LockPreference {
|
||||
const _$_LockPreference(
|
||||
class _$LockPreferenceImpl implements _LockPreference {
|
||||
const _$LockPreferenceImpl(
|
||||
{required this.inactivityLockSecs,
|
||||
required this.lockWhenSwitching,
|
||||
required this.lockWithSystemLock});
|
||||
|
||||
factory _$_LockPreference.fromJson(Map<String, dynamic> json) =>
|
||||
_$$_LockPreferenceFromJson(json);
|
||||
factory _$LockPreferenceImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$LockPreferenceImplFromJson(json);
|
||||
|
||||
@override
|
||||
final int inactivityLockSecs;
|
||||
|
@ -149,7 +149,7 @@ class _$_LockPreference implements _LockPreference {
|
|||
bool operator ==(dynamic other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$_LockPreference &&
|
||||
other is _$LockPreferenceImpl &&
|
||||
(identical(other.inactivityLockSecs, inactivityLockSecs) ||
|
||||
other.inactivityLockSecs == inactivityLockSecs) &&
|
||||
(identical(other.lockWhenSwitching, lockWhenSwitching) ||
|
||||
|
@ -166,12 +166,13 @@ class _$_LockPreference implements _LockPreference {
|
|||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$_LockPreferenceCopyWith<_$_LockPreference> get copyWith =>
|
||||
__$$_LockPreferenceCopyWithImpl<_$_LockPreference>(this, _$identity);
|
||||
_$$LockPreferenceImplCopyWith<_$LockPreferenceImpl> get copyWith =>
|
||||
__$$LockPreferenceImplCopyWithImpl<_$LockPreferenceImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$_LockPreferenceToJson(
|
||||
return _$$LockPreferenceImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
|
@ -181,10 +182,10 @@ abstract class _LockPreference implements LockPreference {
|
|||
const factory _LockPreference(
|
||||
{required final int inactivityLockSecs,
|
||||
required final bool lockWhenSwitching,
|
||||
required final bool lockWithSystemLock}) = _$_LockPreference;
|
||||
required final bool lockWithSystemLock}) = _$LockPreferenceImpl;
|
||||
|
||||
factory _LockPreference.fromJson(Map<String, dynamic> json) =
|
||||
_$_LockPreference.fromJson;
|
||||
_$LockPreferenceImpl.fromJson;
|
||||
|
||||
@override
|
||||
int get inactivityLockSecs;
|
||||
|
@ -194,7 +195,7 @@ abstract class _LockPreference implements LockPreference {
|
|||
bool get lockWithSystemLock;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$_LockPreferenceCopyWith<_$_LockPreference> get copyWith =>
|
||||
_$$LockPreferenceImplCopyWith<_$LockPreferenceImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
|
@ -262,11 +263,11 @@ class _$ThemePreferencesCopyWithImpl<$Res, $Val extends ThemePreferences>
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$_ThemePreferencesCopyWith<$Res>
|
||||
abstract class _$$ThemePreferencesImplCopyWith<$Res>
|
||||
implements $ThemePreferencesCopyWith<$Res> {
|
||||
factory _$$_ThemePreferencesCopyWith(
|
||||
_$_ThemePreferences value, $Res Function(_$_ThemePreferences) then) =
|
||||
__$$_ThemePreferencesCopyWithImpl<$Res>;
|
||||
factory _$$ThemePreferencesImplCopyWith(_$ThemePreferencesImpl value,
|
||||
$Res Function(_$ThemePreferencesImpl) then) =
|
||||
__$$ThemePreferencesImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
|
@ -276,11 +277,11 @@ abstract class _$$_ThemePreferencesCopyWith<$Res>
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$_ThemePreferencesCopyWithImpl<$Res>
|
||||
extends _$ThemePreferencesCopyWithImpl<$Res, _$_ThemePreferences>
|
||||
implements _$$_ThemePreferencesCopyWith<$Res> {
|
||||
__$$_ThemePreferencesCopyWithImpl(
|
||||
_$_ThemePreferences _value, $Res Function(_$_ThemePreferences) _then)
|
||||
class __$$ThemePreferencesImplCopyWithImpl<$Res>
|
||||
extends _$ThemePreferencesCopyWithImpl<$Res, _$ThemePreferencesImpl>
|
||||
implements _$$ThemePreferencesImplCopyWith<$Res> {
|
||||
__$$ThemePreferencesImplCopyWithImpl(_$ThemePreferencesImpl _value,
|
||||
$Res Function(_$ThemePreferencesImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
|
@ -290,7 +291,7 @@ class __$$_ThemePreferencesCopyWithImpl<$Res>
|
|||
Object? colorPreference = null,
|
||||
Object? displayScale = null,
|
||||
}) {
|
||||
return _then(_$_ThemePreferences(
|
||||
return _then(_$ThemePreferencesImpl(
|
||||
brightnessPreference: null == brightnessPreference
|
||||
? _value.brightnessPreference
|
||||
: brightnessPreference // ignore: cast_nullable_to_non_nullable
|
||||
|
@ -309,14 +310,14 @@ class __$$_ThemePreferencesCopyWithImpl<$Res>
|
|||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$_ThemePreferences implements _ThemePreferences {
|
||||
const _$_ThemePreferences(
|
||||
class _$ThemePreferencesImpl implements _ThemePreferences {
|
||||
const _$ThemePreferencesImpl(
|
||||
{required this.brightnessPreference,
|
||||
required this.colorPreference,
|
||||
required this.displayScale});
|
||||
|
||||
factory _$_ThemePreferences.fromJson(Map<String, dynamic> json) =>
|
||||
_$$_ThemePreferencesFromJson(json);
|
||||
factory _$ThemePreferencesImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ThemePreferencesImplFromJson(json);
|
||||
|
||||
@override
|
||||
final BrightnessPreference brightnessPreference;
|
||||
|
@ -334,7 +335,7 @@ class _$_ThemePreferences implements _ThemePreferences {
|
|||
bool operator ==(dynamic other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$_ThemePreferences &&
|
||||
other is _$ThemePreferencesImpl &&
|
||||
(identical(other.brightnessPreference, brightnessPreference) ||
|
||||
other.brightnessPreference == brightnessPreference) &&
|
||||
(identical(other.colorPreference, colorPreference) ||
|
||||
|
@ -351,12 +352,13 @@ class _$_ThemePreferences implements _ThemePreferences {
|
|||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$_ThemePreferencesCopyWith<_$_ThemePreferences> get copyWith =>
|
||||
__$$_ThemePreferencesCopyWithImpl<_$_ThemePreferences>(this, _$identity);
|
||||
_$$ThemePreferencesImplCopyWith<_$ThemePreferencesImpl> get copyWith =>
|
||||
__$$ThemePreferencesImplCopyWithImpl<_$ThemePreferencesImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$_ThemePreferencesToJson(
|
||||
return _$$ThemePreferencesImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
|
@ -366,10 +368,10 @@ abstract class _ThemePreferences implements ThemePreferences {
|
|||
const factory _ThemePreferences(
|
||||
{required final BrightnessPreference brightnessPreference,
|
||||
required final ColorPreference colorPreference,
|
||||
required final double displayScale}) = _$_ThemePreferences;
|
||||
required final double displayScale}) = _$ThemePreferencesImpl;
|
||||
|
||||
factory _ThemePreferences.fromJson(Map<String, dynamic> json) =
|
||||
_$_ThemePreferences.fromJson;
|
||||
_$ThemePreferencesImpl.fromJson;
|
||||
|
||||
@override
|
||||
BrightnessPreference get brightnessPreference;
|
||||
|
@ -379,7 +381,7 @@ abstract class _ThemePreferences implements ThemePreferences {
|
|||
double get displayScale;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$_ThemePreferencesCopyWith<_$_ThemePreferences> get copyWith =>
|
||||
_$$ThemePreferencesImplCopyWith<_$ThemePreferencesImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
|
@ -465,11 +467,11 @@ class _$PreferencesCopyWithImpl<$Res, $Val extends Preferences>
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$_PreferencesCopyWith<$Res>
|
||||
abstract class _$$PreferencesImplCopyWith<$Res>
|
||||
implements $PreferencesCopyWith<$Res> {
|
||||
factory _$$_PreferencesCopyWith(
|
||||
_$_Preferences value, $Res Function(_$_Preferences) then) =
|
||||
__$$_PreferencesCopyWithImpl<$Res>;
|
||||
factory _$$PreferencesImplCopyWith(
|
||||
_$PreferencesImpl value, $Res Function(_$PreferencesImpl) then) =
|
||||
__$$PreferencesImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
|
@ -484,11 +486,11 @@ abstract class _$$_PreferencesCopyWith<$Res>
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$_PreferencesCopyWithImpl<$Res>
|
||||
extends _$PreferencesCopyWithImpl<$Res, _$_Preferences>
|
||||
implements _$$_PreferencesCopyWith<$Res> {
|
||||
__$$_PreferencesCopyWithImpl(
|
||||
_$_Preferences _value, $Res Function(_$_Preferences) _then)
|
||||
class __$$PreferencesImplCopyWithImpl<$Res>
|
||||
extends _$PreferencesCopyWithImpl<$Res, _$PreferencesImpl>
|
||||
implements _$$PreferencesImplCopyWith<$Res> {
|
||||
__$$PreferencesImplCopyWithImpl(
|
||||
_$PreferencesImpl _value, $Res Function(_$PreferencesImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
|
@ -498,7 +500,7 @@ class __$$_PreferencesCopyWithImpl<$Res>
|
|||
Object? language = null,
|
||||
Object? locking = null,
|
||||
}) {
|
||||
return _then(_$_Preferences(
|
||||
return _then(_$PreferencesImpl(
|
||||
themePreferences: null == themePreferences
|
||||
? _value.themePreferences
|
||||
: themePreferences // ignore: cast_nullable_to_non_nullable
|
||||
|
@ -517,14 +519,14 @@ class __$$_PreferencesCopyWithImpl<$Res>
|
|||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$_Preferences implements _Preferences {
|
||||
const _$_Preferences(
|
||||
class _$PreferencesImpl implements _Preferences {
|
||||
const _$PreferencesImpl(
|
||||
{required this.themePreferences,
|
||||
required this.language,
|
||||
required this.locking});
|
||||
|
||||
factory _$_Preferences.fromJson(Map<String, dynamic> json) =>
|
||||
_$$_PreferencesFromJson(json);
|
||||
factory _$PreferencesImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$PreferencesImplFromJson(json);
|
||||
|
||||
@override
|
||||
final ThemePreferences themePreferences;
|
||||
|
@ -542,7 +544,7 @@ class _$_Preferences implements _Preferences {
|
|||
bool operator ==(dynamic other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$_Preferences &&
|
||||
other is _$PreferencesImpl &&
|
||||
(identical(other.themePreferences, themePreferences) ||
|
||||
other.themePreferences == themePreferences) &&
|
||||
(identical(other.language, language) ||
|
||||
|
@ -558,12 +560,12 @@ class _$_Preferences implements _Preferences {
|
|||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$_PreferencesCopyWith<_$_Preferences> get copyWith =>
|
||||
__$$_PreferencesCopyWithImpl<_$_Preferences>(this, _$identity);
|
||||
_$$PreferencesImplCopyWith<_$PreferencesImpl> get copyWith =>
|
||||
__$$PreferencesImplCopyWithImpl<_$PreferencesImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$_PreferencesToJson(
|
||||
return _$$PreferencesImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
|
@ -573,10 +575,10 @@ abstract class _Preferences implements Preferences {
|
|||
const factory _Preferences(
|
||||
{required final ThemePreferences themePreferences,
|
||||
required final LanguagePreference language,
|
||||
required final LockPreference locking}) = _$_Preferences;
|
||||
required final LockPreference locking}) = _$PreferencesImpl;
|
||||
|
||||
factory _Preferences.fromJson(Map<String, dynamic> json) =
|
||||
_$_Preferences.fromJson;
|
||||
_$PreferencesImpl.fromJson;
|
||||
|
||||
@override
|
||||
ThemePreferences get themePreferences;
|
||||
|
@ -586,6 +588,6 @@ abstract class _Preferences implements Preferences {
|
|||
LockPreference get locking;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$_PreferencesCopyWith<_$_Preferences> get copyWith =>
|
||||
_$$PreferencesImplCopyWith<_$PreferencesImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
|
|
@ -6,43 +6,46 @@ part of 'preferences.dart';
|
|||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$_LockPreference _$$_LockPreferenceFromJson(Map<String, dynamic> json) =>
|
||||
_$_LockPreference(
|
||||
_$LockPreferenceImpl _$$LockPreferenceImplFromJson(Map<String, dynamic> json) =>
|
||||
_$LockPreferenceImpl(
|
||||
inactivityLockSecs: json['inactivity_lock_secs'] as int,
|
||||
lockWhenSwitching: json['lock_when_switching'] as bool,
|
||||
lockWithSystemLock: json['lock_with_system_lock'] as bool,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$_LockPreferenceToJson(_$_LockPreference instance) =>
|
||||
Map<String, dynamic> _$$LockPreferenceImplToJson(
|
||||
_$LockPreferenceImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'inactivity_lock_secs': instance.inactivityLockSecs,
|
||||
'lock_when_switching': instance.lockWhenSwitching,
|
||||
'lock_with_system_lock': instance.lockWithSystemLock,
|
||||
};
|
||||
|
||||
_$_ThemePreferences _$$_ThemePreferencesFromJson(Map<String, dynamic> json) =>
|
||||
_$_ThemePreferences(
|
||||
_$ThemePreferencesImpl _$$ThemePreferencesImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$ThemePreferencesImpl(
|
||||
brightnessPreference:
|
||||
BrightnessPreference.fromJson(json['brightness_preference']),
|
||||
colorPreference: ColorPreference.fromJson(json['color_preference']),
|
||||
displayScale: (json['display_scale'] as num).toDouble(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$_ThemePreferencesToJson(_$_ThemePreferences instance) =>
|
||||
Map<String, dynamic> _$$ThemePreferencesImplToJson(
|
||||
_$ThemePreferencesImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'brightness_preference': instance.brightnessPreference.toJson(),
|
||||
'color_preference': instance.colorPreference.toJson(),
|
||||
'display_scale': instance.displayScale,
|
||||
};
|
||||
|
||||
_$_Preferences _$$_PreferencesFromJson(Map<String, dynamic> json) =>
|
||||
_$_Preferences(
|
||||
_$PreferencesImpl _$$PreferencesImplFromJson(Map<String, dynamic> json) =>
|
||||
_$PreferencesImpl(
|
||||
themePreferences: ThemePreferences.fromJson(json['theme_preferences']),
|
||||
language: LanguagePreference.fromJson(json['language']),
|
||||
locking: LockPreference.fromJson(json['locking']),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$_PreferencesToJson(_$_Preferences instance) =>
|
||||
Map<String, dynamic> _$$PreferencesImplToJson(_$PreferencesImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'theme_preferences': instance.themePreferences.toJson(),
|
||||
'language': instance.language.toJson(),
|
||||
|
|
|
@ -97,10 +97,11 @@ class _$UserLoginCopyWithImpl<$Res, $Val extends UserLogin>
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$_UserLoginCopyWith<$Res> implements $UserLoginCopyWith<$Res> {
|
||||
factory _$$_UserLoginCopyWith(
|
||||
_$_UserLogin value, $Res Function(_$_UserLogin) then) =
|
||||
__$$_UserLoginCopyWithImpl<$Res>;
|
||||
abstract class _$$UserLoginImplCopyWith<$Res>
|
||||
implements $UserLoginCopyWith<$Res> {
|
||||
factory _$$UserLoginImplCopyWith(
|
||||
_$UserLoginImpl value, $Res Function(_$UserLoginImpl) then) =
|
||||
__$$UserLoginImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
|
@ -114,11 +115,11 @@ abstract class _$$_UserLoginCopyWith<$Res> implements $UserLoginCopyWith<$Res> {
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$_UserLoginCopyWithImpl<$Res>
|
||||
extends _$UserLoginCopyWithImpl<$Res, _$_UserLogin>
|
||||
implements _$$_UserLoginCopyWith<$Res> {
|
||||
__$$_UserLoginCopyWithImpl(
|
||||
_$_UserLogin _value, $Res Function(_$_UserLogin) _then)
|
||||
class __$$UserLoginImplCopyWithImpl<$Res>
|
||||
extends _$UserLoginCopyWithImpl<$Res, _$UserLoginImpl>
|
||||
implements _$$UserLoginImplCopyWith<$Res> {
|
||||
__$$UserLoginImplCopyWithImpl(
|
||||
_$UserLoginImpl _value, $Res Function(_$UserLoginImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
|
@ -129,7 +130,7 @@ class __$$_UserLoginCopyWithImpl<$Res>
|
|||
Object? accountRecordInfo = null,
|
||||
Object? lastActive = null,
|
||||
}) {
|
||||
return _then(_$_UserLogin(
|
||||
return _then(_$UserLoginImpl(
|
||||
accountMasterRecordKey: null == accountMasterRecordKey
|
||||
? _value.accountMasterRecordKey
|
||||
: accountMasterRecordKey // ignore: cast_nullable_to_non_nullable
|
||||
|
@ -152,15 +153,15 @@ class __$$_UserLoginCopyWithImpl<$Res>
|
|||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$_UserLogin implements _UserLogin {
|
||||
const _$_UserLogin(
|
||||
class _$UserLoginImpl implements _UserLogin {
|
||||
const _$UserLoginImpl(
|
||||
{required this.accountMasterRecordKey,
|
||||
required this.identitySecret,
|
||||
required this.accountRecordInfo,
|
||||
required this.lastActive});
|
||||
|
||||
factory _$_UserLogin.fromJson(Map<String, dynamic> json) =>
|
||||
_$$_UserLoginFromJson(json);
|
||||
factory _$UserLoginImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$UserLoginImplFromJson(json);
|
||||
|
||||
// Master record key for the user used to index the local accounts table
|
||||
@override
|
||||
|
@ -184,7 +185,7 @@ class _$_UserLogin implements _UserLogin {
|
|||
bool operator ==(dynamic other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$_UserLogin &&
|
||||
other is _$UserLoginImpl &&
|
||||
(identical(other.accountMasterRecordKey, accountMasterRecordKey) ||
|
||||
other.accountMasterRecordKey == accountMasterRecordKey) &&
|
||||
(identical(other.identitySecret, identitySecret) ||
|
||||
|
@ -203,12 +204,12 @@ class _$_UserLogin implements _UserLogin {
|
|||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$_UserLoginCopyWith<_$_UserLogin> get copyWith =>
|
||||
__$$_UserLoginCopyWithImpl<_$_UserLogin>(this, _$identity);
|
||||
_$$UserLoginImplCopyWith<_$UserLoginImpl> get copyWith =>
|
||||
__$$UserLoginImplCopyWithImpl<_$UserLoginImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$_UserLoginToJson(
|
||||
return _$$UserLoginImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
|
@ -219,10 +220,10 @@ abstract class _UserLogin implements UserLogin {
|
|||
{required final Typed<FixedEncodedString43> accountMasterRecordKey,
|
||||
required final Typed<FixedEncodedString43> identitySecret,
|
||||
required final AccountRecordInfo accountRecordInfo,
|
||||
required final Timestamp lastActive}) = _$_UserLogin;
|
||||
required final Timestamp lastActive}) = _$UserLoginImpl;
|
||||
|
||||
factory _UserLogin.fromJson(Map<String, dynamic> json) =
|
||||
_$_UserLogin.fromJson;
|
||||
_$UserLoginImpl.fromJson;
|
||||
|
||||
@override // Master record key for the user used to index the local accounts table
|
||||
Typed<FixedEncodedString43> get accountMasterRecordKey;
|
||||
|
@ -234,7 +235,7 @@ abstract class _UserLogin implements UserLogin {
|
|||
Timestamp get lastActive;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$_UserLoginCopyWith<_$_UserLogin> get copyWith =>
|
||||
_$$UserLoginImplCopyWith<_$UserLoginImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
|
@ -297,11 +298,11 @@ class _$ActiveLoginsCopyWithImpl<$Res, $Val extends ActiveLogins>
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$_ActiveLoginsCopyWith<$Res>
|
||||
abstract class _$$ActiveLoginsImplCopyWith<$Res>
|
||||
implements $ActiveLoginsCopyWith<$Res> {
|
||||
factory _$$_ActiveLoginsCopyWith(
|
||||
_$_ActiveLogins value, $Res Function(_$_ActiveLogins) then) =
|
||||
__$$_ActiveLoginsCopyWithImpl<$Res>;
|
||||
factory _$$ActiveLoginsImplCopyWith(
|
||||
_$ActiveLoginsImpl value, $Res Function(_$ActiveLoginsImpl) then) =
|
||||
__$$ActiveLoginsImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
|
@ -310,11 +311,11 @@ abstract class _$$_ActiveLoginsCopyWith<$Res>
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$_ActiveLoginsCopyWithImpl<$Res>
|
||||
extends _$ActiveLoginsCopyWithImpl<$Res, _$_ActiveLogins>
|
||||
implements _$$_ActiveLoginsCopyWith<$Res> {
|
||||
__$$_ActiveLoginsCopyWithImpl(
|
||||
_$_ActiveLogins _value, $Res Function(_$_ActiveLogins) _then)
|
||||
class __$$ActiveLoginsImplCopyWithImpl<$Res>
|
||||
extends _$ActiveLoginsCopyWithImpl<$Res, _$ActiveLoginsImpl>
|
||||
implements _$$ActiveLoginsImplCopyWith<$Res> {
|
||||
__$$ActiveLoginsImplCopyWithImpl(
|
||||
_$ActiveLoginsImpl _value, $Res Function(_$ActiveLoginsImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
|
@ -323,7 +324,7 @@ class __$$_ActiveLoginsCopyWithImpl<$Res>
|
|||
Object? userLogins = null,
|
||||
Object? activeUserLogin = freezed,
|
||||
}) {
|
||||
return _then(_$_ActiveLogins(
|
||||
return _then(_$ActiveLoginsImpl(
|
||||
userLogins: null == userLogins
|
||||
? _value.userLogins
|
||||
: userLogins // ignore: cast_nullable_to_non_nullable
|
||||
|
@ -338,11 +339,11 @@ class __$$_ActiveLoginsCopyWithImpl<$Res>
|
|||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$_ActiveLogins implements _ActiveLogins {
|
||||
const _$_ActiveLogins({required this.userLogins, this.activeUserLogin});
|
||||
class _$ActiveLoginsImpl implements _ActiveLogins {
|
||||
const _$ActiveLoginsImpl({required this.userLogins, this.activeUserLogin});
|
||||
|
||||
factory _$_ActiveLogins.fromJson(Map<String, dynamic> json) =>
|
||||
_$$_ActiveLoginsFromJson(json);
|
||||
factory _$ActiveLoginsImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ActiveLoginsImplFromJson(json);
|
||||
|
||||
// The list of current logged in accounts
|
||||
@override
|
||||
|
@ -360,7 +361,7 @@ class _$_ActiveLogins implements _ActiveLogins {
|
|||
bool operator ==(dynamic other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$_ActiveLogins &&
|
||||
other is _$ActiveLoginsImpl &&
|
||||
const DeepCollectionEquality()
|
||||
.equals(other.userLogins, userLogins) &&
|
||||
(identical(other.activeUserLogin, activeUserLogin) ||
|
||||
|
@ -375,12 +376,12 @@ class _$_ActiveLogins implements _ActiveLogins {
|
|||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$_ActiveLoginsCopyWith<_$_ActiveLogins> get copyWith =>
|
||||
__$$_ActiveLoginsCopyWithImpl<_$_ActiveLogins>(this, _$identity);
|
||||
_$$ActiveLoginsImplCopyWith<_$ActiveLoginsImpl> get copyWith =>
|
||||
__$$ActiveLoginsImplCopyWithImpl<_$ActiveLoginsImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$_ActiveLoginsToJson(
|
||||
return _$$ActiveLoginsImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
|
@ -389,10 +390,10 @@ class _$_ActiveLogins implements _ActiveLogins {
|
|||
abstract class _ActiveLogins implements ActiveLogins {
|
||||
const factory _ActiveLogins(
|
||||
{required final IList<UserLogin> userLogins,
|
||||
final Typed<FixedEncodedString43>? activeUserLogin}) = _$_ActiveLogins;
|
||||
final Typed<FixedEncodedString43>? activeUserLogin}) = _$ActiveLoginsImpl;
|
||||
|
||||
factory _ActiveLogins.fromJson(Map<String, dynamic> json) =
|
||||
_$_ActiveLogins.fromJson;
|
||||
_$ActiveLoginsImpl.fromJson;
|
||||
|
||||
@override // The list of current logged in accounts
|
||||
IList<UserLogin> get userLogins;
|
||||
|
@ -400,6 +401,6 @@ abstract class _ActiveLogins implements ActiveLogins {
|
|||
Typed<FixedEncodedString43>? get activeUserLogin;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$_ActiveLoginsCopyWith<_$_ActiveLogins> get copyWith =>
|
||||
_$$ActiveLoginsImplCopyWith<_$ActiveLoginsImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
|
|
@ -6,7 +6,8 @@ part of 'user_login.dart';
|
|||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$_UserLogin _$$_UserLoginFromJson(Map<String, dynamic> json) => _$_UserLogin(
|
||||
_$UserLoginImpl _$$UserLoginImplFromJson(Map<String, dynamic> json) =>
|
||||
_$UserLoginImpl(
|
||||
accountMasterRecordKey: Typed<FixedEncodedString43>.fromJson(
|
||||
json['account_master_record_key']),
|
||||
identitySecret:
|
||||
|
@ -16,7 +17,7 @@ _$_UserLogin _$$_UserLoginFromJson(Map<String, dynamic> json) => _$_UserLogin(
|
|||
lastActive: Timestamp.fromJson(json['last_active']),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$_UserLoginToJson(_$_UserLogin instance) =>
|
||||
Map<String, dynamic> _$$UserLoginImplToJson(_$UserLoginImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'account_master_record_key': instance.accountMasterRecordKey.toJson(),
|
||||
'identity_secret': instance.identitySecret.toJson(),
|
||||
|
@ -24,8 +25,8 @@ Map<String, dynamic> _$$_UserLoginToJson(_$_UserLogin instance) =>
|
|||
'last_active': instance.lastActive.toJson(),
|
||||
};
|
||||
|
||||
_$_ActiveLogins _$$_ActiveLoginsFromJson(Map<String, dynamic> json) =>
|
||||
_$_ActiveLogins(
|
||||
_$ActiveLoginsImpl _$$ActiveLoginsImplFromJson(Map<String, dynamic> json) =>
|
||||
_$ActiveLoginsImpl(
|
||||
userLogins: IList<UserLogin>.fromJson(
|
||||
json['user_logins'], (value) => UserLogin.fromJson(value)),
|
||||
activeUserLogin: json['active_user_login'] == null
|
||||
|
@ -33,7 +34,7 @@ _$_ActiveLogins _$$_ActiveLoginsFromJson(Map<String, dynamic> json) =>
|
|||
: Typed<FixedEncodedString43>.fromJson(json['active_user_login']),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$_ActiveLoginsToJson(_$_ActiveLogins instance) =>
|
||||
Map<String, dynamic> _$$ActiveLoginsImplToJson(_$ActiveLoginsImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'user_logins': instance.userLogins.toJson(
|
||||
(value) => value.toJson(),
|
||||
|
|
|
@ -122,8 +122,10 @@ class HomePageState extends ConsumerState<HomePage>
|
|||
onPressed: () async {
|
||||
context.go('/home/settings');
|
||||
}).paddingLTRB(0, 0, 8, 0),
|
||||
ProfileWidget(name: account.profile.name, title: account.profile.title)
|
||||
.expanded(),
|
||||
ProfileWidget(
|
||||
name: account.profile.name,
|
||||
pronouns: account.profile.pronouns,
|
||||
).expanded(),
|
||||
]).paddingAll(8),
|
||||
MainPager(
|
||||
localAccounts: localAccounts,
|
||||
|
|
|
@ -173,7 +173,7 @@ class MainPagerState extends ConsumerState<MainPager>
|
|||
IconButton(
|
||||
onPressed: () async {
|
||||
Navigator.pop(context);
|
||||
//await scanContactInvitationDialog(context);
|
||||
await ScanInviteDialog.show(context);
|
||||
},
|
||||
iconSize: 64,
|
||||
icon: const Icon(Icons.qr_code_scanner)),
|
||||
|
|
|
@ -27,7 +27,7 @@ class NewAccountPageState extends ConsumerState<NewAccountPage> {
|
|||
final _formKey = GlobalKey<FormBuilderState>();
|
||||
late bool isInAsyncCall = false;
|
||||
static const String formFieldName = 'name';
|
||||
static const String formFieldTitle = 'title';
|
||||
static const String formFieldPronouns = 'pronouns';
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
|
@ -48,8 +48,8 @@ class NewAccountPageState extends ConsumerState<NewAccountPage> {
|
|||
final logins = ref.read(loginsProvider.notifier);
|
||||
|
||||
final name = _formKey.currentState!.fields[formFieldName]!.value as String;
|
||||
final title =
|
||||
_formKey.currentState!.fields[formFieldTitle]!.value as String;
|
||||
final pronouns =
|
||||
_formKey.currentState!.fields[formFieldPronouns]!.value as String;
|
||||
|
||||
final imws = await IdentityMasterWithSecrets.create();
|
||||
try {
|
||||
|
@ -57,7 +57,7 @@ class NewAccountPageState extends ConsumerState<NewAccountPage> {
|
|||
identityMaster: imws.identityMaster,
|
||||
identitySecret: imws.identitySecret,
|
||||
name: name,
|
||||
title: title);
|
||||
pronouns: pronouns);
|
||||
|
||||
// Log in the new account by default with no pin
|
||||
final ok = await logins.login(localAccount.identityMaster.masterRecordKey,
|
||||
|
@ -83,7 +83,7 @@ class NewAccountPageState extends ConsumerState<NewAccountPage> {
|
|||
autofocus: true,
|
||||
name: formFieldName,
|
||||
decoration:
|
||||
InputDecoration(hintText: translate('account.form_name')),
|
||||
InputDecoration(labelText: translate('account.form_name')),
|
||||
maxLength: 64,
|
||||
// The validator receives the text that the user has entered.
|
||||
validator: FormBuilderValidators.compose([
|
||||
|
@ -91,10 +91,10 @@ class NewAccountPageState extends ConsumerState<NewAccountPage> {
|
|||
]),
|
||||
),
|
||||
FormBuilderTextField(
|
||||
name: formFieldTitle,
|
||||
name: formFieldPronouns,
|
||||
maxLength: 64,
|
||||
decoration:
|
||||
InputDecoration(hintText: translate('account.form_title')),
|
||||
decoration: InputDecoration(
|
||||
labelText: translate('account.form_pronouns')),
|
||||
),
|
||||
Row(children: [
|
||||
const Spacer(),
|
||||
|
|
|
@ -372,7 +372,7 @@ class Profile extends $pb.GeneratedMessage {
|
|||
|
||||
static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Profile', package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), createEmptyInstance: create)
|
||||
..aOS(1, _omitFieldNames ? '' : 'name')
|
||||
..aOS(2, _omitFieldNames ? '' : 'title')
|
||||
..aOS(2, _omitFieldNames ? '' : 'pronouns')
|
||||
..aOS(3, _omitFieldNames ? '' : 'status')
|
||||
..e<Availability>(4, _omitFieldNames ? '' : 'availability', $pb.PbFieldType.OE, defaultOrMaker: Availability.AVAILABILITY_UNSPECIFIED, valueOf: Availability.valueOf, enumValues: Availability.values)
|
||||
..aOM<$1.TypedKey>(5, _omitFieldNames ? '' : 'avatar', subBuilder: $1.TypedKey.create)
|
||||
|
@ -410,13 +410,13 @@ class Profile extends $pb.GeneratedMessage {
|
|||
void clearName() => clearField(1);
|
||||
|
||||
@$pb.TagNumber(2)
|
||||
$core.String get title => $_getSZ(1);
|
||||
$core.String get pronouns => $_getSZ(1);
|
||||
@$pb.TagNumber(2)
|
||||
set title($core.String v) { $_setString(1, v); }
|
||||
set pronouns($core.String v) { $_setString(1, v); }
|
||||
@$pb.TagNumber(2)
|
||||
$core.bool hasTitle() => $_has(1);
|
||||
$core.bool hasPronouns() => $_has(1);
|
||||
@$pb.TagNumber(2)
|
||||
void clearTitle() => clearField(2);
|
||||
void clearPronouns() => clearField(2);
|
||||
|
||||
@$pb.TagNumber(3)
|
||||
$core.String get status => $_getSZ(2);
|
||||
|
|
|
@ -163,7 +163,7 @@ const Profile$json = {
|
|||
'1': 'Profile',
|
||||
'2': [
|
||||
{'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'},
|
||||
{'1': 'title', '3': 2, '4': 1, '5': 9, '10': 'title'},
|
||||
{'1': 'pronouns', '3': 2, '4': 1, '5': 9, '10': 'pronouns'},
|
||||
{'1': 'status', '3': 3, '4': 1, '5': 9, '10': 'status'},
|
||||
{'1': 'availability', '3': 4, '4': 1, '5': 14, '6': '.veilidchat.Availability', '10': 'availability'},
|
||||
{'1': 'avatar', '3': 5, '4': 1, '5': 11, '6': '.veilid.TypedKey', '9': 0, '10': 'avatar', '17': true},
|
||||
|
@ -175,10 +175,10 @@ const Profile$json = {
|
|||
|
||||
/// Descriptor for `Profile`. Decode as a `google.protobuf.DescriptorProto`.
|
||||
final $typed_data.Uint8List profileDescriptor = $convert.base64Decode(
|
||||
'CgdQcm9maWxlEhIKBG5hbWUYASABKAlSBG5hbWUSFAoFdGl0bGUYAiABKAlSBXRpdGxlEhYKBn'
|
||||
'N0YXR1cxgDIAEoCVIGc3RhdHVzEjwKDGF2YWlsYWJpbGl0eRgEIAEoDjIYLnZlaWxpZGNoYXQu'
|
||||
'QXZhaWxhYmlsaXR5UgxhdmFpbGFiaWxpdHkSLQoGYXZhdGFyGAUgASgLMhAudmVpbGlkLlR5cG'
|
||||
'VkS2V5SABSBmF2YXRhcogBAUIJCgdfYXZhdGFy');
|
||||
'CgdQcm9maWxlEhIKBG5hbWUYASABKAlSBG5hbWUSGgoIcHJvbm91bnMYAiABKAlSCHByb25vdW'
|
||||
'5zEhYKBnN0YXR1cxgDIAEoCVIGc3RhdHVzEjwKDGF2YWlsYWJpbGl0eRgEIAEoDjIYLnZlaWxp'
|
||||
'ZGNoYXQuQXZhaWxhYmlsaXR5UgxhdmFpbGFiaWxpdHkSLQoGYXZhdGFyGAUgASgLMhAudmVpbG'
|
||||
'lkLlR5cGVkS2V5SABSBmF2YXRhcogBAUIJCgdfYXZhdGFy');
|
||||
|
||||
@$core.Deprecated('Use chatDescriptor instead')
|
||||
const Chat$json = {
|
||||
|
|
|
@ -95,13 +95,13 @@ enum Availability {
|
|||
// Publicly shared profile information for both contacts and accounts
|
||||
// Contains:
|
||||
// Name - Friendly name
|
||||
// Title - Title of user
|
||||
// Pronouns - Pronouns of user
|
||||
// Icon - Little picture to represent user in contact list
|
||||
message Profile {
|
||||
// Friendy name
|
||||
string name = 1;
|
||||
// Title of user
|
||||
string title = 2;
|
||||
// Pronouns of user
|
||||
string pronouns = 2;
|
||||
// Status/away message
|
||||
string status = 3;
|
||||
// Availability
|
||||
|
|
|
@ -65,7 +65,7 @@ class LocalAccounts extends _$LocalAccounts
|
|||
{required IdentityMaster identityMaster,
|
||||
required SecretKey identitySecret,
|
||||
required String name,
|
||||
required String title,
|
||||
required String pronouns,
|
||||
EncryptionKeyType encryptionKeyType = EncryptionKeyType.none,
|
||||
String encryptionKey = ''}) async {
|
||||
final localAccounts = state.requireValue;
|
||||
|
@ -92,7 +92,7 @@ class LocalAccounts extends _$LocalAccounts
|
|||
final account = proto.Account()
|
||||
..profile = (proto.Profile()
|
||||
..name = name
|
||||
..title = title)
|
||||
..pronouns = pronouns)
|
||||
..contactList = contactList.toProto()
|
||||
..contactInvitationRecords = contactInvitationRecords.toProto()
|
||||
..chatList = chatRecords.toProto();
|
||||
|
|
|
@ -159,7 +159,7 @@ class _FetchLocalAccountProviderElement
|
|||
(origin as FetchLocalAccountProvider).accountMasterRecordKey;
|
||||
}
|
||||
|
||||
String _$localAccountsHash() => r'0ab9eca923cb9e15149f06d9edbb9de0cfed6790';
|
||||
String _$localAccountsHash() => r'148d98fcd8a61147bb475708d50b9699887c5bec';
|
||||
|
||||
/// See also [LocalAccounts].
|
||||
@ProviderFor(LocalAccounts)
|
||||
|
|
51
lib/tools/scanner_error_widget.dart
Normal file
51
lib/tools/scanner_error_widget.dart
Normal file
|
@ -0,0 +1,51 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:mobile_scanner/mobile_scanner.dart';
|
||||
|
||||
class ScannerErrorWidget extends StatelessWidget {
|
||||
const ScannerErrorWidget({Key? key, required this.error}) : super(key: key);
|
||||
|
||||
final MobileScannerException error;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
String errorMessage;
|
||||
|
||||
switch (error.errorCode) {
|
||||
case MobileScannerErrorCode.controllerUninitialized:
|
||||
errorMessage = 'Controller not ready.';
|
||||
break;
|
||||
case MobileScannerErrorCode.permissionDenied:
|
||||
errorMessage = 'Permission denied';
|
||||
break;
|
||||
case MobileScannerErrorCode.unsupported:
|
||||
errorMessage = 'Scanning is unsupported on this device';
|
||||
break;
|
||||
default:
|
||||
errorMessage = 'Generic Error';
|
||||
break;
|
||||
}
|
||||
|
||||
return ColoredBox(
|
||||
color: Colors.black,
|
||||
child: Center(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
const Padding(
|
||||
padding: EdgeInsets.only(bottom: 16),
|
||||
child: Icon(Icons.error, color: Colors.white),
|
||||
),
|
||||
Text(
|
||||
errorMessage,
|
||||
style: const TextStyle(color: Colors.white),
|
||||
),
|
||||
Text(
|
||||
error.errorDetails?.message ?? '',
|
||||
style: const TextStyle(color: Colors.white),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
|
@ -8,3 +8,4 @@ export 'secret_crypto.dart';
|
|||
export 'state_logger.dart';
|
||||
export 'theme_service.dart';
|
||||
export 'widget_helpers.dart';
|
||||
export 'scanner_error_widget.dart';
|
||||
|
|
|
@ -82,12 +82,12 @@ class _$DHTRecordPoolAllocationsCopyWithImpl<$Res,
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$_DHTRecordPoolAllocationsCopyWith<$Res>
|
||||
abstract class _$$DHTRecordPoolAllocationsImplCopyWith<$Res>
|
||||
implements $DHTRecordPoolAllocationsCopyWith<$Res> {
|
||||
factory _$$_DHTRecordPoolAllocationsCopyWith(
|
||||
_$_DHTRecordPoolAllocations value,
|
||||
$Res Function(_$_DHTRecordPoolAllocations) then) =
|
||||
__$$_DHTRecordPoolAllocationsCopyWithImpl<$Res>;
|
||||
factory _$$DHTRecordPoolAllocationsImplCopyWith(
|
||||
_$DHTRecordPoolAllocationsImpl value,
|
||||
$Res Function(_$DHTRecordPoolAllocationsImpl) then) =
|
||||
__$$DHTRecordPoolAllocationsImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
|
@ -97,12 +97,13 @@ abstract class _$$_DHTRecordPoolAllocationsCopyWith<$Res>
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$_DHTRecordPoolAllocationsCopyWithImpl<$Res>
|
||||
class __$$DHTRecordPoolAllocationsImplCopyWithImpl<$Res>
|
||||
extends _$DHTRecordPoolAllocationsCopyWithImpl<$Res,
|
||||
_$_DHTRecordPoolAllocations>
|
||||
implements _$$_DHTRecordPoolAllocationsCopyWith<$Res> {
|
||||
__$$_DHTRecordPoolAllocationsCopyWithImpl(_$_DHTRecordPoolAllocations _value,
|
||||
$Res Function(_$_DHTRecordPoolAllocations) _then)
|
||||
_$DHTRecordPoolAllocationsImpl>
|
||||
implements _$$DHTRecordPoolAllocationsImplCopyWith<$Res> {
|
||||
__$$DHTRecordPoolAllocationsImplCopyWithImpl(
|
||||
_$DHTRecordPoolAllocationsImpl _value,
|
||||
$Res Function(_$DHTRecordPoolAllocationsImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
|
@ -112,7 +113,7 @@ class __$$_DHTRecordPoolAllocationsCopyWithImpl<$Res>
|
|||
Object? parentByChild = null,
|
||||
Object? rootRecords = null,
|
||||
}) {
|
||||
return _then(_$_DHTRecordPoolAllocations(
|
||||
return _then(_$DHTRecordPoolAllocationsImpl(
|
||||
childrenByParent: null == childrenByParent
|
||||
? _value.childrenByParent
|
||||
: childrenByParent // ignore: cast_nullable_to_non_nullable
|
||||
|
@ -131,14 +132,14 @@ class __$$_DHTRecordPoolAllocationsCopyWithImpl<$Res>
|
|||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$_DHTRecordPoolAllocations implements _DHTRecordPoolAllocations {
|
||||
const _$_DHTRecordPoolAllocations(
|
||||
class _$DHTRecordPoolAllocationsImpl implements _DHTRecordPoolAllocations {
|
||||
const _$DHTRecordPoolAllocationsImpl(
|
||||
{required this.childrenByParent,
|
||||
required this.parentByChild,
|
||||
required this.rootRecords});
|
||||
|
||||
factory _$_DHTRecordPoolAllocations.fromJson(Map<String, dynamic> json) =>
|
||||
_$$_DHTRecordPoolAllocationsFromJson(json);
|
||||
factory _$DHTRecordPoolAllocationsImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$DHTRecordPoolAllocationsImplFromJson(json);
|
||||
|
||||
@override
|
||||
final IMap<String, ISet<Typed<FixedEncodedString43>>> childrenByParent;
|
||||
|
@ -158,7 +159,7 @@ class _$_DHTRecordPoolAllocations implements _DHTRecordPoolAllocations {
|
|||
bool operator ==(dynamic other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$_DHTRecordPoolAllocations &&
|
||||
other is _$DHTRecordPoolAllocationsImpl &&
|
||||
(identical(other.childrenByParent, childrenByParent) ||
|
||||
other.childrenByParent == childrenByParent) &&
|
||||
(identical(other.parentByChild, parentByChild) ||
|
||||
|
@ -175,13 +176,13 @@ class _$_DHTRecordPoolAllocations implements _DHTRecordPoolAllocations {
|
|||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$_DHTRecordPoolAllocationsCopyWith<_$_DHTRecordPoolAllocations>
|
||||
get copyWith => __$$_DHTRecordPoolAllocationsCopyWithImpl<
|
||||
_$_DHTRecordPoolAllocations>(this, _$identity);
|
||||
_$$DHTRecordPoolAllocationsImplCopyWith<_$DHTRecordPoolAllocationsImpl>
|
||||
get copyWith => __$$DHTRecordPoolAllocationsImplCopyWithImpl<
|
||||
_$DHTRecordPoolAllocationsImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$_DHTRecordPoolAllocationsToJson(
|
||||
return _$$DHTRecordPoolAllocationsImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
|
@ -193,10 +194,10 @@ abstract class _DHTRecordPoolAllocations implements DHTRecordPoolAllocations {
|
|||
childrenByParent,
|
||||
required final IMap<String, Typed<FixedEncodedString43>> parentByChild,
|
||||
required final ISet<Typed<FixedEncodedString43>>
|
||||
rootRecords}) = _$_DHTRecordPoolAllocations;
|
||||
rootRecords}) = _$DHTRecordPoolAllocationsImpl;
|
||||
|
||||
factory _DHTRecordPoolAllocations.fromJson(Map<String, dynamic> json) =
|
||||
_$_DHTRecordPoolAllocations.fromJson;
|
||||
_$DHTRecordPoolAllocationsImpl.fromJson;
|
||||
|
||||
@override
|
||||
IMap<String, ISet<Typed<FixedEncodedString43>>> get childrenByParent;
|
||||
|
@ -206,7 +207,7 @@ abstract class _DHTRecordPoolAllocations implements DHTRecordPoolAllocations {
|
|||
ISet<Typed<FixedEncodedString43>> get rootRecords;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$_DHTRecordPoolAllocationsCopyWith<_$_DHTRecordPoolAllocations>
|
||||
_$$DHTRecordPoolAllocationsImplCopyWith<_$DHTRecordPoolAllocationsImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
|
@ -267,22 +268,24 @@ class _$OwnedDHTRecordPointerCopyWithImpl<$Res,
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$_OwnedDHTRecordPointerCopyWith<$Res>
|
||||
abstract class _$$OwnedDHTRecordPointerImplCopyWith<$Res>
|
||||
implements $OwnedDHTRecordPointerCopyWith<$Res> {
|
||||
factory _$$_OwnedDHTRecordPointerCopyWith(_$_OwnedDHTRecordPointer value,
|
||||
$Res Function(_$_OwnedDHTRecordPointer) then) =
|
||||
__$$_OwnedDHTRecordPointerCopyWithImpl<$Res>;
|
||||
factory _$$OwnedDHTRecordPointerImplCopyWith(
|
||||
_$OwnedDHTRecordPointerImpl value,
|
||||
$Res Function(_$OwnedDHTRecordPointerImpl) then) =
|
||||
__$$OwnedDHTRecordPointerImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({Typed<FixedEncodedString43> recordKey, KeyPair owner});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$_OwnedDHTRecordPointerCopyWithImpl<$Res>
|
||||
extends _$OwnedDHTRecordPointerCopyWithImpl<$Res, _$_OwnedDHTRecordPointer>
|
||||
implements _$$_OwnedDHTRecordPointerCopyWith<$Res> {
|
||||
__$$_OwnedDHTRecordPointerCopyWithImpl(_$_OwnedDHTRecordPointer _value,
|
||||
$Res Function(_$_OwnedDHTRecordPointer) _then)
|
||||
class __$$OwnedDHTRecordPointerImplCopyWithImpl<$Res>
|
||||
extends _$OwnedDHTRecordPointerCopyWithImpl<$Res,
|
||||
_$OwnedDHTRecordPointerImpl>
|
||||
implements _$$OwnedDHTRecordPointerImplCopyWith<$Res> {
|
||||
__$$OwnedDHTRecordPointerImplCopyWithImpl(_$OwnedDHTRecordPointerImpl _value,
|
||||
$Res Function(_$OwnedDHTRecordPointerImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
|
@ -291,7 +294,7 @@ class __$$_OwnedDHTRecordPointerCopyWithImpl<$Res>
|
|||
Object? recordKey = null,
|
||||
Object? owner = null,
|
||||
}) {
|
||||
return _then(_$_OwnedDHTRecordPointer(
|
||||
return _then(_$OwnedDHTRecordPointerImpl(
|
||||
recordKey: null == recordKey
|
||||
? _value.recordKey
|
||||
: recordKey // ignore: cast_nullable_to_non_nullable
|
||||
|
@ -306,12 +309,12 @@ class __$$_OwnedDHTRecordPointerCopyWithImpl<$Res>
|
|||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$_OwnedDHTRecordPointer implements _OwnedDHTRecordPointer {
|
||||
const _$_OwnedDHTRecordPointer(
|
||||
class _$OwnedDHTRecordPointerImpl implements _OwnedDHTRecordPointer {
|
||||
const _$OwnedDHTRecordPointerImpl(
|
||||
{required this.recordKey, required this.owner});
|
||||
|
||||
factory _$_OwnedDHTRecordPointer.fromJson(Map<String, dynamic> json) =>
|
||||
_$$_OwnedDHTRecordPointerFromJson(json);
|
||||
factory _$OwnedDHTRecordPointerImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$OwnedDHTRecordPointerImplFromJson(json);
|
||||
|
||||
@override
|
||||
final Typed<FixedEncodedString43> recordKey;
|
||||
|
@ -327,7 +330,7 @@ class _$_OwnedDHTRecordPointer implements _OwnedDHTRecordPointer {
|
|||
bool operator ==(dynamic other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$_OwnedDHTRecordPointer &&
|
||||
other is _$OwnedDHTRecordPointerImpl &&
|
||||
(identical(other.recordKey, recordKey) ||
|
||||
other.recordKey == recordKey) &&
|
||||
(identical(other.owner, owner) || other.owner == owner));
|
||||
|
@ -340,13 +343,13 @@ class _$_OwnedDHTRecordPointer implements _OwnedDHTRecordPointer {
|
|||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$_OwnedDHTRecordPointerCopyWith<_$_OwnedDHTRecordPointer> get copyWith =>
|
||||
__$$_OwnedDHTRecordPointerCopyWithImpl<_$_OwnedDHTRecordPointer>(
|
||||
this, _$identity);
|
||||
_$$OwnedDHTRecordPointerImplCopyWith<_$OwnedDHTRecordPointerImpl>
|
||||
get copyWith => __$$OwnedDHTRecordPointerImplCopyWithImpl<
|
||||
_$OwnedDHTRecordPointerImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$_OwnedDHTRecordPointerToJson(
|
||||
return _$$OwnedDHTRecordPointerImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
|
@ -355,10 +358,10 @@ class _$_OwnedDHTRecordPointer implements _OwnedDHTRecordPointer {
|
|||
abstract class _OwnedDHTRecordPointer implements OwnedDHTRecordPointer {
|
||||
const factory _OwnedDHTRecordPointer(
|
||||
{required final Typed<FixedEncodedString43> recordKey,
|
||||
required final KeyPair owner}) = _$_OwnedDHTRecordPointer;
|
||||
required final KeyPair owner}) = _$OwnedDHTRecordPointerImpl;
|
||||
|
||||
factory _OwnedDHTRecordPointer.fromJson(Map<String, dynamic> json) =
|
||||
_$_OwnedDHTRecordPointer.fromJson;
|
||||
_$OwnedDHTRecordPointerImpl.fromJson;
|
||||
|
||||
@override
|
||||
Typed<FixedEncodedString43> get recordKey;
|
||||
|
@ -366,6 +369,6 @@ abstract class _OwnedDHTRecordPointer implements OwnedDHTRecordPointer {
|
|||
KeyPair get owner;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$_OwnedDHTRecordPointerCopyWith<_$_OwnedDHTRecordPointer> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
_$$OwnedDHTRecordPointerImplCopyWith<_$OwnedDHTRecordPointerImpl>
|
||||
get copyWith => throw _privateConstructorUsedError;
|
||||
}
|
||||
|
|
|
@ -6,9 +6,9 @@ part of 'dht_record_pool.dart';
|
|||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$_DHTRecordPoolAllocations _$$_DHTRecordPoolAllocationsFromJson(
|
||||
_$DHTRecordPoolAllocationsImpl _$$DHTRecordPoolAllocationsImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$_DHTRecordPoolAllocations(
|
||||
_$DHTRecordPoolAllocationsImpl(
|
||||
childrenByParent:
|
||||
IMap<String, ISet<Typed<FixedEncodedString43>>>.fromJson(
|
||||
json['children_by_parent'] as Map<String, dynamic>,
|
||||
|
@ -24,8 +24,8 @@ _$_DHTRecordPoolAllocations _$$_DHTRecordPoolAllocationsFromJson(
|
|||
(value) => Typed<FixedEncodedString43>.fromJson(value)),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$_DHTRecordPoolAllocationsToJson(
|
||||
_$_DHTRecordPoolAllocations instance) =>
|
||||
Map<String, dynamic> _$$DHTRecordPoolAllocationsImplToJson(
|
||||
_$DHTRecordPoolAllocationsImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'children_by_parent': instance.childrenByParent.toJson(
|
||||
(value) => value,
|
||||
|
@ -42,15 +42,15 @@ Map<String, dynamic> _$$_DHTRecordPoolAllocationsToJson(
|
|||
),
|
||||
};
|
||||
|
||||
_$_OwnedDHTRecordPointer _$$_OwnedDHTRecordPointerFromJson(
|
||||
_$OwnedDHTRecordPointerImpl _$$OwnedDHTRecordPointerImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$_OwnedDHTRecordPointer(
|
||||
_$OwnedDHTRecordPointerImpl(
|
||||
recordKey: Typed<FixedEncodedString43>.fromJson(json['record_key']),
|
||||
owner: KeyPair.fromJson(json['owner']),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$_OwnedDHTRecordPointerToJson(
|
||||
_$_OwnedDHTRecordPointer instance) =>
|
||||
Map<String, dynamic> _$$OwnedDHTRecordPointerImplToJson(
|
||||
_$OwnedDHTRecordPointerImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'record_key': instance.recordKey.toJson(),
|
||||
'owner': instance.owner.toJson(),
|
||||
|
|
|
@ -73,11 +73,11 @@ class _$AccountRecordInfoCopyWithImpl<$Res, $Val extends AccountRecordInfo>
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$_AccountRecordInfoCopyWith<$Res>
|
||||
abstract class _$$AccountRecordInfoImplCopyWith<$Res>
|
||||
implements $AccountRecordInfoCopyWith<$Res> {
|
||||
factory _$$_AccountRecordInfoCopyWith(_$_AccountRecordInfo value,
|
||||
$Res Function(_$_AccountRecordInfo) then) =
|
||||
__$$_AccountRecordInfoCopyWithImpl<$Res>;
|
||||
factory _$$AccountRecordInfoImplCopyWith(_$AccountRecordInfoImpl value,
|
||||
$Res Function(_$AccountRecordInfoImpl) then) =
|
||||
__$$AccountRecordInfoImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({OwnedDHTRecordPointer accountRecord});
|
||||
|
@ -87,11 +87,11 @@ abstract class _$$_AccountRecordInfoCopyWith<$Res>
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$_AccountRecordInfoCopyWithImpl<$Res>
|
||||
extends _$AccountRecordInfoCopyWithImpl<$Res, _$_AccountRecordInfo>
|
||||
implements _$$_AccountRecordInfoCopyWith<$Res> {
|
||||
__$$_AccountRecordInfoCopyWithImpl(
|
||||
_$_AccountRecordInfo _value, $Res Function(_$_AccountRecordInfo) _then)
|
||||
class __$$AccountRecordInfoImplCopyWithImpl<$Res>
|
||||
extends _$AccountRecordInfoCopyWithImpl<$Res, _$AccountRecordInfoImpl>
|
||||
implements _$$AccountRecordInfoImplCopyWith<$Res> {
|
||||
__$$AccountRecordInfoImplCopyWithImpl(_$AccountRecordInfoImpl _value,
|
||||
$Res Function(_$AccountRecordInfoImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
|
@ -99,7 +99,7 @@ class __$$_AccountRecordInfoCopyWithImpl<$Res>
|
|||
$Res call({
|
||||
Object? accountRecord = null,
|
||||
}) {
|
||||
return _then(_$_AccountRecordInfo(
|
||||
return _then(_$AccountRecordInfoImpl(
|
||||
accountRecord: null == accountRecord
|
||||
? _value.accountRecord
|
||||
: accountRecord // ignore: cast_nullable_to_non_nullable
|
||||
|
@ -110,11 +110,11 @@ class __$$_AccountRecordInfoCopyWithImpl<$Res>
|
|||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$_AccountRecordInfo implements _AccountRecordInfo {
|
||||
const _$_AccountRecordInfo({required this.accountRecord});
|
||||
class _$AccountRecordInfoImpl implements _AccountRecordInfo {
|
||||
const _$AccountRecordInfoImpl({required this.accountRecord});
|
||||
|
||||
factory _$_AccountRecordInfo.fromJson(Map<String, dynamic> json) =>
|
||||
_$$_AccountRecordInfoFromJson(json);
|
||||
factory _$AccountRecordInfoImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$AccountRecordInfoImplFromJson(json);
|
||||
|
||||
// Top level account keys and secrets
|
||||
@override
|
||||
|
@ -129,7 +129,7 @@ class _$_AccountRecordInfo implements _AccountRecordInfo {
|
|||
bool operator ==(dynamic other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$_AccountRecordInfo &&
|
||||
other is _$AccountRecordInfoImpl &&
|
||||
(identical(other.accountRecord, accountRecord) ||
|
||||
other.accountRecord == accountRecord));
|
||||
}
|
||||
|
@ -141,13 +141,13 @@ class _$_AccountRecordInfo implements _AccountRecordInfo {
|
|||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$_AccountRecordInfoCopyWith<_$_AccountRecordInfo> get copyWith =>
|
||||
__$$_AccountRecordInfoCopyWithImpl<_$_AccountRecordInfo>(
|
||||
_$$AccountRecordInfoImplCopyWith<_$AccountRecordInfoImpl> get copyWith =>
|
||||
__$$AccountRecordInfoImplCopyWithImpl<_$AccountRecordInfoImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$_AccountRecordInfoToJson(
|
||||
return _$$AccountRecordInfoImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
|
@ -156,16 +156,16 @@ class _$_AccountRecordInfo implements _AccountRecordInfo {
|
|||
abstract class _AccountRecordInfo implements AccountRecordInfo {
|
||||
const factory _AccountRecordInfo(
|
||||
{required final OwnedDHTRecordPointer accountRecord}) =
|
||||
_$_AccountRecordInfo;
|
||||
_$AccountRecordInfoImpl;
|
||||
|
||||
factory _AccountRecordInfo.fromJson(Map<String, dynamic> json) =
|
||||
_$_AccountRecordInfo.fromJson;
|
||||
_$AccountRecordInfoImpl.fromJson;
|
||||
|
||||
@override // Top level account keys and secrets
|
||||
OwnedDHTRecordPointer get accountRecord;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$_AccountRecordInfoCopyWith<_$_AccountRecordInfo> get copyWith =>
|
||||
_$$AccountRecordInfoImplCopyWith<_$AccountRecordInfoImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
|
@ -218,21 +218,22 @@ class _$IdentityCopyWithImpl<$Res, $Val extends Identity>
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$_IdentityCopyWith<$Res> implements $IdentityCopyWith<$Res> {
|
||||
factory _$$_IdentityCopyWith(
|
||||
_$_Identity value, $Res Function(_$_Identity) then) =
|
||||
__$$_IdentityCopyWithImpl<$Res>;
|
||||
abstract class _$$IdentityImplCopyWith<$Res>
|
||||
implements $IdentityCopyWith<$Res> {
|
||||
factory _$$IdentityImplCopyWith(
|
||||
_$IdentityImpl value, $Res Function(_$IdentityImpl) then) =
|
||||
__$$IdentityImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({IMap<String, ISet<AccountRecordInfo>> accountRecords});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$_IdentityCopyWithImpl<$Res>
|
||||
extends _$IdentityCopyWithImpl<$Res, _$_Identity>
|
||||
implements _$$_IdentityCopyWith<$Res> {
|
||||
__$$_IdentityCopyWithImpl(
|
||||
_$_Identity _value, $Res Function(_$_Identity) _then)
|
||||
class __$$IdentityImplCopyWithImpl<$Res>
|
||||
extends _$IdentityCopyWithImpl<$Res, _$IdentityImpl>
|
||||
implements _$$IdentityImplCopyWith<$Res> {
|
||||
__$$IdentityImplCopyWithImpl(
|
||||
_$IdentityImpl _value, $Res Function(_$IdentityImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
|
@ -240,7 +241,7 @@ class __$$_IdentityCopyWithImpl<$Res>
|
|||
$Res call({
|
||||
Object? accountRecords = null,
|
||||
}) {
|
||||
return _then(_$_Identity(
|
||||
return _then(_$IdentityImpl(
|
||||
accountRecords: null == accountRecords
|
||||
? _value.accountRecords
|
||||
: accountRecords // ignore: cast_nullable_to_non_nullable
|
||||
|
@ -251,11 +252,11 @@ class __$$_IdentityCopyWithImpl<$Res>
|
|||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$_Identity implements _Identity {
|
||||
const _$_Identity({required this.accountRecords});
|
||||
class _$IdentityImpl implements _Identity {
|
||||
const _$IdentityImpl({required this.accountRecords});
|
||||
|
||||
factory _$_Identity.fromJson(Map<String, dynamic> json) =>
|
||||
_$$_IdentityFromJson(json);
|
||||
factory _$IdentityImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$IdentityImplFromJson(json);
|
||||
|
||||
// Top level account keys and secrets
|
||||
@override
|
||||
|
@ -270,7 +271,7 @@ class _$_Identity implements _Identity {
|
|||
bool operator ==(dynamic other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$_Identity &&
|
||||
other is _$IdentityImpl &&
|
||||
(identical(other.accountRecords, accountRecords) ||
|
||||
other.accountRecords == accountRecords));
|
||||
}
|
||||
|
@ -282,12 +283,12 @@ class _$_Identity implements _Identity {
|
|||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$_IdentityCopyWith<_$_Identity> get copyWith =>
|
||||
__$$_IdentityCopyWithImpl<_$_Identity>(this, _$identity);
|
||||
_$$IdentityImplCopyWith<_$IdentityImpl> get copyWith =>
|
||||
__$$IdentityImplCopyWithImpl<_$IdentityImpl>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$_IdentityToJson(
|
||||
return _$$IdentityImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
|
@ -296,15 +297,16 @@ class _$_Identity implements _Identity {
|
|||
abstract class _Identity implements Identity {
|
||||
const factory _Identity(
|
||||
{required final IMap<String, ISet<AccountRecordInfo>>
|
||||
accountRecords}) = _$_Identity;
|
||||
accountRecords}) = _$IdentityImpl;
|
||||
|
||||
factory _Identity.fromJson(Map<String, dynamic> json) = _$_Identity.fromJson;
|
||||
factory _Identity.fromJson(Map<String, dynamic> json) =
|
||||
_$IdentityImpl.fromJson;
|
||||
|
||||
@override // Top level account keys and secrets
|
||||
IMap<String, ISet<AccountRecordInfo>> get accountRecords;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$_IdentityCopyWith<_$_Identity> get copyWith =>
|
||||
_$$IdentityImplCopyWith<_$IdentityImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
||||
|
@ -399,11 +401,11 @@ class _$IdentityMasterCopyWithImpl<$Res, $Val extends IdentityMaster>
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract class _$$_IdentityMasterCopyWith<$Res>
|
||||
abstract class _$$IdentityMasterImplCopyWith<$Res>
|
||||
implements $IdentityMasterCopyWith<$Res> {
|
||||
factory _$$_IdentityMasterCopyWith(
|
||||
_$_IdentityMaster value, $Res Function(_$_IdentityMaster) then) =
|
||||
__$$_IdentityMasterCopyWithImpl<$Res>;
|
||||
factory _$$IdentityMasterImplCopyWith(_$IdentityMasterImpl value,
|
||||
$Res Function(_$IdentityMasterImpl) then) =
|
||||
__$$IdentityMasterImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
|
@ -416,11 +418,11 @@ abstract class _$$_IdentityMasterCopyWith<$Res>
|
|||
}
|
||||
|
||||
/// @nodoc
|
||||
class __$$_IdentityMasterCopyWithImpl<$Res>
|
||||
extends _$IdentityMasterCopyWithImpl<$Res, _$_IdentityMaster>
|
||||
implements _$$_IdentityMasterCopyWith<$Res> {
|
||||
__$$_IdentityMasterCopyWithImpl(
|
||||
_$_IdentityMaster _value, $Res Function(_$_IdentityMaster) _then)
|
||||
class __$$IdentityMasterImplCopyWithImpl<$Res>
|
||||
extends _$IdentityMasterCopyWithImpl<$Res, _$IdentityMasterImpl>
|
||||
implements _$$IdentityMasterImplCopyWith<$Res> {
|
||||
__$$IdentityMasterImplCopyWithImpl(
|
||||
_$IdentityMasterImpl _value, $Res Function(_$IdentityMasterImpl) _then)
|
||||
: super(_value, _then);
|
||||
|
||||
@pragma('vm:prefer-inline')
|
||||
|
@ -433,7 +435,7 @@ class __$$_IdentityMasterCopyWithImpl<$Res>
|
|||
Object? identitySignature = null,
|
||||
Object? masterSignature = null,
|
||||
}) {
|
||||
return _then(_$_IdentityMaster(
|
||||
return _then(_$IdentityMasterImpl(
|
||||
identityRecordKey: null == identityRecordKey
|
||||
? _value.identityRecordKey
|
||||
: identityRecordKey // ignore: cast_nullable_to_non_nullable
|
||||
|
@ -464,8 +466,8 @@ class __$$_IdentityMasterCopyWithImpl<$Res>
|
|||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
class _$_IdentityMaster implements _IdentityMaster {
|
||||
const _$_IdentityMaster(
|
||||
class _$IdentityMasterImpl implements _IdentityMaster {
|
||||
const _$IdentityMasterImpl(
|
||||
{required this.identityRecordKey,
|
||||
required this.identityPublicKey,
|
||||
required this.masterRecordKey,
|
||||
|
@ -473,8 +475,8 @@ class _$_IdentityMaster implements _IdentityMaster {
|
|||
required this.identitySignature,
|
||||
required this.masterSignature});
|
||||
|
||||
factory _$_IdentityMaster.fromJson(Map<String, dynamic> json) =>
|
||||
_$$_IdentityMasterFromJson(json);
|
||||
factory _$IdentityMasterImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$IdentityMasterImplFromJson(json);
|
||||
|
||||
// Private DHT record storing identity account mapping
|
||||
@override
|
||||
|
@ -504,7 +506,7 @@ class _$_IdentityMaster implements _IdentityMaster {
|
|||
bool operator ==(dynamic other) {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$_IdentityMaster &&
|
||||
other is _$IdentityMasterImpl &&
|
||||
(identical(other.identityRecordKey, identityRecordKey) ||
|
||||
other.identityRecordKey == identityRecordKey) &&
|
||||
(identical(other.identityPublicKey, identityPublicKey) ||
|
||||
|
@ -533,12 +535,13 @@ class _$_IdentityMaster implements _IdentityMaster {
|
|||
@JsonKey(ignore: true)
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
_$$_IdentityMasterCopyWith<_$_IdentityMaster> get copyWith =>
|
||||
__$$_IdentityMasterCopyWithImpl<_$_IdentityMaster>(this, _$identity);
|
||||
_$$IdentityMasterImplCopyWith<_$IdentityMasterImpl> get copyWith =>
|
||||
__$$IdentityMasterImplCopyWithImpl<_$IdentityMasterImpl>(
|
||||
this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$$_IdentityMasterToJson(
|
||||
return _$$IdentityMasterImplToJson(
|
||||
this,
|
||||
);
|
||||
}
|
||||
|
@ -546,15 +549,16 @@ class _$_IdentityMaster implements _IdentityMaster {
|
|||
|
||||
abstract class _IdentityMaster implements IdentityMaster {
|
||||
const factory _IdentityMaster(
|
||||
{required final Typed<FixedEncodedString43> identityRecordKey,
|
||||
required final FixedEncodedString43 identityPublicKey,
|
||||
required final Typed<FixedEncodedString43> masterRecordKey,
|
||||
required final FixedEncodedString43 masterPublicKey,
|
||||
required final FixedEncodedString86 identitySignature,
|
||||
required final FixedEncodedString86 masterSignature}) = _$_IdentityMaster;
|
||||
{required final Typed<FixedEncodedString43> identityRecordKey,
|
||||
required final FixedEncodedString43 identityPublicKey,
|
||||
required final Typed<FixedEncodedString43> masterRecordKey,
|
||||
required final FixedEncodedString43 masterPublicKey,
|
||||
required final FixedEncodedString86 identitySignature,
|
||||
required final FixedEncodedString86 masterSignature}) =
|
||||
_$IdentityMasterImpl;
|
||||
|
||||
factory _IdentityMaster.fromJson(Map<String, dynamic> json) =
|
||||
_$_IdentityMaster.fromJson;
|
||||
_$IdentityMasterImpl.fromJson;
|
||||
|
||||
@override // Private DHT record storing identity account mapping
|
||||
Typed<FixedEncodedString43> get identityRecordKey;
|
||||
|
@ -570,6 +574,6 @@ abstract class _IdentityMaster implements IdentityMaster {
|
|||
FixedEncodedString86 get masterSignature;
|
||||
@override
|
||||
@JsonKey(ignore: true)
|
||||
_$$_IdentityMasterCopyWith<_$_IdentityMaster> get copyWith =>
|
||||
_$$IdentityMasterImplCopyWith<_$IdentityMasterImpl> get copyWith =>
|
||||
throw _privateConstructorUsedError;
|
||||
}
|
||||
|
|
|
@ -6,18 +6,20 @@ part of 'identity.dart';
|
|||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_$_AccountRecordInfo _$$_AccountRecordInfoFromJson(Map<String, dynamic> json) =>
|
||||
_$_AccountRecordInfo(
|
||||
_$AccountRecordInfoImpl _$$AccountRecordInfoImplFromJson(
|
||||
Map<String, dynamic> json) =>
|
||||
_$AccountRecordInfoImpl(
|
||||
accountRecord: OwnedDHTRecordPointer.fromJson(json['account_record']),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$_AccountRecordInfoToJson(
|
||||
_$_AccountRecordInfo instance) =>
|
||||
Map<String, dynamic> _$$AccountRecordInfoImplToJson(
|
||||
_$AccountRecordInfoImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'account_record': instance.accountRecord.toJson(),
|
||||
};
|
||||
|
||||
_$_Identity _$$_IdentityFromJson(Map<String, dynamic> json) => _$_Identity(
|
||||
_$IdentityImpl _$$IdentityImplFromJson(Map<String, dynamic> json) =>
|
||||
_$IdentityImpl(
|
||||
accountRecords: IMap<String, ISet<AccountRecordInfo>>.fromJson(
|
||||
json['account_records'] as Map<String, dynamic>,
|
||||
(value) => value as String,
|
||||
|
@ -25,7 +27,7 @@ _$_Identity _$$_IdentityFromJson(Map<String, dynamic> json) => _$_Identity(
|
|||
value, (value) => AccountRecordInfo.fromJson(value))),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$_IdentityToJson(_$_Identity instance) =>
|
||||
Map<String, dynamic> _$$IdentityImplToJson(_$IdentityImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'account_records': instance.accountRecords.toJson(
|
||||
(value) => value,
|
||||
|
@ -35,8 +37,8 @@ Map<String, dynamic> _$$_IdentityToJson(_$_Identity instance) =>
|
|||
),
|
||||
};
|
||||
|
||||
_$_IdentityMaster _$$_IdentityMasterFromJson(Map<String, dynamic> json) =>
|
||||
_$_IdentityMaster(
|
||||
_$IdentityMasterImpl _$$IdentityMasterImplFromJson(Map<String, dynamic> json) =>
|
||||
_$IdentityMasterImpl(
|
||||
identityRecordKey:
|
||||
Typed<FixedEncodedString43>.fromJson(json['identity_record_key']),
|
||||
identityPublicKey:
|
||||
|
@ -49,7 +51,8 @@ _$_IdentityMaster _$$_IdentityMasterFromJson(Map<String, dynamic> json) =>
|
|||
masterSignature: FixedEncodedString86.fromJson(json['master_signature']),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$_IdentityMasterToJson(_$_IdentityMaster instance) =>
|
||||
Map<String, dynamic> _$$IdentityMasterImplToJson(
|
||||
_$IdentityMasterImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'identity_record_key': instance.identityRecordKey.toJson(),
|
||||
'identity_public_key': instance.identityPublicKey.toJson(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue