From a6ba08255b999a7f5c3a24aeebfbc5311fd00f97 Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Sun, 11 Feb 2024 23:18:20 -0500 Subject: [PATCH] checkpoint --- build.bat | 7 + build.sh | 10 +- .../local_account/local_account.freezed.dart | 2 +- .../models/user_login/user_login.freezed.dart | 2 +- .../active_logins.freezed.dart | 2 +- .../new_account_page/new_account_page.dart | 2 +- lib/app.dart | 4 +- lib/chat/views/chat_component.dart | 1 - .../active_conversation_messages_cubit.dart | 2 +- .../cubits/active_conversations_cubit.dart | 9 +- lib/layout/home/home.dart | 87 +- .../home_account_ready.dart | 149 +-- ...only.dart => home_account_ready_chat.dart} | 16 +- .../home_account_ready_main.dart | 94 ++ .../home_account_ready_shell.dart | 99 ++ lib/layout/home/home_shell.dart | 42 + lib/main.dart | 6 +- lib/proto/veilidchat.pb.dart | 983 ++++++++++++------ lib/router/cubit/router_cubit.dart | 91 +- lib/router/cubit/router_cubit.freezed.dart | 193 ++++ lib/router/cubit/router_cubit.g.dart | 21 + lib/router/make_router.dart | 20 - lib/router/router.dart | 1 - lib/settings/models/preferences.freezed.dart | 2 +- .../models/theme_preference.freezed.dart | 2 +- .../processor_connection_state.freezed.dart | 2 +- macos/Podfile.lock | 26 +- packages/async_tools/build.bat | 2 + packages/async_tools/build.sh | 3 + .../lib/src/async_value.freezed.dart | 2 +- packages/async_tools/pubspec.yaml | 1 + packages/veilid_support/lib/proto/proto.dart | 22 +- pubspec.lock | 80 +- pubspec.yaml | 22 +- 34 files changed, 1301 insertions(+), 706 deletions(-) rename lib/layout/home/home_account_ready/{chat_only.dart => home_account_ready_chat.dart} (66%) create mode 100644 lib/layout/home/home_account_ready/home_account_ready_main.dart create mode 100644 lib/layout/home/home_account_ready/home_account_ready_shell.dart create mode 100644 lib/layout/home/home_shell.dart create mode 100644 lib/router/cubit/router_cubit.freezed.dart create mode 100644 lib/router/cubit/router_cubit.g.dart delete mode 100644 lib/router/make_router.dart create mode 100644 packages/async_tools/build.bat create mode 100755 packages/async_tools/build.sh diff --git a/build.bat b/build.bat index 0889dcf..e40afe0 100644 --- a/build.bat +++ b/build.bat @@ -1,6 +1,13 @@ @echo off dart run build_runner build --delete-conflicting-outputs +pushd packages\async_tools +call build.bat +popd +pushd packages\veilid_support +call build.bat +popd + pushd lib protoc --dart_out=proto -I veilid_support\proto -I veilid_support\dht_support\proto -I proto veilidchat.proto protoc --dart_out=proto -I veilid_support\proto -I veilid_support\dht_support\proto dht.proto diff --git a/build.sh b/build.sh index 569fe28..f723071 100755 --- a/build.sh +++ b/build.sh @@ -1,12 +1,16 @@ #!/bin/bash set -e +pushd packages/async_tools > /dev/null +./build.sh +popd > /dev/null + pushd packages/veilid_support > /dev/null ./build.sh popd > /dev/null dart run build_runner build --delete-conflicting-outputs -pushd lib > /dev/null -protoc --dart_out=proto -I ../packages/veilid_support/lib/proto -I ../packages/veilid_support/lib/dht_support/proto -I proto veilidchat.proto -popd > /dev/null +protoc --dart_out=lib/proto -I packages/veilid_support/lib/proto -I packages/veilid_support/lib/dht_support/proto -I lib/proto veilidchat.proto +sed -i '' 's/dht.pb.dart/package:veilid_support\/proto\/dht.pb.dart/g' lib/proto/veilidchat.pb.dart +sed -i '' 's/veilid.pb.dart/package:veilid_support\/proto\/veilid.pb.dart/g' lib/proto/veilidchat.pb.dart \ No newline at end of file diff --git a/lib/account_manager/models/local_account/local_account.freezed.dart b/lib/account_manager/models/local_account/local_account.freezed.dart index a720f3f..781d1de 100644 --- a/lib/account_manager/models/local_account/local_account.freezed.dart +++ b/lib/account_manager/models/local_account/local_account.freezed.dart @@ -12,7 +12,7 @@ part of 'local_account.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); LocalAccount _$LocalAccountFromJson(Map json) { return _LocalAccount.fromJson(json); diff --git a/lib/account_manager/models/user_login/user_login.freezed.dart b/lib/account_manager/models/user_login/user_login.freezed.dart index 89eb637..a25b4ab 100644 --- a/lib/account_manager/models/user_login/user_login.freezed.dart +++ b/lib/account_manager/models/user_login/user_login.freezed.dart @@ -12,7 +12,7 @@ part of 'user_login.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); UserLogin _$UserLoginFromJson(Map json) { return _UserLogin.fromJson(json); diff --git a/lib/account_manager/repository/account_repository/active_logins.freezed.dart b/lib/account_manager/repository/account_repository/active_logins.freezed.dart index d824640..cf9c434 100644 --- a/lib/account_manager/repository/account_repository/active_logins.freezed.dart +++ b/lib/account_manager/repository/account_repository/active_logins.freezed.dart @@ -12,7 +12,7 @@ part of 'active_logins.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); ActiveLogins _$ActiveLoginsFromJson(Map json) { return _ActiveLogins.fromJson(json); diff --git a/lib/account_manager/views/new_account_page/new_account_page.dart b/lib/account_manager/views/new_account_page/new_account_page.dart index fd8e54a..ab1a841 100644 --- a/lib/account_manager/views/new_account_page/new_account_page.dart +++ b/lib/account_manager/views/new_account_page/new_account_page.dart @@ -106,7 +106,7 @@ class NewAccountPageState extends State { icon: const Icon(Icons.settings), tooltip: translate('app_bar.settings_tooltip'), onPressed: () async { - context.go('/new_account/settings'); + await GoRouterHelper(context).push('/settings'); }) ]), body: _newAccountForm( diff --git a/lib/app.dart b/lib/app.dart index 7d4001d..44802bd 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -55,8 +55,8 @@ class VeilidChatApp extends StatelessWidget { child: BackgroundTicker( builder: (context) => MaterialApp.router( debugShowCheckedModeBanner: false, - routerConfig: router( - routerCubit: BlocProvider.of(context)), + routerConfig: + BlocProvider.of(context).router(), title: translate('app.title'), theme: theme, localizationsDelegates: [ diff --git a/lib/chat/views/chat_component.dart b/lib/chat/views/chat_component.dart index ac4fc81..0e3111a 100644 --- a/lib/chat/views/chat_component.dart +++ b/lib/chat/views/chat_component.dart @@ -3,7 +3,6 @@ import 'dart:async'; import 'package:async_tools/async_tools.dart'; import 'package:awesome_extensions/awesome_extensions.dart'; import 'package:fast_immutable_collections/fast_immutable_collections.dart'; -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_chat_types/flutter_chat_types.dart' as types; diff --git a/lib/chat_list/cubits/active_conversation_messages_cubit.dart b/lib/chat_list/cubits/active_conversation_messages_cubit.dart index 18c4c6e..032aebc 100644 --- a/lib/chat_list/cubits/active_conversation_messages_cubit.dart +++ b/lib/chat_list/cubits/active_conversation_messages_cubit.dart @@ -91,7 +91,7 @@ class ActiveConversationMessagesCubit extends BlocMapCubit add(() => MapEntry( - contact.remoteConversationRecordKey, + proto.TypedKeyProto.fromProto(contact.remoteConversationRecordKey), MessagesCubit( activeAccountInfo: _activeAccountInfo, remoteIdentityPublicKey: contact.identityPublicKey, diff --git a/lib/chat_list/cubits/active_conversations_cubit.dart b/lib/chat_list/cubits/active_conversations_cubit.dart index 0045f42..dccd9c9 100644 --- a/lib/chat_list/cubits/active_conversations_cubit.dart +++ b/lib/chat_list/cubits/active_conversations_cubit.dart @@ -40,14 +40,15 @@ class ActiveConversationsCubit extends BlocMapCubit addConversation({required proto.Contact contact}) async => add(() => MapEntry( - contact.remoteConversationRecordKey, + contact.remoteConversationRecordKey.toVeilid(), TransformerCubit( ConversationCubit( activeAccountInfo: _activeAccountInfo, - remoteIdentityPublicKey: contact.identityPublicKey, - localConversationRecordKey: contact.localConversationRecordKey, + remoteIdentityPublicKey: contact.identityPublicKey.toVeilid(), + localConversationRecordKey: + contact.localConversationRecordKey.toVeilid(), remoteConversationRecordKey: - contact.remoteConversationRecordKey, + contact.remoteConversationRecordKey.toVeilid(), ), // Transformer that only passes through completed conversations // along with the contact that corresponds to the completed diff --git a/lib/layout/home/home.dart b/lib/layout/home/home.dart index 74cfd54..5b1b3d1 100644 --- a/lib/layout/home/home.dart +++ b/lib/layout/home/home.dart @@ -1,81 +1,6 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:provider/provider.dart'; - -import '../../account_manager/account_manager.dart'; -import '../../theme/theme.dart'; -import '../../tools/tools.dart'; -import 'home_account_invalid.dart'; -import 'home_account_locked.dart'; -import 'home_account_missing.dart'; -import 'home_account_ready/home_account_ready.dart'; -import 'home_no_active.dart'; - -class HomePage extends StatefulWidget { - const HomePage({super.key}); - - @override - HomePageState createState() => HomePageState(); -} - -class HomePageState extends State with TickerProviderStateMixin { - final _unfocusNode = FocusNode(); - - @override - void initState() { - super.initState(); - - WidgetsBinding.instance.addPostFrameCallback((_) async { - await changeWindowSetup( - TitleBarStyle.normal, OrientationCapability.normal); - }); - } - - @override - void dispose() { - _unfocusNode.dispose(); - super.dispose(); - } - - Widget buildWithLogin(BuildContext context) { - final activeUserLogin = context.watch().state; - - if (activeUserLogin == null) { - // If no logged in user is active, show the loading panel - return const HomeNoActive(); - } - - final accountInfo = AccountRepository.instance - .getAccountInfo(accountMasterRecordKey: activeUserLogin)!; - - switch (accountInfo.status) { - case AccountInfoStatus.noAccount: - return const HomeAccountMissing(); - case AccountInfoStatus.accountInvalid: - return const HomeAccountInvalid(); - case AccountInfoStatus.accountLocked: - return const HomeAccountLocked(); - case AccountInfoStatus.accountReady: - return Provider.value( - value: accountInfo.activeAccountInfo!, - child: BlocProvider( - create: (context) => AccountRecordCubit( - record: accountInfo.activeAccountInfo!.accountRecord), - child: const HomeAccountReady())); - } - } - - @override - Widget build(BuildContext context) { - final theme = Theme.of(context); - final scale = theme.extension()!; - - return SafeArea( - child: GestureDetector( - onTap: () => FocusScope.of(context).requestFocus(_unfocusNode), - child: DecoratedBox( - decoration: BoxDecoration( - color: scale.primaryScale.activeElementBackground), - child: buildWithLogin(context)))); - } -} +export 'home_account_invalid.dart'; +export 'home_account_locked.dart'; +export 'home_account_missing.dart'; +export 'home_account_ready/home_account_ready.dart'; +export 'home_no_active.dart'; +export 'home_shell.dart'; diff --git a/lib/layout/home/home_account_ready/home_account_ready.dart b/lib/layout/home/home_account_ready/home_account_ready.dart index dd75d87..b198f0b 100644 --- a/lib/layout/home/home_account_ready/home_account_ready.dart +++ b/lib/layout/home/home_account_ready/home_account_ready.dart @@ -1,146 +1,3 @@ -import 'package:awesome_extensions/awesome_extensions.dart'; -import 'package:fast_immutable_collections/fast_immutable_collections.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:flutter_translate/flutter_translate.dart'; -import 'package:go_router/go_router.dart'; - -import '../../../account_manager/account_manager.dart'; -import '../../../chat/chat.dart'; -import '../../../chat_list/chat_list.dart'; -import '../../../contact_invitation/contact_invitation.dart'; -import '../../../contacts/contacts.dart'; -import '../../../theme/theme.dart'; -import '../../../tools/tools.dart'; -import 'main_pager/main_pager.dart'; - -class HomeAccountReady extends StatefulWidget { - const HomeAccountReady({super.key}); - - @override - HomeAccountReadyState createState() => HomeAccountReadyState(); -} - -class HomeAccountReadyState extends State - with TickerProviderStateMixin { - // - @override - void initState() { - super.initState(); - } - - Widget buildUnlockAccount( - BuildContext context, - IList localAccounts, - // ignore: prefer_expression_function_bodies - ) { - return const Center(child: Text('unlock account')); - } - - Widget buildUserPanel() => Builder(builder: (context) { - final account = context.watch().state; - final theme = Theme.of(context); - final scale = theme.extension()!; - - return Column(children: [ - Row(children: [ - IconButton( - icon: const Icon(Icons.settings), - color: scale.secondaryScale.text, - constraints: const BoxConstraints.expand(height: 64, width: 64), - style: ButtonStyle( - backgroundColor: - MaterialStateProperty.all(scale.secondaryScale.border), - shape: MaterialStateProperty.all( - const RoundedRectangleBorder( - borderRadius: - BorderRadius.all(Radius.circular(16))))), - tooltip: translate('app_bar.settings_tooltip'), - onPressed: () async { - context.go('/home/settings'); - }).paddingLTRB(0, 0, 8, 0), - asyncValueBuilder(account, - (_, account) => ProfileWidget(profile: account.profile)) - .expanded(), - ]).paddingAll(8), - const MainPager().expanded() - ]); - }); - - Widget buildPhone(BuildContext context) => - Material(color: Colors.transparent, child: buildUserPanel()); - - Widget buildTabletLeftPane(BuildContext context) => Builder( - builder: (context) => - Material(color: Colors.transparent, child: buildUserPanel())); - - Widget buildTabletRightPane(BuildContext context) { - final activeChatRemoteConversationKey = - context.watch().state; - if (activeChatRemoteConversationKey == null) { - return const EmptyChatWidget(); - } - return ChatComponent.builder( - remoteConversationRecordKey: activeChatRemoteConversationKey); - } - - // ignore: prefer_expression_function_bodies - Widget buildTablet(BuildContext context) { - final w = MediaQuery.of(context).size.width; - final theme = Theme.of(context); - final scale = theme.extension()!; - - final children = [ - ConstrainedBox( - constraints: const BoxConstraints(minWidth: 300, maxWidth: 300), - child: ConstrainedBox( - constraints: BoxConstraints(maxWidth: w / 2), - child: buildTabletLeftPane(context))), - SizedBox( - width: 2, - height: double.infinity, - child: ColoredBox(color: scale.primaryScale.hoverBorder)), - Expanded(child: buildTabletRightPane(context)), - ]; - - return Row( - children: children, - ); - } - - @override - Widget build(BuildContext context) { - final activeAccountInfo = context.watch(); - final accountData = context.watch().state.data; - - if (accountData == null) { - return waitingPage(); - } - - return MultiBlocProvider( - providers: [ - BlocProvider( - create: (context) => ContactInvitationListCubit( - activeAccountInfo: activeAccountInfo, - account: accountData.value)), - BlocProvider( - create: (context) => ContactListCubit( - activeAccountInfo: activeAccountInfo, - account: accountData.value)), - BlocProvider( - create: (context) => ChatListCubit( - activeAccountInfo: activeAccountInfo, - account: accountData.value)), - BlocProvider( - create: (context) => ActiveConversationsCubit( - activeAccountInfo: activeAccountInfo)), - BlocProvider(create: (context) => ActiveChatCubit(null)) - ], - child: responsiveVisibility( - context: context, - phone: false, - ) - ? buildTablet(context) - : buildPhone(context)); - } -} +export 'home_account_ready_chat.dart'; +export 'home_account_ready_main.dart'; +export 'home_account_ready_shell.dart'; diff --git a/lib/layout/home/home_account_ready/chat_only.dart b/lib/layout/home/home_account_ready/home_account_ready_chat.dart similarity index 66% rename from lib/layout/home/home_account_ready/chat_only.dart rename to lib/layout/home/home_account_ready/home_account_ready_chat.dart index 62d07d8..d046b02 100644 --- a/lib/layout/home/home_account_ready/chat_only.dart +++ b/lib/layout/home/home_account_ready/home_account_ready_chat.dart @@ -2,28 +2,20 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import '../../../chat/chat.dart'; -import '../../../tools/tools.dart'; -class ChatOnlyPage extends StatefulWidget { - const ChatOnlyPage({super.key}); +class HomeAccountReadyChat extends StatefulWidget { + const HomeAccountReadyChat({super.key}); @override - ChatOnlyPageState createState() => ChatOnlyPageState(); + HomeAccountReadyChatState createState() => HomeAccountReadyChatState(); } -class ChatOnlyPageState extends State - with TickerProviderStateMixin { +class HomeAccountReadyChatState extends State { final _unfocusNode = FocusNode(); @override void initState() { super.initState(); - - WidgetsBinding.instance.addPostFrameCallback((_) async { - setState(() {}); - await changeWindowSetup( - TitleBarStyle.normal, OrientationCapability.normal); - }); } @override diff --git a/lib/layout/home/home_account_ready/home_account_ready_main.dart b/lib/layout/home/home_account_ready/home_account_ready_main.dart new file mode 100644 index 0000000..2a5ee52 --- /dev/null +++ b/lib/layout/home/home_account_ready/home_account_ready_main.dart @@ -0,0 +1,94 @@ +import 'package:awesome_extensions/awesome_extensions.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:flutter_translate/flutter_translate.dart'; +import 'package:go_router/go_router.dart'; + +import '../../../account_manager/account_manager.dart'; +import '../../../chat/chat.dart'; +import '../../../theme/theme.dart'; +import '../../../tools/tools.dart'; +import 'main_pager/main_pager.dart'; + +class HomeAccountReadyMain extends StatelessWidget { + const HomeAccountReadyMain({super.key}); + + Widget buildUserPanel() => Builder(builder: (context) { + final account = context.watch().state; + final theme = Theme.of(context); + final scale = theme.extension()!; + + return Column(children: [ + Row(children: [ + IconButton( + icon: const Icon(Icons.settings), + color: scale.secondaryScale.text, + constraints: const BoxConstraints.expand(height: 64, width: 64), + style: ButtonStyle( + backgroundColor: + MaterialStateProperty.all(scale.secondaryScale.border), + shape: MaterialStateProperty.all( + const RoundedRectangleBorder( + borderRadius: + BorderRadius.all(Radius.circular(16))))), + tooltip: translate('app_bar.settings_tooltip'), + onPressed: () async { + await GoRouterHelper(context).push('/settings'); + }).paddingLTRB(0, 0, 8, 0), + asyncValueBuilder(account, + (_, account) => ProfileWidget(profile: account.profile)) + .expanded(), + ]).paddingAll(8), + const MainPager().expanded() + ]); + }); + + Widget buildPhone(BuildContext context) => + Material(color: Colors.transparent, child: buildUserPanel()); + + Widget buildTabletLeftPane(BuildContext context) => Builder( + builder: (context) => + Material(color: Colors.transparent, child: buildUserPanel())); + + Widget buildTabletRightPane(BuildContext context) { + final activeChatRemoteConversationKey = + context.watch().state; + if (activeChatRemoteConversationKey == null) { + return const EmptyChatWidget(); + } + return ChatComponent.builder( + remoteConversationRecordKey: activeChatRemoteConversationKey); + } + + // ignore: prefer_expression_function_bodies + Widget buildTablet(BuildContext context) { + final w = MediaQuery.of(context).size.width; + final theme = Theme.of(context); + final scale = theme.extension()!; + + final children = [ + ConstrainedBox( + constraints: const BoxConstraints(minWidth: 300, maxWidth: 300), + child: ConstrainedBox( + constraints: BoxConstraints(maxWidth: w / 2), + child: buildTabletLeftPane(context))), + SizedBox( + width: 2, + height: double.infinity, + child: ColoredBox(color: scale.primaryScale.hoverBorder)), + Expanded(child: buildTabletRightPane(context)), + ]; + + return Row( + children: children, + ); + } + + @override + Widget build(BuildContext context) => responsiveVisibility( + context: context, + phone: false, + ) + ? buildTablet(context) + : buildPhone(context); +} diff --git a/lib/layout/home/home_account_ready/home_account_ready_shell.dart b/lib/layout/home/home_account_ready/home_account_ready_shell.dart new file mode 100644 index 0000000..22e1266 --- /dev/null +++ b/lib/layout/home/home_account_ready/home_account_ready_shell.dart @@ -0,0 +1,99 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:provider/provider.dart'; + +import '../../../account_manager/account_manager.dart'; +import '../../../chat/chat.dart'; +import '../../../chat_list/chat_list.dart'; +import '../../../contact_invitation/contact_invitation.dart'; +import '../../../contacts/contacts.dart'; +import '../../../tools/tools.dart'; + +class HomeAccountReadyShell extends StatefulWidget { + const HomeAccountReadyShell({required this.child, super.key}); + + @override + HomeAccountReadyShellState createState() => HomeAccountReadyShellState(); + + final Widget child; +} + +class HomeAccountReadyShellState extends State + with TickerProviderStateMixin { + // + @override + void initState() { + super.initState(); + } + + // xxx figure out how to do this switch + + // Widget buildWithLogin(BuildContext context) { + // final activeUserLogin = context.watch().state; + + // if (activeUserLogin == null) { + // // If no logged in user is active, show the loading panel + // return const HomeNoActive(); + // } + + // final accountInfo = AccountRepository.instance + // .getAccountInfo(accountMasterRecordKey: activeUserLogin)!; + + // switch (accountInfo.status) { + // case AccountInfoStatus.noAccount: + // return const HomeAccountMissing(); + // case AccountInfoStatus.accountInvalid: + // return const HomeAccountInvalid(); + // case AccountInfoStatus.accountLocked: + // return const HomeAccountLocked(); + // case AccountInfoStatus.accountReady: + // return Provider.value( + // value: accountInfo.activeAccountInfo!, + // child: BlocProvider( + // create: (context) => AccountRecordCubit( + // record: accountInfo.activeAccountInfo!.accountRecord), + // child: const HomeAccountReady())); + // } + // } + + @override + Widget build(BuildContext context) { + // These must be valid already before making this widget, + // per the ShellRoute above it + final activeUserLogin = context.read().state!; + final accountInfo = AccountRepository.instance + .getAccountInfo(accountMasterRecordKey: activeUserLogin)!; + final activeAccountInfo = accountInfo.activeAccountInfo!; + + return Provider.value( + value: activeAccountInfo, + child: BlocProvider( + create: (context) => AccountRecordCubit( + record: accountInfo.activeAccountInfo!.accountRecord), + child: Builder(builder: (context) { + final account = + context.watch().state.data?.value; + if (account == null) { + return waitingPage(); + } + return MultiBlocProvider(providers: [ + BlocProvider( + create: (context) => ContactInvitationListCubit( + activeAccountInfo: activeAccountInfo, + account: account)), + BlocProvider( + create: (context) => ContactListCubit( + activeAccountInfo: activeAccountInfo, + account: account)), + BlocProvider( + create: (context) => ChatListCubit( + activeAccountInfo: activeAccountInfo, + account: account)), + BlocProvider( + create: (context) => ActiveConversationsCubit( + activeAccountInfo: activeAccountInfo)), + BlocProvider(create: (context) => ActiveChatCubit(null)) + ], child: widget.child); + }))); + } +} diff --git a/lib/layout/home/home_shell.dart b/lib/layout/home/home_shell.dart new file mode 100644 index 0000000..1124def --- /dev/null +++ b/lib/layout/home/home_shell.dart @@ -0,0 +1,42 @@ +import 'package:flutter/material.dart'; + +import '../../theme/theme.dart'; + +class HomeShell extends StatefulWidget { + const HomeShell({required this.child, super.key}); + + @override + HomeShellState createState() => HomeShellState(); + + final Widget child; +} + +class HomeShellState extends State { + final _unfocusNode = FocusNode(); + + @override + void initState() { + super.initState(); + } + + @override + void dispose() { + _unfocusNode.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + final theme = Theme.of(context); + final scale = theme.extension()!; + + // XXX: eventually write account switcher here + return SafeArea( + child: GestureDetector( + onTap: () => FocusScope.of(context).requestFocus(_unfocusNode), + child: DecoratedBox( + decoration: BoxDecoration( + color: scale.primaryScale.activeElementBackground), + child: widget.child))); + } +} diff --git a/lib/main.dart b/lib/main.dart index 0977885..49c3cb7 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -42,7 +42,7 @@ void main() async { await initializeWindowControl(); // Make localization delegate - final delegate = await LocalizationDelegate.create( + final localizationDelegate = await LocalizationDelegate.create( fallbackLocale: 'en_US', supportedLocales: ['en_US']); await initializeDateFormatting(); @@ -51,8 +51,8 @@ void main() async { // Run the app // Hot reloads will only restart this part, not Veilid - runApp(LocalizedApp( - delegate, VeilidChatApp(initialThemeData: initialThemeData))); + runApp(LocalizedApp(localizationDelegate, + VeilidChatApp(initialThemeData: initialThemeData))); }, (error, stackTrace) { log.error('Dart Runtime: {$error}\n{$stackTrace}'); }); diff --git a/lib/proto/veilidchat.pb.dart b/lib/proto/veilidchat.pb.dart index 6628b46..af40e07 100644 --- a/lib/proto/veilidchat.pb.dart +++ b/lib/proto/veilidchat.pb.dart @@ -14,8 +14,8 @@ import 'dart:core' as $core; import 'package:fixnum/fixnum.dart' as $fixnum; import 'package:protobuf/protobuf.dart' as $pb; -import 'dht.pb.dart' as $0; -import 'veilid.pb.dart' as $1; +import 'package:veilid_support/proto/dht.pb.dart' as $0; +import 'package:veilid_support/proto/veilid.pb.dart' as $1; import 'veilidchat.pbenum.dart'; export 'veilidchat.pbenum.dart'; @@ -23,28 +23,38 @@ export 'veilidchat.pbenum.dart'; class Attachment extends $pb.GeneratedMessage { factory Attachment() => create(); Attachment._() : super(); - factory Attachment.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory Attachment.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory Attachment.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory Attachment.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Attachment', package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), createEmptyInstance: create) - ..e(1, _omitFieldNames ? '' : 'kind', $pb.PbFieldType.OE, defaultOrMaker: AttachmentKind.ATTACHMENT_KIND_UNSPECIFIED, valueOf: AttachmentKind.valueOf, enumValues: AttachmentKind.values) + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'Attachment', + package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), + createEmptyInstance: create) + ..e(1, _omitFieldNames ? '' : 'kind', $pb.PbFieldType.OE, + defaultOrMaker: AttachmentKind.ATTACHMENT_KIND_UNSPECIFIED, + valueOf: AttachmentKind.valueOf, + enumValues: AttachmentKind.values) ..aOS(2, _omitFieldNames ? '' : 'mime') ..aOS(3, _omitFieldNames ? '' : 'name') - ..aOM<$0.DataReference>(4, _omitFieldNames ? '' : 'content', subBuilder: $0.DataReference.create) - ..aOM<$1.Signature>(5, _omitFieldNames ? '' : 'signature', subBuilder: $1.Signature.create) - ..hasRequiredFields = false - ; + ..aOM<$0.DataReference>(4, _omitFieldNames ? '' : 'content', + subBuilder: $0.DataReference.create) + ..aOM<$1.Signature>(5, _omitFieldNames ? '' : 'signature', + subBuilder: $1.Signature.create) + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') Attachment clone() => Attachment()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Attachment copyWith(void Function(Attachment) updates) => super.copyWith((message) => updates(message as Attachment)) as Attachment; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Attachment copyWith(void Function(Attachment) updates) => + super.copyWith((message) => updates(message as Attachment)) as Attachment; $pb.BuilderInfo get info_ => _i; @@ -53,13 +63,17 @@ class Attachment extends $pb.GeneratedMessage { Attachment createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static Attachment getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Attachment getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static Attachment? _defaultInstance; @$pb.TagNumber(1) AttachmentKind get kind => $_getN(0); @$pb.TagNumber(1) - set kind(AttachmentKind v) { setField(1, v); } + set kind(AttachmentKind v) { + setField(1, v); + } + @$pb.TagNumber(1) $core.bool hasKind() => $_has(0); @$pb.TagNumber(1) @@ -68,7 +82,10 @@ class Attachment extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.String get mime => $_getSZ(1); @$pb.TagNumber(2) - set mime($core.String v) { $_setString(1, v); } + set mime($core.String v) { + $_setString(1, v); + } + @$pb.TagNumber(2) $core.bool hasMime() => $_has(1); @$pb.TagNumber(2) @@ -77,7 +94,10 @@ class Attachment extends $pb.GeneratedMessage { @$pb.TagNumber(3) $core.String get name => $_getSZ(2); @$pb.TagNumber(3) - set name($core.String v) { $_setString(2, v); } + set name($core.String v) { + $_setString(2, v); + } + @$pb.TagNumber(3) $core.bool hasName() => $_has(2); @$pb.TagNumber(3) @@ -86,7 +106,10 @@ class Attachment extends $pb.GeneratedMessage { @$pb.TagNumber(4) $0.DataReference get content => $_getN(3); @$pb.TagNumber(4) - set content($0.DataReference v) { setField(4, v); } + set content($0.DataReference v) { + setField(4, v); + } + @$pb.TagNumber(4) $core.bool hasContent() => $_has(3); @$pb.TagNumber(4) @@ -97,7 +120,10 @@ class Attachment extends $pb.GeneratedMessage { @$pb.TagNumber(5) $1.Signature get signature => $_getN(4); @$pb.TagNumber(5) - set signature($1.Signature v) { setField(5, v); } + set signature($1.Signature v) { + setField(5, v); + } + @$pb.TagNumber(5) $core.bool hasSignature() => $_has(4); @$pb.TagNumber(5) @@ -109,28 +135,39 @@ class Attachment extends $pb.GeneratedMessage { class Message extends $pb.GeneratedMessage { factory Message() => create(); Message._() : super(); - factory Message.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory Message.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory Message.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory Message.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Message', package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), createEmptyInstance: create) - ..aOM<$1.TypedKey>(1, _omitFieldNames ? '' : 'author', subBuilder: $1.TypedKey.create) - ..a<$fixnum.Int64>(2, _omitFieldNames ? '' : 'timestamp', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO) + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'Message', + package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), + createEmptyInstance: create) + ..aOM<$1.TypedKey>(1, _omitFieldNames ? '' : 'author', + subBuilder: $1.TypedKey.create) + ..a<$fixnum.Int64>( + 2, _omitFieldNames ? '' : 'timestamp', $pb.PbFieldType.OU6, + defaultOrMaker: $fixnum.Int64.ZERO) ..aOS(3, _omitFieldNames ? '' : 'text') - ..aOM<$1.Signature>(4, _omitFieldNames ? '' : 'signature', subBuilder: $1.Signature.create) - ..pc(5, _omitFieldNames ? '' : 'attachments', $pb.PbFieldType.PM, subBuilder: Attachment.create) - ..hasRequiredFields = false - ; + ..aOM<$1.Signature>(4, _omitFieldNames ? '' : 'signature', + subBuilder: $1.Signature.create) + ..pc( + 5, _omitFieldNames ? '' : 'attachments', $pb.PbFieldType.PM, + subBuilder: Attachment.create) + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') Message clone() => Message()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Message copyWith(void Function(Message) updates) => super.copyWith((message) => updates(message as Message)) as Message; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Message copyWith(void Function(Message) updates) => + super.copyWith((message) => updates(message as Message)) as Message; $pb.BuilderInfo get info_ => _i; @@ -139,13 +176,17 @@ class Message extends $pb.GeneratedMessage { Message createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static Message getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Message getDefault() => + _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static Message? _defaultInstance; @$pb.TagNumber(1) $1.TypedKey get author => $_getN(0); @$pb.TagNumber(1) - set author($1.TypedKey v) { setField(1, v); } + set author($1.TypedKey v) { + setField(1, v); + } + @$pb.TagNumber(1) $core.bool hasAuthor() => $_has(0); @$pb.TagNumber(1) @@ -156,7 +197,10 @@ class Message extends $pb.GeneratedMessage { @$pb.TagNumber(2) $fixnum.Int64 get timestamp => $_getI64(1); @$pb.TagNumber(2) - set timestamp($fixnum.Int64 v) { $_setInt64(1, v); } + set timestamp($fixnum.Int64 v) { + $_setInt64(1, v); + } + @$pb.TagNumber(2) $core.bool hasTimestamp() => $_has(1); @$pb.TagNumber(2) @@ -165,7 +209,10 @@ class Message extends $pb.GeneratedMessage { @$pb.TagNumber(3) $core.String get text => $_getSZ(2); @$pb.TagNumber(3) - set text($core.String v) { $_setString(2, v); } + set text($core.String v) { + $_setString(2, v); + } + @$pb.TagNumber(3) $core.bool hasText() => $_has(2); @$pb.TagNumber(3) @@ -174,7 +221,10 @@ class Message extends $pb.GeneratedMessage { @$pb.TagNumber(4) $1.Signature get signature => $_getN(3); @$pb.TagNumber(4) - set signature($1.Signature v) { setField(4, v); } + set signature($1.Signature v) { + setField(4, v); + } + @$pb.TagNumber(4) $core.bool hasSignature() => $_has(3); @$pb.TagNumber(4) @@ -189,41 +239,54 @@ class Message extends $pb.GeneratedMessage { class Conversation extends $pb.GeneratedMessage { factory Conversation() => create(); Conversation._() : super(); - factory Conversation.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory Conversation.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory Conversation.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory Conversation.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Conversation', package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), createEmptyInstance: create) - ..aOM(1, _omitFieldNames ? '' : 'profile', subBuilder: Profile.create) + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'Conversation', + package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), + createEmptyInstance: create) + ..aOM(1, _omitFieldNames ? '' : 'profile', + subBuilder: Profile.create) ..aOS(2, _omitFieldNames ? '' : 'identityMasterJson') - ..aOM<$1.TypedKey>(3, _omitFieldNames ? '' : 'messages', subBuilder: $1.TypedKey.create) - ..hasRequiredFields = false - ; + ..aOM<$1.TypedKey>(3, _omitFieldNames ? '' : 'messages', + subBuilder: $1.TypedKey.create) + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') Conversation clone() => Conversation()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Conversation copyWith(void Function(Conversation) updates) => super.copyWith((message) => updates(message as Conversation)) as Conversation; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Conversation copyWith(void Function(Conversation) updates) => + super.copyWith((message) => updates(message as Conversation)) + as Conversation; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static Conversation create() => Conversation._(); Conversation createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static Conversation getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Conversation getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static Conversation? _defaultInstance; @$pb.TagNumber(1) Profile get profile => $_getN(0); @$pb.TagNumber(1) - set profile(Profile v) { setField(1, v); } + set profile(Profile v) { + setField(1, v); + } + @$pb.TagNumber(1) $core.bool hasProfile() => $_has(0); @$pb.TagNumber(1) @@ -234,7 +297,10 @@ class Conversation extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.String get identityMasterJson => $_getSZ(1); @$pb.TagNumber(2) - set identityMasterJson($core.String v) { $_setString(1, v); } + set identityMasterJson($core.String v) { + $_setString(1, v); + } + @$pb.TagNumber(2) $core.bool hasIdentityMasterJson() => $_has(1); @$pb.TagNumber(2) @@ -243,7 +309,10 @@ class Conversation extends $pb.GeneratedMessage { @$pb.TagNumber(3) $1.TypedKey get messages => $_getN(2); @$pb.TagNumber(3) - set messages($1.TypedKey v) { setField(3, v); } + set messages($1.TypedKey v) { + setField(3, v); + } + @$pb.TagNumber(3) $core.bool hasMessages() => $_has(2); @$pb.TagNumber(3) @@ -255,30 +324,40 @@ class Conversation extends $pb.GeneratedMessage { class Contact extends $pb.GeneratedMessage { factory Contact() => create(); Contact._() : super(); - factory Contact.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory Contact.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory Contact.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory Contact.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Contact', package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), createEmptyInstance: create) - ..aOM(1, _omitFieldNames ? '' : 'editedProfile', subBuilder: Profile.create) - ..aOM(2, _omitFieldNames ? '' : 'remoteProfile', subBuilder: Profile.create) + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'Contact', + package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), + createEmptyInstance: create) + ..aOM(1, _omitFieldNames ? '' : 'editedProfile', + subBuilder: Profile.create) + ..aOM(2, _omitFieldNames ? '' : 'remoteProfile', + subBuilder: Profile.create) ..aOS(3, _omitFieldNames ? '' : 'identityMasterJson') - ..aOM<$1.TypedKey>(4, _omitFieldNames ? '' : 'identityPublicKey', subBuilder: $1.TypedKey.create) - ..aOM<$1.TypedKey>(5, _omitFieldNames ? '' : 'remoteConversationRecordKey', subBuilder: $1.TypedKey.create) - ..aOM<$1.TypedKey>(6, _omitFieldNames ? '' : 'localConversationRecordKey', subBuilder: $1.TypedKey.create) + ..aOM<$1.TypedKey>(4, _omitFieldNames ? '' : 'identityPublicKey', + subBuilder: $1.TypedKey.create) + ..aOM<$1.TypedKey>(5, _omitFieldNames ? '' : 'remoteConversationRecordKey', + subBuilder: $1.TypedKey.create) + ..aOM<$1.TypedKey>(6, _omitFieldNames ? '' : 'localConversationRecordKey', + subBuilder: $1.TypedKey.create) ..aOB(7, _omitFieldNames ? '' : 'showAvailability') - ..hasRequiredFields = false - ; + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') Contact clone() => Contact()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Contact copyWith(void Function(Contact) updates) => super.copyWith((message) => updates(message as Contact)) as Contact; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Contact copyWith(void Function(Contact) updates) => + super.copyWith((message) => updates(message as Contact)) as Contact; $pb.BuilderInfo get info_ => _i; @@ -287,13 +366,17 @@ class Contact extends $pb.GeneratedMessage { Contact createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static Contact getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Contact getDefault() => + _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static Contact? _defaultInstance; @$pb.TagNumber(1) Profile get editedProfile => $_getN(0); @$pb.TagNumber(1) - set editedProfile(Profile v) { setField(1, v); } + set editedProfile(Profile v) { + setField(1, v); + } + @$pb.TagNumber(1) $core.bool hasEditedProfile() => $_has(0); @$pb.TagNumber(1) @@ -304,7 +387,10 @@ class Contact extends $pb.GeneratedMessage { @$pb.TagNumber(2) Profile get remoteProfile => $_getN(1); @$pb.TagNumber(2) - set remoteProfile(Profile v) { setField(2, v); } + set remoteProfile(Profile v) { + setField(2, v); + } + @$pb.TagNumber(2) $core.bool hasRemoteProfile() => $_has(1); @$pb.TagNumber(2) @@ -315,7 +401,10 @@ class Contact extends $pb.GeneratedMessage { @$pb.TagNumber(3) $core.String get identityMasterJson => $_getSZ(2); @$pb.TagNumber(3) - set identityMasterJson($core.String v) { $_setString(2, v); } + set identityMasterJson($core.String v) { + $_setString(2, v); + } + @$pb.TagNumber(3) $core.bool hasIdentityMasterJson() => $_has(2); @$pb.TagNumber(3) @@ -324,7 +413,10 @@ class Contact extends $pb.GeneratedMessage { @$pb.TagNumber(4) $1.TypedKey get identityPublicKey => $_getN(3); @$pb.TagNumber(4) - set identityPublicKey($1.TypedKey v) { setField(4, v); } + set identityPublicKey($1.TypedKey v) { + setField(4, v); + } + @$pb.TagNumber(4) $core.bool hasIdentityPublicKey() => $_has(3); @$pb.TagNumber(4) @@ -335,7 +427,10 @@ class Contact extends $pb.GeneratedMessage { @$pb.TagNumber(5) $1.TypedKey get remoteConversationRecordKey => $_getN(4); @$pb.TagNumber(5) - set remoteConversationRecordKey($1.TypedKey v) { setField(5, v); } + set remoteConversationRecordKey($1.TypedKey v) { + setField(5, v); + } + @$pb.TagNumber(5) $core.bool hasRemoteConversationRecordKey() => $_has(4); @$pb.TagNumber(5) @@ -346,7 +441,10 @@ class Contact extends $pb.GeneratedMessage { @$pb.TagNumber(6) $1.TypedKey get localConversationRecordKey => $_getN(5); @$pb.TagNumber(6) - set localConversationRecordKey($1.TypedKey v) { setField(6, v); } + set localConversationRecordKey($1.TypedKey v) { + setField(6, v); + } + @$pb.TagNumber(6) $core.bool hasLocalConversationRecordKey() => $_has(5); @$pb.TagNumber(6) @@ -357,7 +455,10 @@ class Contact extends $pb.GeneratedMessage { @$pb.TagNumber(7) $core.bool get showAvailability => $_getBF(6); @$pb.TagNumber(7) - set showAvailability($core.bool v) { $_setBool(6, v); } + set showAvailability($core.bool v) { + $_setBool(6, v); + } + @$pb.TagNumber(7) $core.bool hasShowAvailability() => $_has(6); @$pb.TagNumber(7) @@ -367,28 +468,38 @@ class Contact extends $pb.GeneratedMessage { class Profile extends $pb.GeneratedMessage { factory Profile() => create(); Profile._() : super(); - factory Profile.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory Profile.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory Profile.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory Profile.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Profile', package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), createEmptyInstance: create) + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'Profile', + package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), + createEmptyInstance: create) ..aOS(1, _omitFieldNames ? '' : 'name') ..aOS(2, _omitFieldNames ? '' : 'pronouns') ..aOS(3, _omitFieldNames ? '' : 'status') - ..e(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) - ..hasRequiredFields = false - ; + ..e( + 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) + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') Profile clone() => Profile()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Profile copyWith(void Function(Profile) updates) => super.copyWith((message) => updates(message as Profile)) as Profile; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Profile copyWith(void Function(Profile) updates) => + super.copyWith((message) => updates(message as Profile)) as Profile; $pb.BuilderInfo get info_ => _i; @@ -397,13 +508,17 @@ class Profile extends $pb.GeneratedMessage { Profile createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static Profile getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Profile getDefault() => + _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static Profile? _defaultInstance; @$pb.TagNumber(1) $core.String get name => $_getSZ(0); @$pb.TagNumber(1) - set name($core.String v) { $_setString(0, v); } + set name($core.String v) { + $_setString(0, v); + } + @$pb.TagNumber(1) $core.bool hasName() => $_has(0); @$pb.TagNumber(1) @@ -412,7 +527,10 @@ class Profile extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.String get pronouns => $_getSZ(1); @$pb.TagNumber(2) - set pronouns($core.String v) { $_setString(1, v); } + set pronouns($core.String v) { + $_setString(1, v); + } + @$pb.TagNumber(2) $core.bool hasPronouns() => $_has(1); @$pb.TagNumber(2) @@ -421,7 +539,10 @@ class Profile extends $pb.GeneratedMessage { @$pb.TagNumber(3) $core.String get status => $_getSZ(2); @$pb.TagNumber(3) - set status($core.String v) { $_setString(2, v); } + set status($core.String v) { + $_setString(2, v); + } + @$pb.TagNumber(3) $core.bool hasStatus() => $_has(2); @$pb.TagNumber(3) @@ -430,7 +551,10 @@ class Profile extends $pb.GeneratedMessage { @$pb.TagNumber(4) Availability get availability => $_getN(3); @$pb.TagNumber(4) - set availability(Availability v) { setField(4, v); } + set availability(Availability v) { + setField(4, v); + } + @$pb.TagNumber(4) $core.bool hasAvailability() => $_has(3); @$pb.TagNumber(4) @@ -439,7 +563,10 @@ class Profile extends $pb.GeneratedMessage { @$pb.TagNumber(5) $1.TypedKey get avatar => $_getN(4); @$pb.TagNumber(5) - set avatar($1.TypedKey v) { setField(5, v); } + set avatar($1.TypedKey v) { + setField(5, v); + } + @$pb.TagNumber(5) $core.bool hasAvatar() => $_has(4); @$pb.TagNumber(5) @@ -451,25 +578,34 @@ class Profile extends $pb.GeneratedMessage { class Chat extends $pb.GeneratedMessage { factory Chat() => create(); Chat._() : super(); - factory Chat.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory Chat.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory Chat.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory Chat.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Chat', package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), createEmptyInstance: create) - ..e(1, _omitFieldNames ? '' : 'type', $pb.PbFieldType.OE, defaultOrMaker: ChatType.CHAT_TYPE_UNSPECIFIED, valueOf: ChatType.valueOf, enumValues: ChatType.values) - ..aOM<$1.TypedKey>(2, _omitFieldNames ? '' : 'remoteConversationKey', subBuilder: $1.TypedKey.create) - ..hasRequiredFields = false - ; + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'Chat', + package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), + createEmptyInstance: create) + ..e(1, _omitFieldNames ? '' : 'type', $pb.PbFieldType.OE, + defaultOrMaker: ChatType.CHAT_TYPE_UNSPECIFIED, + valueOf: ChatType.valueOf, + enumValues: ChatType.values) + ..aOM<$1.TypedKey>(2, _omitFieldNames ? '' : 'remoteConversationKey', + subBuilder: $1.TypedKey.create) + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') Chat clone() => Chat()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Chat copyWith(void Function(Chat) updates) => super.copyWith((message) => updates(message as Chat)) as Chat; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Chat copyWith(void Function(Chat) updates) => + super.copyWith((message) => updates(message as Chat)) as Chat; $pb.BuilderInfo get info_ => _i; @@ -478,13 +614,17 @@ class Chat extends $pb.GeneratedMessage { Chat createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static Chat getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Chat getDefault() => + _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static Chat? _defaultInstance; @$pb.TagNumber(1) ChatType get type => $_getN(0); @$pb.TagNumber(1) - set type(ChatType v) { setField(1, v); } + set type(ChatType v) { + setField(1, v); + } + @$pb.TagNumber(1) $core.bool hasType() => $_has(0); @$pb.TagNumber(1) @@ -493,7 +633,10 @@ class Chat extends $pb.GeneratedMessage { @$pb.TagNumber(2) $1.TypedKey get remoteConversationKey => $_getN(1); @$pb.TagNumber(2) - set remoteConversationKey($1.TypedKey v) { setField(2, v); } + set remoteConversationKey($1.TypedKey v) { + setField(2, v); + } + @$pb.TagNumber(2) $core.bool hasRemoteConversationKey() => $_has(1); @$pb.TagNumber(2) @@ -505,29 +648,40 @@ class Chat extends $pb.GeneratedMessage { class Account extends $pb.GeneratedMessage { factory Account() => create(); Account._() : super(); - factory Account.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory Account.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory Account.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory Account.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'Account', package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), createEmptyInstance: create) - ..aOM(1, _omitFieldNames ? '' : 'profile', subBuilder: Profile.create) + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'Account', + package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), + createEmptyInstance: create) + ..aOM(1, _omitFieldNames ? '' : 'profile', + subBuilder: Profile.create) ..aOB(2, _omitFieldNames ? '' : 'invisible') - ..a<$core.int>(3, _omitFieldNames ? '' : 'autoAwayTimeoutSec', $pb.PbFieldType.OU3) - ..aOM<$0.OwnedDHTRecordPointer>(4, _omitFieldNames ? '' : 'contactList', subBuilder: $0.OwnedDHTRecordPointer.create) - ..aOM<$0.OwnedDHTRecordPointer>(5, _omitFieldNames ? '' : 'contactInvitationRecords', subBuilder: $0.OwnedDHTRecordPointer.create) - ..aOM<$0.OwnedDHTRecordPointer>(6, _omitFieldNames ? '' : 'chatList', subBuilder: $0.OwnedDHTRecordPointer.create) - ..hasRequiredFields = false - ; + ..a<$core.int>( + 3, _omitFieldNames ? '' : 'autoAwayTimeoutSec', $pb.PbFieldType.OU3) + ..aOM<$0.OwnedDHTRecordPointer>(4, _omitFieldNames ? '' : 'contactList', + subBuilder: $0.OwnedDHTRecordPointer.create) + ..aOM<$0.OwnedDHTRecordPointer>( + 5, _omitFieldNames ? '' : 'contactInvitationRecords', + subBuilder: $0.OwnedDHTRecordPointer.create) + ..aOM<$0.OwnedDHTRecordPointer>(6, _omitFieldNames ? '' : 'chatList', + subBuilder: $0.OwnedDHTRecordPointer.create) + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') Account clone() => Account()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - Account copyWith(void Function(Account) updates) => super.copyWith((message) => updates(message as Account)) as Account; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + Account copyWith(void Function(Account) updates) => + super.copyWith((message) => updates(message as Account)) as Account; $pb.BuilderInfo get info_ => _i; @@ -536,13 +690,17 @@ class Account extends $pb.GeneratedMessage { Account createEmptyInstance() => create(); static $pb.PbList createRepeated() => $pb.PbList(); @$core.pragma('dart2js:noInline') - static Account getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static Account getDefault() => + _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); static Account? _defaultInstance; @$pb.TagNumber(1) Profile get profile => $_getN(0); @$pb.TagNumber(1) - set profile(Profile v) { setField(1, v); } + set profile(Profile v) { + setField(1, v); + } + @$pb.TagNumber(1) $core.bool hasProfile() => $_has(0); @$pb.TagNumber(1) @@ -553,7 +711,10 @@ class Account extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.bool get invisible => $_getBF(1); @$pb.TagNumber(2) - set invisible($core.bool v) { $_setBool(1, v); } + set invisible($core.bool v) { + $_setBool(1, v); + } + @$pb.TagNumber(2) $core.bool hasInvisible() => $_has(1); @$pb.TagNumber(2) @@ -562,7 +723,10 @@ class Account extends $pb.GeneratedMessage { @$pb.TagNumber(3) $core.int get autoAwayTimeoutSec => $_getIZ(2); @$pb.TagNumber(3) - set autoAwayTimeoutSec($core.int v) { $_setUnsignedInt32(2, v); } + set autoAwayTimeoutSec($core.int v) { + $_setUnsignedInt32(2, v); + } + @$pb.TagNumber(3) $core.bool hasAutoAwayTimeoutSec() => $_has(2); @$pb.TagNumber(3) @@ -571,7 +735,10 @@ class Account extends $pb.GeneratedMessage { @$pb.TagNumber(4) $0.OwnedDHTRecordPointer get contactList => $_getN(3); @$pb.TagNumber(4) - set contactList($0.OwnedDHTRecordPointer v) { setField(4, v); } + set contactList($0.OwnedDHTRecordPointer v) { + setField(4, v); + } + @$pb.TagNumber(4) $core.bool hasContactList() => $_has(3); @$pb.TagNumber(4) @@ -582,7 +749,10 @@ class Account extends $pb.GeneratedMessage { @$pb.TagNumber(5) $0.OwnedDHTRecordPointer get contactInvitationRecords => $_getN(4); @$pb.TagNumber(5) - set contactInvitationRecords($0.OwnedDHTRecordPointer v) { setField(5, v); } + set contactInvitationRecords($0.OwnedDHTRecordPointer v) { + setField(5, v); + } + @$pb.TagNumber(5) $core.bool hasContactInvitationRecords() => $_has(4); @$pb.TagNumber(5) @@ -593,7 +763,10 @@ class Account extends $pb.GeneratedMessage { @$pb.TagNumber(6) $0.OwnedDHTRecordPointer get chatList => $_getN(5); @$pb.TagNumber(6) - set chatList($0.OwnedDHTRecordPointer v) { setField(6, v); } + set chatList($0.OwnedDHTRecordPointer v) { + setField(6, v); + } + @$pb.TagNumber(6) $core.bool hasChatList() => $_has(5); @$pb.TagNumber(6) @@ -605,40 +778,53 @@ class Account extends $pb.GeneratedMessage { class ContactInvitation extends $pb.GeneratedMessage { factory ContactInvitation() => create(); ContactInvitation._() : super(); - factory ContactInvitation.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory ContactInvitation.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory ContactInvitation.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory ContactInvitation.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ContactInvitation', package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), createEmptyInstance: create) - ..aOM<$1.TypedKey>(1, _omitFieldNames ? '' : 'contactRequestInboxKey', subBuilder: $1.TypedKey.create) - ..a<$core.List<$core.int>>(2, _omitFieldNames ? '' : 'writerSecret', $pb.PbFieldType.OY) - ..hasRequiredFields = false - ; + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ContactInvitation', + package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), + createEmptyInstance: create) + ..aOM<$1.TypedKey>(1, _omitFieldNames ? '' : 'contactRequestInboxKey', + subBuilder: $1.TypedKey.create) + ..a<$core.List<$core.int>>( + 2, _omitFieldNames ? '' : 'writerSecret', $pb.PbFieldType.OY) + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') ContactInvitation clone() => ContactInvitation()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - ContactInvitation copyWith(void Function(ContactInvitation) updates) => super.copyWith((message) => updates(message as ContactInvitation)) as ContactInvitation; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ContactInvitation copyWith(void Function(ContactInvitation) updates) => + super.copyWith((message) => updates(message as ContactInvitation)) + as ContactInvitation; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static ContactInvitation create() => ContactInvitation._(); ContactInvitation createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static ContactInvitation getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ContactInvitation getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static ContactInvitation? _defaultInstance; @$pb.TagNumber(1) $1.TypedKey get contactRequestInboxKey => $_getN(0); @$pb.TagNumber(1) - set contactRequestInboxKey($1.TypedKey v) { setField(1, v); } + set contactRequestInboxKey($1.TypedKey v) { + setField(1, v); + } + @$pb.TagNumber(1) $core.bool hasContactRequestInboxKey() => $_has(0); @$pb.TagNumber(1) @@ -649,7 +835,10 @@ class ContactInvitation extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.List<$core.int> get writerSecret => $_getN(1); @$pb.TagNumber(2) - set writerSecret($core.List<$core.int> v) { $_setBytes(1, v); } + set writerSecret($core.List<$core.int> v) { + $_setBytes(1, v); + } + @$pb.TagNumber(2) $core.bool hasWriterSecret() => $_has(1); @$pb.TagNumber(2) @@ -659,40 +848,55 @@ class ContactInvitation extends $pb.GeneratedMessage { class SignedContactInvitation extends $pb.GeneratedMessage { factory SignedContactInvitation() => create(); SignedContactInvitation._() : super(); - factory SignedContactInvitation.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory SignedContactInvitation.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory SignedContactInvitation.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory SignedContactInvitation.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'SignedContactInvitation', package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, _omitFieldNames ? '' : 'contactInvitation', $pb.PbFieldType.OY) - ..aOM<$1.Signature>(2, _omitFieldNames ? '' : 'identitySignature', subBuilder: $1.Signature.create) - ..hasRequiredFields = false - ; + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'SignedContactInvitation', + package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), + createEmptyInstance: create) + ..a<$core.List<$core.int>>( + 1, _omitFieldNames ? '' : 'contactInvitation', $pb.PbFieldType.OY) + ..aOM<$1.Signature>(2, _omitFieldNames ? '' : 'identitySignature', + subBuilder: $1.Signature.create) + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - SignedContactInvitation clone() => SignedContactInvitation()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - SignedContactInvitation copyWith(void Function(SignedContactInvitation) updates) => super.copyWith((message) => updates(message as SignedContactInvitation)) as SignedContactInvitation; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + SignedContactInvitation clone() => + SignedContactInvitation()..mergeFromMessage(this); + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + SignedContactInvitation copyWith( + void Function(SignedContactInvitation) updates) => + super.copyWith((message) => updates(message as SignedContactInvitation)) + as SignedContactInvitation; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static SignedContactInvitation create() => SignedContactInvitation._(); SignedContactInvitation createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static SignedContactInvitation getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static SignedContactInvitation getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static SignedContactInvitation? _defaultInstance; @$pb.TagNumber(1) $core.List<$core.int> get contactInvitation => $_getN(0); @$pb.TagNumber(1) - set contactInvitation($core.List<$core.int> v) { $_setBytes(0, v); } + set contactInvitation($core.List<$core.int> v) { + $_setBytes(0, v); + } + @$pb.TagNumber(1) $core.bool hasContactInvitation() => $_has(0); @$pb.TagNumber(1) @@ -701,7 +905,10 @@ class SignedContactInvitation extends $pb.GeneratedMessage { @$pb.TagNumber(2) $1.Signature get identitySignature => $_getN(1); @$pb.TagNumber(2) - set identitySignature($1.Signature v) { setField(2, v); } + set identitySignature($1.Signature v) { + setField(2, v); + } + @$pb.TagNumber(2) $core.bool hasIdentitySignature() => $_has(1); @$pb.TagNumber(2) @@ -713,40 +920,56 @@ class SignedContactInvitation extends $pb.GeneratedMessage { class ContactRequest extends $pb.GeneratedMessage { factory ContactRequest() => create(); ContactRequest._() : super(); - factory ContactRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory ContactRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory ContactRequest.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory ContactRequest.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ContactRequest', package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), createEmptyInstance: create) - ..e(1, _omitFieldNames ? '' : 'encryptionKeyType', $pb.PbFieldType.OE, defaultOrMaker: EncryptionKeyType.ENCRYPTION_KEY_TYPE_UNSPECIFIED, valueOf: EncryptionKeyType.valueOf, enumValues: EncryptionKeyType.values) - ..a<$core.List<$core.int>>(2, _omitFieldNames ? '' : 'private', $pb.PbFieldType.OY) - ..hasRequiredFields = false - ; + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ContactRequest', + package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), + createEmptyInstance: create) + ..e( + 1, _omitFieldNames ? '' : 'encryptionKeyType', $pb.PbFieldType.OE, + defaultOrMaker: EncryptionKeyType.ENCRYPTION_KEY_TYPE_UNSPECIFIED, + valueOf: EncryptionKeyType.valueOf, + enumValues: EncryptionKeyType.values) + ..a<$core.List<$core.int>>( + 2, _omitFieldNames ? '' : 'private', $pb.PbFieldType.OY) + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') ContactRequest clone() => ContactRequest()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - ContactRequest copyWith(void Function(ContactRequest) updates) => super.copyWith((message) => updates(message as ContactRequest)) as ContactRequest; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ContactRequest copyWith(void Function(ContactRequest) updates) => + super.copyWith((message) => updates(message as ContactRequest)) + as ContactRequest; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static ContactRequest create() => ContactRequest._(); ContactRequest createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static ContactRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ContactRequest getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static ContactRequest? _defaultInstance; @$pb.TagNumber(1) EncryptionKeyType get encryptionKeyType => $_getN(0); @$pb.TagNumber(1) - set encryptionKeyType(EncryptionKeyType v) { setField(1, v); } + set encryptionKeyType(EncryptionKeyType v) { + setField(1, v); + } + @$pb.TagNumber(1) $core.bool hasEncryptionKeyType() => $_has(0); @$pb.TagNumber(1) @@ -755,7 +978,10 @@ class ContactRequest extends $pb.GeneratedMessage { @$pb.TagNumber(2) $core.List<$core.int> get private => $_getN(1); @$pb.TagNumber(2) - set private($core.List<$core.int> v) { $_setBytes(1, v); } + set private($core.List<$core.int> v) { + $_setBytes(1, v); + } + @$pb.TagNumber(2) $core.bool hasPrivate() => $_has(1); @$pb.TagNumber(2) @@ -765,43 +991,62 @@ class ContactRequest extends $pb.GeneratedMessage { class ContactRequestPrivate extends $pb.GeneratedMessage { factory ContactRequestPrivate() => create(); ContactRequestPrivate._() : super(); - factory ContactRequestPrivate.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory ContactRequestPrivate.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory ContactRequestPrivate.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory ContactRequestPrivate.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ContactRequestPrivate', package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), createEmptyInstance: create) - ..aOM<$1.CryptoKey>(1, _omitFieldNames ? '' : 'writerKey', subBuilder: $1.CryptoKey.create) - ..aOM(2, _omitFieldNames ? '' : 'profile', subBuilder: Profile.create) - ..aOM<$1.TypedKey>(3, _omitFieldNames ? '' : 'identityMasterRecordKey', subBuilder: $1.TypedKey.create) - ..aOM<$1.TypedKey>(4, _omitFieldNames ? '' : 'chatRecordKey', subBuilder: $1.TypedKey.create) - ..a<$fixnum.Int64>(5, _omitFieldNames ? '' : 'expiration', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO) - ..hasRequiredFields = false - ; + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ContactRequestPrivate', + package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), + createEmptyInstance: create) + ..aOM<$1.CryptoKey>(1, _omitFieldNames ? '' : 'writerKey', + subBuilder: $1.CryptoKey.create) + ..aOM(2, _omitFieldNames ? '' : 'profile', + subBuilder: Profile.create) + ..aOM<$1.TypedKey>(3, _omitFieldNames ? '' : 'identityMasterRecordKey', + subBuilder: $1.TypedKey.create) + ..aOM<$1.TypedKey>(4, _omitFieldNames ? '' : 'chatRecordKey', + subBuilder: $1.TypedKey.create) + ..a<$fixnum.Int64>( + 5, _omitFieldNames ? '' : 'expiration', $pb.PbFieldType.OU6, + defaultOrMaker: $fixnum.Int64.ZERO) + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - ContactRequestPrivate clone() => ContactRequestPrivate()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - ContactRequestPrivate copyWith(void Function(ContactRequestPrivate) updates) => super.copyWith((message) => updates(message as ContactRequestPrivate)) as ContactRequestPrivate; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + ContactRequestPrivate clone() => + ContactRequestPrivate()..mergeFromMessage(this); + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ContactRequestPrivate copyWith( + void Function(ContactRequestPrivate) updates) => + super.copyWith((message) => updates(message as ContactRequestPrivate)) + as ContactRequestPrivate; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static ContactRequestPrivate create() => ContactRequestPrivate._(); ContactRequestPrivate createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static ContactRequestPrivate getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ContactRequestPrivate getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static ContactRequestPrivate? _defaultInstance; @$pb.TagNumber(1) $1.CryptoKey get writerKey => $_getN(0); @$pb.TagNumber(1) - set writerKey($1.CryptoKey v) { setField(1, v); } + set writerKey($1.CryptoKey v) { + setField(1, v); + } + @$pb.TagNumber(1) $core.bool hasWriterKey() => $_has(0); @$pb.TagNumber(1) @@ -812,7 +1057,10 @@ class ContactRequestPrivate extends $pb.GeneratedMessage { @$pb.TagNumber(2) Profile get profile => $_getN(1); @$pb.TagNumber(2) - set profile(Profile v) { setField(2, v); } + set profile(Profile v) { + setField(2, v); + } + @$pb.TagNumber(2) $core.bool hasProfile() => $_has(1); @$pb.TagNumber(2) @@ -823,7 +1071,10 @@ class ContactRequestPrivate extends $pb.GeneratedMessage { @$pb.TagNumber(3) $1.TypedKey get identityMasterRecordKey => $_getN(2); @$pb.TagNumber(3) - set identityMasterRecordKey($1.TypedKey v) { setField(3, v); } + set identityMasterRecordKey($1.TypedKey v) { + setField(3, v); + } + @$pb.TagNumber(3) $core.bool hasIdentityMasterRecordKey() => $_has(2); @$pb.TagNumber(3) @@ -834,7 +1085,10 @@ class ContactRequestPrivate extends $pb.GeneratedMessage { @$pb.TagNumber(4) $1.TypedKey get chatRecordKey => $_getN(3); @$pb.TagNumber(4) - set chatRecordKey($1.TypedKey v) { setField(4, v); } + set chatRecordKey($1.TypedKey v) { + setField(4, v); + } + @$pb.TagNumber(4) $core.bool hasChatRecordKey() => $_has(3); @$pb.TagNumber(4) @@ -845,7 +1099,10 @@ class ContactRequestPrivate extends $pb.GeneratedMessage { @$pb.TagNumber(5) $fixnum.Int64 get expiration => $_getI64(4); @$pb.TagNumber(5) - set expiration($fixnum.Int64 v) { $_setInt64(4, v); } + set expiration($fixnum.Int64 v) { + $_setInt64(4, v); + } + @$pb.TagNumber(5) $core.bool hasExpiration() => $_has(4); @$pb.TagNumber(5) @@ -855,41 +1112,54 @@ class ContactRequestPrivate extends $pb.GeneratedMessage { class ContactResponse extends $pb.GeneratedMessage { factory ContactResponse() => create(); ContactResponse._() : super(); - factory ContactResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory ContactResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory ContactResponse.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory ContactResponse.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ContactResponse', package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), createEmptyInstance: create) + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ContactResponse', + package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), + createEmptyInstance: create) ..aOB(1, _omitFieldNames ? '' : 'accept') - ..aOM<$1.TypedKey>(2, _omitFieldNames ? '' : 'identityMasterRecordKey', subBuilder: $1.TypedKey.create) - ..aOM<$1.TypedKey>(3, _omitFieldNames ? '' : 'remoteConversationRecordKey', subBuilder: $1.TypedKey.create) - ..hasRequiredFields = false - ; + ..aOM<$1.TypedKey>(2, _omitFieldNames ? '' : 'identityMasterRecordKey', + subBuilder: $1.TypedKey.create) + ..aOM<$1.TypedKey>(3, _omitFieldNames ? '' : 'remoteConversationRecordKey', + subBuilder: $1.TypedKey.create) + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') ContactResponse clone() => ContactResponse()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - ContactResponse copyWith(void Function(ContactResponse) updates) => super.copyWith((message) => updates(message as ContactResponse)) as ContactResponse; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ContactResponse copyWith(void Function(ContactResponse) updates) => + super.copyWith((message) => updates(message as ContactResponse)) + as ContactResponse; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static ContactResponse create() => ContactResponse._(); ContactResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static ContactResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ContactResponse getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static ContactResponse? _defaultInstance; @$pb.TagNumber(1) $core.bool get accept => $_getBF(0); @$pb.TagNumber(1) - set accept($core.bool v) { $_setBool(0, v); } + set accept($core.bool v) { + $_setBool(0, v); + } + @$pb.TagNumber(1) $core.bool hasAccept() => $_has(0); @$pb.TagNumber(1) @@ -898,7 +1168,10 @@ class ContactResponse extends $pb.GeneratedMessage { @$pb.TagNumber(2) $1.TypedKey get identityMasterRecordKey => $_getN(1); @$pb.TagNumber(2) - set identityMasterRecordKey($1.TypedKey v) { setField(2, v); } + set identityMasterRecordKey($1.TypedKey v) { + setField(2, v); + } + @$pb.TagNumber(2) $core.bool hasIdentityMasterRecordKey() => $_has(1); @$pb.TagNumber(2) @@ -909,7 +1182,10 @@ class ContactResponse extends $pb.GeneratedMessage { @$pb.TagNumber(3) $1.TypedKey get remoteConversationRecordKey => $_getN(2); @$pb.TagNumber(3) - set remoteConversationRecordKey($1.TypedKey v) { setField(3, v); } + set remoteConversationRecordKey($1.TypedKey v) { + setField(3, v); + } + @$pb.TagNumber(3) $core.bool hasRemoteConversationRecordKey() => $_has(2); @$pb.TagNumber(3) @@ -921,40 +1197,55 @@ class ContactResponse extends $pb.GeneratedMessage { class SignedContactResponse extends $pb.GeneratedMessage { factory SignedContactResponse() => create(); SignedContactResponse._() : super(); - factory SignedContactResponse.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory SignedContactResponse.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory SignedContactResponse.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory SignedContactResponse.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'SignedContactResponse', package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), createEmptyInstance: create) - ..a<$core.List<$core.int>>(1, _omitFieldNames ? '' : 'contactResponse', $pb.PbFieldType.OY) - ..aOM<$1.Signature>(2, _omitFieldNames ? '' : 'identitySignature', subBuilder: $1.Signature.create) - ..hasRequiredFields = false - ; + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'SignedContactResponse', + package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), + createEmptyInstance: create) + ..a<$core.List<$core.int>>( + 1, _omitFieldNames ? '' : 'contactResponse', $pb.PbFieldType.OY) + ..aOM<$1.Signature>(2, _omitFieldNames ? '' : 'identitySignature', + subBuilder: $1.Signature.create) + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - SignedContactResponse clone() => SignedContactResponse()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - SignedContactResponse copyWith(void Function(SignedContactResponse) updates) => super.copyWith((message) => updates(message as SignedContactResponse)) as SignedContactResponse; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + SignedContactResponse clone() => + SignedContactResponse()..mergeFromMessage(this); + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + SignedContactResponse copyWith( + void Function(SignedContactResponse) updates) => + super.copyWith((message) => updates(message as SignedContactResponse)) + as SignedContactResponse; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static SignedContactResponse create() => SignedContactResponse._(); SignedContactResponse createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static SignedContactResponse getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static SignedContactResponse getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static SignedContactResponse? _defaultInstance; @$pb.TagNumber(1) $core.List<$core.int> get contactResponse => $_getN(0); @$pb.TagNumber(1) - set contactResponse($core.List<$core.int> v) { $_setBytes(0, v); } + set contactResponse($core.List<$core.int> v) { + $_setBytes(0, v); + } + @$pb.TagNumber(1) $core.bool hasContactResponse() => $_has(0); @$pb.TagNumber(1) @@ -963,7 +1254,10 @@ class SignedContactResponse extends $pb.GeneratedMessage { @$pb.TagNumber(2) $1.Signature get identitySignature => $_getN(1); @$pb.TagNumber(2) - set identitySignature($1.Signature v) { setField(2, v); } + set identitySignature($1.Signature v) { + setField(2, v); + } + @$pb.TagNumber(2) $core.bool hasIdentitySignature() => $_has(1); @$pb.TagNumber(2) @@ -975,45 +1269,66 @@ class SignedContactResponse extends $pb.GeneratedMessage { class ContactInvitationRecord extends $pb.GeneratedMessage { factory ContactInvitationRecord() => create(); ContactInvitationRecord._() : super(); - factory ContactInvitationRecord.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r); - factory ContactInvitationRecord.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r); + factory ContactInvitationRecord.fromBuffer($core.List<$core.int> i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromBuffer(i, r); + factory ContactInvitationRecord.fromJson($core.String i, + [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => + create()..mergeFromJson(i, r); - static final $pb.BuilderInfo _i = $pb.BuilderInfo(_omitMessageNames ? '' : 'ContactInvitationRecord', package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), createEmptyInstance: create) - ..aOM<$0.OwnedDHTRecordPointer>(1, _omitFieldNames ? '' : 'contactRequestInbox', subBuilder: $0.OwnedDHTRecordPointer.create) - ..aOM<$1.CryptoKey>(2, _omitFieldNames ? '' : 'writerKey', subBuilder: $1.CryptoKey.create) - ..aOM<$1.CryptoKey>(3, _omitFieldNames ? '' : 'writerSecret', subBuilder: $1.CryptoKey.create) - ..aOM<$1.TypedKey>(4, _omitFieldNames ? '' : 'localConversationRecordKey', subBuilder: $1.TypedKey.create) - ..a<$fixnum.Int64>(5, _omitFieldNames ? '' : 'expiration', $pb.PbFieldType.OU6, defaultOrMaker: $fixnum.Int64.ZERO) - ..a<$core.List<$core.int>>(6, _omitFieldNames ? '' : 'invitation', $pb.PbFieldType.OY) + static final $pb.BuilderInfo _i = $pb.BuilderInfo( + _omitMessageNames ? '' : 'ContactInvitationRecord', + package: const $pb.PackageName(_omitMessageNames ? '' : 'veilidchat'), + createEmptyInstance: create) + ..aOM<$0.OwnedDHTRecordPointer>( + 1, _omitFieldNames ? '' : 'contactRequestInbox', + subBuilder: $0.OwnedDHTRecordPointer.create) + ..aOM<$1.CryptoKey>(2, _omitFieldNames ? '' : 'writerKey', + subBuilder: $1.CryptoKey.create) + ..aOM<$1.CryptoKey>(3, _omitFieldNames ? '' : 'writerSecret', + subBuilder: $1.CryptoKey.create) + ..aOM<$1.TypedKey>(4, _omitFieldNames ? '' : 'localConversationRecordKey', + subBuilder: $1.TypedKey.create) + ..a<$fixnum.Int64>( + 5, _omitFieldNames ? '' : 'expiration', $pb.PbFieldType.OU6, + defaultOrMaker: $fixnum.Int64.ZERO) + ..a<$core.List<$core.int>>( + 6, _omitFieldNames ? '' : 'invitation', $pb.PbFieldType.OY) ..aOS(7, _omitFieldNames ? '' : 'message') - ..hasRequiredFields = false - ; + ..hasRequiredFields = false; - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' - 'Will be removed in next major version') - ContactInvitationRecord clone() => ContactInvitationRecord()..mergeFromMessage(this); - @$core.Deprecated( - 'Using this can add significant overhead to your binary. ' - 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' - 'Will be removed in next major version') - ContactInvitationRecord copyWith(void Function(ContactInvitationRecord) updates) => super.copyWith((message) => updates(message as ContactInvitationRecord)) as ContactInvitationRecord; + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.deepCopy] instead. ' + 'Will be removed in next major version') + ContactInvitationRecord clone() => + ContactInvitationRecord()..mergeFromMessage(this); + @$core.Deprecated('Using this can add significant overhead to your binary. ' + 'Use [GeneratedMessageGenericExtensions.rebuild] instead. ' + 'Will be removed in next major version') + ContactInvitationRecord copyWith( + void Function(ContactInvitationRecord) updates) => + super.copyWith((message) => updates(message as ContactInvitationRecord)) + as ContactInvitationRecord; $pb.BuilderInfo get info_ => _i; @$core.pragma('dart2js:noInline') static ContactInvitationRecord create() => ContactInvitationRecord._(); ContactInvitationRecord createEmptyInstance() => create(); - static $pb.PbList createRepeated() => $pb.PbList(); + static $pb.PbList createRepeated() => + $pb.PbList(); @$core.pragma('dart2js:noInline') - static ContactInvitationRecord getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor(create); + static ContactInvitationRecord getDefault() => _defaultInstance ??= + $pb.GeneratedMessage.$_defaultFor(create); static ContactInvitationRecord? _defaultInstance; @$pb.TagNumber(1) $0.OwnedDHTRecordPointer get contactRequestInbox => $_getN(0); @$pb.TagNumber(1) - set contactRequestInbox($0.OwnedDHTRecordPointer v) { setField(1, v); } + set contactRequestInbox($0.OwnedDHTRecordPointer v) { + setField(1, v); + } + @$pb.TagNumber(1) $core.bool hasContactRequestInbox() => $_has(0); @$pb.TagNumber(1) @@ -1024,7 +1339,10 @@ class ContactInvitationRecord extends $pb.GeneratedMessage { @$pb.TagNumber(2) $1.CryptoKey get writerKey => $_getN(1); @$pb.TagNumber(2) - set writerKey($1.CryptoKey v) { setField(2, v); } + set writerKey($1.CryptoKey v) { + setField(2, v); + } + @$pb.TagNumber(2) $core.bool hasWriterKey() => $_has(1); @$pb.TagNumber(2) @@ -1035,7 +1353,10 @@ class ContactInvitationRecord extends $pb.GeneratedMessage { @$pb.TagNumber(3) $1.CryptoKey get writerSecret => $_getN(2); @$pb.TagNumber(3) - set writerSecret($1.CryptoKey v) { setField(3, v); } + set writerSecret($1.CryptoKey v) { + setField(3, v); + } + @$pb.TagNumber(3) $core.bool hasWriterSecret() => $_has(2); @$pb.TagNumber(3) @@ -1046,7 +1367,10 @@ class ContactInvitationRecord extends $pb.GeneratedMessage { @$pb.TagNumber(4) $1.TypedKey get localConversationRecordKey => $_getN(3); @$pb.TagNumber(4) - set localConversationRecordKey($1.TypedKey v) { setField(4, v); } + set localConversationRecordKey($1.TypedKey v) { + setField(4, v); + } + @$pb.TagNumber(4) $core.bool hasLocalConversationRecordKey() => $_has(3); @$pb.TagNumber(4) @@ -1057,7 +1381,10 @@ class ContactInvitationRecord extends $pb.GeneratedMessage { @$pb.TagNumber(5) $fixnum.Int64 get expiration => $_getI64(4); @$pb.TagNumber(5) - set expiration($fixnum.Int64 v) { $_setInt64(4, v); } + set expiration($fixnum.Int64 v) { + $_setInt64(4, v); + } + @$pb.TagNumber(5) $core.bool hasExpiration() => $_has(4); @$pb.TagNumber(5) @@ -1066,7 +1393,10 @@ class ContactInvitationRecord extends $pb.GeneratedMessage { @$pb.TagNumber(6) $core.List<$core.int> get invitation => $_getN(5); @$pb.TagNumber(6) - set invitation($core.List<$core.int> v) { $_setBytes(5, v); } + set invitation($core.List<$core.int> v) { + $_setBytes(5, v); + } + @$pb.TagNumber(6) $core.bool hasInvitation() => $_has(5); @$pb.TagNumber(6) @@ -1075,13 +1405,16 @@ class ContactInvitationRecord extends $pb.GeneratedMessage { @$pb.TagNumber(7) $core.String get message => $_getSZ(6); @$pb.TagNumber(7) - set message($core.String v) { $_setString(6, v); } + set message($core.String v) { + $_setString(6, v); + } + @$pb.TagNumber(7) $core.bool hasMessage() => $_has(6); @$pb.TagNumber(7) void clearMessage() => clearField(7); } - const _omitFieldNames = $core.bool.fromEnvironment('protobuf.omit_field_names'); -const _omitMessageNames = $core.bool.fromEnvironment('protobuf.omit_message_names'); +const _omitMessageNames = + $core.bool.fromEnvironment('protobuf.omit_message_names'); diff --git a/lib/router/cubit/router_cubit.dart b/lib/router/cubit/router_cubit.dart index 8aec72a..b0ba3eb 100644 --- a/lib/router/cubit/router_cubit.dart +++ b/lib/router/cubit/router_cubit.dart @@ -1,13 +1,16 @@ import 'dart:async'; import 'package:bloc/bloc.dart'; +import 'package:flutter/foundation.dart'; import 'package:flutter/widgets.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:go_router/go_router.dart'; +import 'package:stream_transform/stream_transform.dart'; import '../../../account_manager/account_manager.dart'; import '../../init.dart'; import '../../layout/layout.dart'; +import '../../settings/settings.dart'; import '../../tools/tools.dart'; import '../../veilid_processor/views/developer.dart'; @@ -15,6 +18,11 @@ part 'router_cubit.freezed.dart'; part 'router_cubit.g.dart'; part 'router_state.dart'; +final _rootNavKey = GlobalKey(debugLabel: 'rootNavKey'); +final _homeNavKey = GlobalKey(debugLabel: 'homeNavKey'); +final _readyAccountNavKey = + GlobalKey(debugLabel: 'readyAccountNavKey'); + class RouterCubit extends Cubit { RouterCubit(AccountRepository accountRepository) : super(const RouterState( @@ -27,9 +35,9 @@ class RouterCubit extends Cubit { await eventualInitialized.future; emit(state.copyWith(isInitialized: true)); }); + // Subscribe to repository streams - _accountRepositorySubscription = - accountRepository.stream().listen((event) { + _accountRepositorySubscription = accountRepository.stream.listen((event) { switch (event) { case AccountRepositoryChange.localAccounts: emit(state.copyWith( @@ -40,7 +48,6 @@ class RouterCubit extends Cubit { break; } }); - _chatListRepositorySubscription = ... } @override @@ -50,34 +57,50 @@ class RouterCubit extends Cubit { } /// Our application routes - List get routes => [ + List get routes => [ GoRoute( path: '/', builder: (context, state) => const IndexPage(), ), - GoRoute( - path: '/home', - builder: (context, state) => const HomePage(), - routes: [ - GoRoute( - path: 'settings', - builder: (context, state) => const SettingsPage(), - ), - GoRoute( - path: 'chat', - builder: (context, state) => const ChatOnlyPage(), - ), - ], - ), + ShellRoute( + navigatorKey: _homeNavKey, + builder: (context, state, child) => HomeShell(child: child), + routes: [ + GoRoute( + path: '/home/no_active', + builder: (context, state) => const HomeNoActive(), + ), + GoRoute( + path: '/home/account_missing', + builder: (context, state) => const HomeAccountMissing(), + ), + GoRoute( + path: '/home/account_locked', + builder: (context, state) => const HomeAccountLocked(), + ), + ShellRoute( + navigatorKey: _readyAccountNavKey, + builder: (context, state, child) => + HomeAccountReadyShell(child: child), + routes: [ + GoRoute( + path: '/home', + builder: (context, state) => const HomeAccountReadyMain(), + ), + GoRoute( + path: '/home/chat', + builder: (context, state) => const HomeAccountReadyChat(), + ), + ], + ), + ]), GoRoute( path: '/new_account', builder: (context, state) => const NewAccountPage(), - routes: [ - GoRoute( - path: 'settings', - builder: (context, state) => const SettingsPage(), - ), - ], + ), + GoRoute( + path: '/settings', + builder: (context, state) => const SettingsPage(), ), GoRoute( path: '/developer', @@ -87,11 +110,8 @@ class RouterCubit extends Cubit { /// Redirects when our state changes String? redirect(BuildContext context, GoRouterState goRouterState) { - // if (state.isLoading || state.hasError) { - // return null; - // } - // No matter where we are, if there's not + switch (goRouterState.matchedLocation) { case '/': @@ -133,8 +153,7 @@ class RouterCubit extends Cubit { return '/home'; } return null; - case '/home/settings': - case '/new_account/settings': + case '/settings': return null; case '/developer': return null; @@ -143,6 +162,18 @@ class RouterCubit extends Cubit { } } + /// Make a GoRouter instance that uses this cubit + GoRouter router() => GoRouter( + navigatorKey: _rootNavKey, + refreshListenable: StreamListenable(stream.startWith(state).distinct()), + debugLogDiagnostics: kDebugMode, + initialLocation: '/', + routes: routes, + redirect: redirect, + ); + + //////////////// + late final StreamSubscription _accountRepositorySubscription; } diff --git a/lib/router/cubit/router_cubit.freezed.dart b/lib/router/cubit/router_cubit.freezed.dart new file mode 100644 index 0000000..16baed7 --- /dev/null +++ b/lib/router/cubit/router_cubit.freezed.dart @@ -0,0 +1,193 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'router_cubit.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); + +RouterState _$RouterStateFromJson(Map json) { + return _RouterState.fromJson(json); +} + +/// @nodoc +mixin _$RouterState { + bool get isInitialized => throw _privateConstructorUsedError; + bool get hasAnyAccount => throw _privateConstructorUsedError; + bool get hasActiveChat => throw _privateConstructorUsedError; + + Map toJson() => throw _privateConstructorUsedError; + @JsonKey(ignore: true) + $RouterStateCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $RouterStateCopyWith<$Res> { + factory $RouterStateCopyWith( + RouterState value, $Res Function(RouterState) then) = + _$RouterStateCopyWithImpl<$Res, RouterState>; + @useResult + $Res call({bool isInitialized, bool hasAnyAccount, bool hasActiveChat}); +} + +/// @nodoc +class _$RouterStateCopyWithImpl<$Res, $Val extends RouterState> + implements $RouterStateCopyWith<$Res> { + _$RouterStateCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? isInitialized = null, + Object? hasAnyAccount = null, + Object? hasActiveChat = null, + }) { + return _then(_value.copyWith( + isInitialized: null == isInitialized + ? _value.isInitialized + : isInitialized // ignore: cast_nullable_to_non_nullable + as bool, + hasAnyAccount: null == hasAnyAccount + ? _value.hasAnyAccount + : hasAnyAccount // ignore: cast_nullable_to_non_nullable + as bool, + hasActiveChat: null == hasActiveChat + ? _value.hasActiveChat + : hasActiveChat // ignore: cast_nullable_to_non_nullable + as bool, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$RouterStateImplCopyWith<$Res> + implements $RouterStateCopyWith<$Res> { + factory _$$RouterStateImplCopyWith( + _$RouterStateImpl value, $Res Function(_$RouterStateImpl) then) = + __$$RouterStateImplCopyWithImpl<$Res>; + @override + @useResult + $Res call({bool isInitialized, bool hasAnyAccount, bool hasActiveChat}); +} + +/// @nodoc +class __$$RouterStateImplCopyWithImpl<$Res> + extends _$RouterStateCopyWithImpl<$Res, _$RouterStateImpl> + implements _$$RouterStateImplCopyWith<$Res> { + __$$RouterStateImplCopyWithImpl( + _$RouterStateImpl _value, $Res Function(_$RouterStateImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? isInitialized = null, + Object? hasAnyAccount = null, + Object? hasActiveChat = null, + }) { + return _then(_$RouterStateImpl( + isInitialized: null == isInitialized + ? _value.isInitialized + : isInitialized // ignore: cast_nullable_to_non_nullable + as bool, + hasAnyAccount: null == hasAnyAccount + ? _value.hasAnyAccount + : hasAnyAccount // ignore: cast_nullable_to_non_nullable + as bool, + hasActiveChat: null == hasActiveChat + ? _value.hasActiveChat + : hasActiveChat // ignore: cast_nullable_to_non_nullable + as bool, + )); + } +} + +/// @nodoc +@JsonSerializable() +class _$RouterStateImpl implements _RouterState { + const _$RouterStateImpl( + {required this.isInitialized, + required this.hasAnyAccount, + required this.hasActiveChat}); + + factory _$RouterStateImpl.fromJson(Map json) => + _$$RouterStateImplFromJson(json); + + @override + final bool isInitialized; + @override + final bool hasAnyAccount; + @override + final bool hasActiveChat; + + @override + String toString() { + return 'RouterState(isInitialized: $isInitialized, hasAnyAccount: $hasAnyAccount, hasActiveChat: $hasActiveChat)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$RouterStateImpl && + (identical(other.isInitialized, isInitialized) || + other.isInitialized == isInitialized) && + (identical(other.hasAnyAccount, hasAnyAccount) || + other.hasAnyAccount == hasAnyAccount) && + (identical(other.hasActiveChat, hasActiveChat) || + other.hasActiveChat == hasActiveChat)); + } + + @JsonKey(ignore: true) + @override + int get hashCode => + Object.hash(runtimeType, isInitialized, hasAnyAccount, hasActiveChat); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$RouterStateImplCopyWith<_$RouterStateImpl> get copyWith => + __$$RouterStateImplCopyWithImpl<_$RouterStateImpl>(this, _$identity); + + @override + Map toJson() { + return _$$RouterStateImplToJson( + this, + ); + } +} + +abstract class _RouterState implements RouterState { + const factory _RouterState( + {required final bool isInitialized, + required final bool hasAnyAccount, + required final bool hasActiveChat}) = _$RouterStateImpl; + + factory _RouterState.fromJson(Map json) = + _$RouterStateImpl.fromJson; + + @override + bool get isInitialized; + @override + bool get hasAnyAccount; + @override + bool get hasActiveChat; + @override + @JsonKey(ignore: true) + _$$RouterStateImplCopyWith<_$RouterStateImpl> get copyWith => + throw _privateConstructorUsedError; +} diff --git a/lib/router/cubit/router_cubit.g.dart b/lib/router/cubit/router_cubit.g.dart new file mode 100644 index 0000000..f67c770 --- /dev/null +++ b/lib/router/cubit/router_cubit.g.dart @@ -0,0 +1,21 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'router_cubit.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_$RouterStateImpl _$$RouterStateImplFromJson(Map json) => + _$RouterStateImpl( + isInitialized: json['is_initialized'] as bool, + hasAnyAccount: json['has_any_account'] as bool, + hasActiveChat: json['has_active_chat'] as bool, + ); + +Map _$$RouterStateImplToJson(_$RouterStateImpl instance) => + { + 'is_initialized': instance.isInitialized, + 'has_any_account': instance.hasAnyAccount, + 'has_active_chat': instance.hasActiveChat, + }; diff --git a/lib/router/make_router.dart b/lib/router/make_router.dart deleted file mode 100644 index 37e7a7b..0000000 --- a/lib/router/make_router.dart +++ /dev/null @@ -1,20 +0,0 @@ -import 'package:flutter/foundation.dart'; -import 'package:flutter/material.dart'; -import 'package:go_router/go_router.dart'; -import 'package:stream_transform/stream_transform.dart'; - -import '../tools/stream_listenable.dart'; -import 'cubit/router_cubit.dart'; - -final _key = GlobalKey(debugLabel: 'routerKey'); - -/// This simple provider caches our GoRouter. -GoRouter router({required RouterCubit routerCubit}) => GoRouter( - navigatorKey: _key, - refreshListenable: StreamListenable( - routerCubit.stream.startWith(routerCubit.state).distinct()), - debugLogDiagnostics: kDebugMode, - initialLocation: '/', - routes: routerCubit.routes, - redirect: routerCubit.redirect, - ); diff --git a/lib/router/router.dart b/lib/router/router.dart index 5090b83..1867a19 100644 --- a/lib/router/router.dart +++ b/lib/router/router.dart @@ -1,2 +1 @@ export 'cubit/router_cubit.dart'; -export 'make_router.dart'; diff --git a/lib/settings/models/preferences.freezed.dart b/lib/settings/models/preferences.freezed.dart index 3a3e6c7..e9667c8 100644 --- a/lib/settings/models/preferences.freezed.dart +++ b/lib/settings/models/preferences.freezed.dart @@ -12,7 +12,7 @@ part of 'preferences.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); LockPreference _$LockPreferenceFromJson(Map json) { return _LockPreference.fromJson(json); diff --git a/lib/theme/models/theme_preference.freezed.dart b/lib/theme/models/theme_preference.freezed.dart index 3b2b9a4..9f10955 100644 --- a/lib/theme/models/theme_preference.freezed.dart +++ b/lib/theme/models/theme_preference.freezed.dart @@ -12,7 +12,7 @@ part of 'theme_preference.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); ThemePreferences _$ThemePreferencesFromJson(Map json) { return _ThemePreferences.fromJson(json); diff --git a/lib/veilid_processor/models/processor_connection_state.freezed.dart b/lib/veilid_processor/models/processor_connection_state.freezed.dart index a6e01fa..d857318 100644 --- a/lib/veilid_processor/models/processor_connection_state.freezed.dart +++ b/lib/veilid_processor/models/processor_connection_state.freezed.dart @@ -12,7 +12,7 @@ part of 'processor_connection_state.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$ProcessorConnectionState { diff --git a/macos/Podfile.lock b/macos/Podfile.lock index 949cb69..90f42c4 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -1,9 +1,6 @@ PODS: - FlutterMacOS (1.0.0) - - FMDB (2.7.5): - - FMDB/standard (= 2.7.5) - - FMDB/standard (2.7.5) - - mobile_scanner (3.5.5): + - mobile_scanner (3.5.6): - FlutterMacOS - pasteboard (0.0.1): - FlutterMacOS @@ -19,9 +16,9 @@ PODS: - FlutterMacOS - smart_auth (0.0.1): - FlutterMacOS - - sqflite (0.0.2): + - sqflite (0.0.3): + - Flutter - FlutterMacOS - - FMDB (>= 2.7.5) - url_launcher_macos (0.0.1): - FlutterMacOS - veilid (0.0.1): @@ -38,15 +35,11 @@ DEPENDENCIES: - share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`) - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`) - smart_auth (from `Flutter/ephemeral/.symlinks/plugins/smart_auth/macos`) - - sqflite (from `Flutter/ephemeral/.symlinks/plugins/sqflite/macos`) + - sqflite (from `Flutter/ephemeral/.symlinks/plugins/sqflite/darwin`) - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`) - veilid (from `Flutter/ephemeral/.symlinks/plugins/veilid/macos`) - window_manager (from `Flutter/ephemeral/.symlinks/plugins/window_manager/macos`) -SPEC REPOS: - trunk: - - FMDB - EXTERNAL SOURCES: FlutterMacOS: :path: Flutter/ephemeral @@ -65,7 +58,7 @@ EXTERNAL SOURCES: smart_auth: :path: Flutter/ephemeral/.symlinks/plugins/smart_auth/macos sqflite: - :path: Flutter/ephemeral/.symlinks/plugins/sqflite/macos + :path: Flutter/ephemeral/.symlinks/plugins/sqflite/darwin url_launcher_macos: :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos veilid: @@ -75,15 +68,14 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 - FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a - mobile_scanner: d12930b68bf502497f78b8b5182aeccfaa1e04f6 + mobile_scanner: 54ceceae0c8da2457e26a362a6be5c61154b1829 pasteboard: 9b69dba6fedbb04866be632205d532fe2f6b1d99 - path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 + path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c screen_retriever: 59634572a57080243dd1bf715e55b6c54f241a38 share_plus: 76dd39142738f7a68dd57b05093b5e8193f220f7 - shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126 + shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695 smart_auth: b38e3ab4bfe089eacb1e233aca1a2340f96c28e9 - sqflite: a5789cceda41d54d23f31d6de539d65bb14100ea + sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec url_launcher_macos: d2691c7dd33ed713bf3544850a623080ec693d95 veilid: a54f57b7bcf0e4e072fe99272d76ca126b2026d0 window_manager: 3a1844359a6295ab1e47659b1a777e36773cd6e8 diff --git a/packages/async_tools/build.bat b/packages/async_tools/build.bat new file mode 100644 index 0000000..0e2e698 --- /dev/null +++ b/packages/async_tools/build.bat @@ -0,0 +1,2 @@ +@echo off +dart run build_runner build --delete-conflicting-outputs diff --git a/packages/async_tools/build.sh b/packages/async_tools/build.sh new file mode 100755 index 0000000..2a76503 --- /dev/null +++ b/packages/async_tools/build.sh @@ -0,0 +1,3 @@ +#!/bin/bash +set -e +dart run build_runner build --delete-conflicting-outputs diff --git a/packages/async_tools/lib/src/async_value.freezed.dart b/packages/async_tools/lib/src/async_value.freezed.dart index 2632704..b6911e2 100644 --- a/packages/async_tools/lib/src/async_value.freezed.dart +++ b/packages/async_tools/lib/src/async_value.freezed.dart @@ -12,7 +12,7 @@ part of 'async_value.dart'; T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( - 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); /// @nodoc mixin _$AsyncValue { diff --git a/packages/async_tools/pubspec.yaml b/packages/async_tools/pubspec.yaml index a495170..34ae0a4 100644 --- a/packages/async_tools/pubspec.yaml +++ b/packages/async_tools/pubspec.yaml @@ -13,6 +13,7 @@ dependencies: path: ../mutex dev_dependencies: + build_runner: ^2.4.8 freezed: ^2.3.5 lint_hard: ^4.0.0 test: ^1.24.0 diff --git a/packages/veilid_support/lib/proto/proto.dart b/packages/veilid_support/lib/proto/proto.dart index 86f3606..bb861f4 100644 --- a/packages/veilid_support/lib/proto/proto.dart +++ b/packages/veilid_support/lib/proto/proto.dart @@ -100,15 +100,17 @@ extension NonceProto on veilid.Nonce { ..u5 = b.getUint32(5 * 4); return out; } +} - static veilid.Nonce fromProto(proto.Nonce p) { +extension ProtoNonce on proto.Nonce { + veilid.Nonce toVeilid() { final b = ByteData(24) - ..setUint32(0 * 4, p.u0) - ..setUint32(1 * 4, p.u1) - ..setUint32(2 * 4, p.u2) - ..setUint32(3 * 4, p.u3) - ..setUint32(4 * 4, p.u4) - ..setUint32(5 * 4, p.u5); + ..setUint32(0 * 4, u0) + ..setUint32(1 * 4, u1) + ..setUint32(2 * 4, u2) + ..setUint32(3 * 4, u3) + ..setUint32(4 * 4, u4) + ..setUint32(5 * 4, u5); return veilid.Nonce.fromBytes(Uint8List.view(b.buffer)); } } @@ -122,9 +124,11 @@ extension TypedKeyProto on veilid.TypedKey { ..value = value.toProto(); return out; } +} - static veilid.TypedKey fromProto(proto.TypedKey p) => - veilid.TypedKey(kind: p.kind, value: CryptoKeyProto.fromProto(p.value)); +extension ProtoTypedKey on proto.TypedKey { + veilid.TypedKey toVeilid() => + veilid.TypedKey(kind: kind, value: CryptoKeyProto.fromProto(value)); } /// KeyPair protobuf marshaling diff --git a/pubspec.lock b/pubspec.lock index 1d4800b..284c9b7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -228,10 +228,10 @@ packages: dependency: transitive description: name: camera_platform_interface - sha256: e971ebca970f7cfee396f76ef02070b5e441b4aa04942da9c108d725f57bbd32 + sha256: fceb2c36038b6392317b1d5790c6ba9e6ca9f1da3031181b8bea03882bf9387a url: "https://pub.dev" source: hosted - version: "2.7.2" + version: "2.7.3" camera_web: dependency: transitive description: @@ -449,10 +449,10 @@ packages: dependency: "direct main" description: name: flutter_animate - sha256: cabe33af6201144be052352d53572a1b8a4f5782b46080be7520d95abe763715 + sha256: "7c8a6594a9252dad30cc2ef16e33270b6248c4dedc3b3d06c86c4f3f4dc05ae5" url: "https://pub.dev" source: hosted - version: "4.4.1" + version: "4.5.0" flutter_bloc: dependency: "direct main" description: @@ -481,26 +481,26 @@ packages: dependency: "direct main" description: name: flutter_chat_ui - sha256: "6a4712026429d3b28547bd3d147ded44f8dd53dacc1ff14113693d7b7dd14382" + sha256: c8580c85e2d29359ffc84147e643d08d883eb6e757208652377f0105ef58807f url: "https://pub.dev" source: hosted - version: "1.6.10" + version: "1.6.12" flutter_form_builder: dependency: "direct main" description: name: flutter_form_builder - sha256: e8702c52dc45b43ed42e2b5d9b35f2970096d9cf1a58015cd3a76fad62a8f183 + sha256: "560eb5e367d81170c6ade1e7ae63ecc5167936ae2cdfaae8a345e91bce19d2f2" url: "https://pub.dev" source: hosted - version: "9.2.0" + version: "9.2.1" flutter_hooks: dependency: "direct main" description: name: flutter_hooks - sha256: "09f64db63fee3b2ab8b9038a1346be7d8986977fae3fec601275bf32455ccfc0" + sha256: cde36b12f7188c85286fba9b38cc5a902e7279f36dd676967106c041dc9dde70 url: "https://pub.dev" source: hosted - version: "0.20.4" + version: "0.20.5" flutter_link_previewer: dependency: transitive description: @@ -546,6 +546,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.17" + flutter_shaders: + dependency: transitive + description: + name: flutter_shaders + sha256: "02750b545c01ff4d8e9bbe8f27a7731aa3778402506c67daa1de7f5fc3f4befe" + url: "https://pub.dev" + source: hosted + version: "0.1.2" flutter_slidable: dependency: "direct main" description: @@ -600,10 +608,10 @@ packages: dependency: "direct dev" description: name: freezed - sha256: "6c5031daae12c7072b3a87eff98983076434b4889ef2a44384d0cae3f82372ba" + sha256: "57247f692f35f068cae297549a46a9a097100685c6780fe67177503eea5ed4e5" url: "https://pub.dev" source: hosted - version: "2.4.6" + version: "2.4.7" freezed_annotation: dependency: "direct main" description: @@ -640,10 +648,10 @@ packages: dependency: "direct main" description: name: go_router - sha256: "2ccd74480706e0a70a0e0dfa9543dede41bc11d0fe3b146a6ad7b7686f6b4407" + sha256: "170c46e237d6eb0e6e9f0e8b3f56101e14fb64f787016e42edd74c39cf8b176a" url: "https://pub.dev" source: hosted - version: "11.1.4" + version: "13.2.0" graphs: dependency: transitive description: @@ -712,10 +720,10 @@ packages: dependency: "direct main" description: name: image - sha256: "004a2e90ce080f8627b5a04aecb4cdfac87d2c3f3b520aa291260be5a32c033d" + sha256: "4c68bfd5ae83e700b5204c1e74451e7bf3cf750e6843c6e158289cf56bda018e" url: "https://pub.dev" source: hosted - version: "4.1.4" + version: "4.1.7" intl: dependency: "direct main" description: @@ -824,10 +832,10 @@ packages: dependency: "direct main" description: name: mobile_scanner - sha256: "1b60b8f9d4ce0cb0e7d7bc223c955d083a0737bee66fa1fcfe5de48225e0d5b3" + sha256: "619ed5fd43ca9007a151f00c3dc43feedeaf235fe5647735d0237c38849d49dc" url: "https://pub.dev" source: hosted - version: "3.5.7" + version: "4.0.0" motion_toast: dependency: "direct main" description: @@ -959,10 +967,10 @@ packages: dependency: "direct main" description: name: pinput - sha256: a92b55ecf9c25d1b9e100af45905385d5bc34fc9b6b04177a9e82cb88fe4d805 + sha256: "6d571e38a484f7515a52e89024ef416f11fa6171ac6f32303701374ab9890efa" url: "https://pub.dev" source: hosted - version: "3.0.1" + version: "4.0.0" platform: dependency: transitive description: @@ -1055,10 +1063,10 @@ packages: dependency: "direct main" description: name: qr_code_dart_scan - sha256: ab40c5e8cf09e723fdd1c24ee23ae7187e44d958cc4b1554b4cd094845ae6989 + sha256: ddf409177eeef07f7bdf4e4929858b3acf139873da273315789ebc97bd17bec8 url: "https://pub.dev" source: hosted - version: "0.7.3" + version: "0.7.4" qr_flutter: dependency: "direct main" description: @@ -1236,10 +1244,10 @@ packages: dependency: transitive description: name: smart_auth - sha256: a25229b38c02f733d0a4e98d941b42bed91a976cb589e934895e60ccfa674cf6 + sha256: "88aa8fe66e951c78a307f26d1c29672dce2e9eb3da2e12e853864d0e615a73ad" url: "https://pub.dev" source: hosted - version: "1.1.1" + version: "2.0.0" source_gen: dependency: transitive description: @@ -1272,6 +1280,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.2.1" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" sqflite: dependency: transitive description: @@ -1468,34 +1484,34 @@ packages: dependency: "direct main" description: name: uuid - sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" + sha256: cd210a09f7c18cbe5a02511718e0334de6559871052c90a90c0cca46a4aa81c8 url: "https://pub.dev" source: hosted - version: "3.0.7" + version: "4.3.3" vector_graphics: dependency: transitive description: name: vector_graphics - sha256: "18f6690295af52d081f6808f2f7c69f0eed6d7e23a71539d75f4aeb8f0062172" + sha256: "4ac59808bbfca6da38c99f415ff2d3a5d7ca0a6b4809c71d9cf30fba5daf9752" url: "https://pub.dev" source: hosted - version: "1.1.9+2" + version: "1.1.10+1" vector_graphics_codec: dependency: transitive description: name: vector_graphics_codec - sha256: "531d20465c10dfac7f5cd90b60bbe4dd9921f1ec4ca54c83ebb176dbacb7bb2d" + sha256: f3247e7ab0ec77dc759263e68394990edc608fb2b480b80db8aa86ed09279e33 url: "https://pub.dev" source: hosted - version: "1.1.9+2" + version: "1.1.10+1" vector_graphics_compiler: dependency: transitive description: name: vector_graphics_compiler - sha256: "03012b0a33775c5530576b70240308080e1d5050f0faf000118c20e6463bc0ad" + sha256: "18489bdd8850de3dd7ca8a34e0c446f719ec63e2bab2e7a8cc66a9028dd76c5a" url: "https://pub.dev" source: hosted - version: "1.1.9+2" + version: "1.1.10+1" vector_math: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index f2ed0f5..ebcbef7 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -29,12 +29,12 @@ dependencies: fixnum: ^1.1.0 flutter: sdk: flutter - flutter_animate: ^4.4.1 + flutter_animate: ^4.5.0 flutter_bloc: ^8.1.3 flutter_chat_types: ^3.6.2 - flutter_chat_ui: ^1.6.10 - flutter_form_builder: ^9.2.0 - flutter_hooks: ^0.20.4 + flutter_chat_ui: ^1.6.12 + flutter_form_builder: ^9.2.1 + flutter_hooks: ^0.20.5 flutter_localizations: sdk: flutter flutter_native_splash: ^2.3.10 @@ -44,25 +44,25 @@ dependencies: flutter_translate: ^4.0.4 form_builder_validators: ^9.1.0 freezed_annotation: ^2.4.1 - go_router: ^11.1.4 + go_router: ^13.2.0 hydrated_bloc: ^9.1.3 - image: ^4.1.4 + image: ^4.1.7 intl: ^0.18.1 json_annotation: ^4.8.1 loggy: ^2.0.3 meta: ^1.10.0 - mobile_scanner: ^3.5.7 + mobile_scanner: ^4.0.0 motion_toast: ^2.8.0 mutex: path: packages/mutex pasteboard: ^0.2.0 path: ^1.8.3 path_provider: ^2.1.2 - pinput: ^3.0.1 + pinput: ^4.0.0 preload_page_view: ^0.2.0 protobuf: ^3.1.0 provider: ^6.1.1 - qr_code_dart_scan: ^0.7.3 + qr_code_dart_scan: ^0.7.4 qr_flutter: ^4.1.0 quickalert: ^1.0.2 radix_colors: ^1.0.4 @@ -75,7 +75,7 @@ dependencies: stack_trace: ^1.11.1 stream_transform: ^2.1.0 stylish_bottom_bar: ^1.0.3 - uuid: ^3.0.7 + uuid: ^4.3.3 veilid: # veilid: ^0.0.1 path: ../veilid/veilid-flutter @@ -89,7 +89,7 @@ dev_dependencies: build_runner: ^2.4.8 flutter_test: sdk: flutter - freezed: ^2.4.6 + freezed: ^2.4.7 icons_launcher: ^2.1.7 json_serializable: ^6.7.1 lint_hard: ^4.0.0