checkpoint

This commit is contained in:
Christien Rioux 2024-02-11 23:18:20 -05:00
parent ff14969ffa
commit a6ba08255b
34 changed files with 1301 additions and 706 deletions

View File

@ -1,6 +1,13 @@
@echo off @echo off
dart run build_runner build --delete-conflicting-outputs 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 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 -I proto veilidchat.proto
protoc --dart_out=proto -I veilid_support\proto -I veilid_support\dht_support\proto dht.proto protoc --dart_out=proto -I veilid_support\proto -I veilid_support\dht_support\proto dht.proto

View File

@ -1,12 +1,16 @@
#!/bin/bash #!/bin/bash
set -e set -e
pushd packages/async_tools > /dev/null
./build.sh
popd > /dev/null
pushd packages/veilid_support > /dev/null pushd packages/veilid_support > /dev/null
./build.sh ./build.sh
popd > /dev/null popd > /dev/null
dart run build_runner build --delete-conflicting-outputs dart run build_runner build --delete-conflicting-outputs
pushd lib > /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
protoc --dart_out=proto -I ../packages/veilid_support/lib/proto -I ../packages/veilid_support/lib/dht_support/proto -I proto veilidchat.proto sed -i '' 's/dht.pb.dart/package:veilid_support\/proto\/dht.pb.dart/g' lib/proto/veilidchat.pb.dart
popd > /dev/null sed -i '' 's/veilid.pb.dart/package:veilid_support\/proto\/veilid.pb.dart/g' lib/proto/veilidchat.pb.dart

View File

@ -12,7 +12,7 @@ part of 'local_account.dart';
T _$identity<T>(T value) => value; T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError( 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<String, dynamic> json) { LocalAccount _$LocalAccountFromJson(Map<String, dynamic> json) {
return _LocalAccount.fromJson(json); return _LocalAccount.fromJson(json);

View File

@ -12,7 +12,7 @@ part of 'user_login.dart';
T _$identity<T>(T value) => value; T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError( 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<String, dynamic> json) { UserLogin _$UserLoginFromJson(Map<String, dynamic> json) {
return _UserLogin.fromJson(json); return _UserLogin.fromJson(json);

View File

@ -12,7 +12,7 @@ part of 'active_logins.dart';
T _$identity<T>(T value) => value; T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError( 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<String, dynamic> json) { ActiveLogins _$ActiveLoginsFromJson(Map<String, dynamic> json) {
return _ActiveLogins.fromJson(json); return _ActiveLogins.fromJson(json);

View File

@ -106,7 +106,7 @@ class NewAccountPageState extends State<NewAccountPage> {
icon: const Icon(Icons.settings), icon: const Icon(Icons.settings),
tooltip: translate('app_bar.settings_tooltip'), tooltip: translate('app_bar.settings_tooltip'),
onPressed: () async { onPressed: () async {
context.go('/new_account/settings'); await GoRouterHelper(context).push('/settings');
}) })
]), ]),
body: _newAccountForm( body: _newAccountForm(

View File

@ -55,8 +55,8 @@ class VeilidChatApp extends StatelessWidget {
child: BackgroundTicker( child: BackgroundTicker(
builder: (context) => MaterialApp.router( builder: (context) => MaterialApp.router(
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
routerConfig: router( routerConfig:
routerCubit: BlocProvider.of<RouterCubit>(context)), BlocProvider.of<RouterCubit>(context).router(),
title: translate('app.title'), title: translate('app.title'),
theme: theme, theme: theme,
localizationsDelegates: [ localizationsDelegates: [

View File

@ -3,7 +3,6 @@ import 'dart:async';
import 'package:async_tools/async_tools.dart'; import 'package:async_tools/async_tools.dart';
import 'package:awesome_extensions/awesome_extensions.dart'; import 'package:awesome_extensions/awesome_extensions.dart';
import 'package:fast_immutable_collections/fast_immutable_collections.dart'; import 'package:fast_immutable_collections/fast_immutable_collections.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_chat_types/flutter_chat_types.dart' as types; import 'package:flutter_chat_types/flutter_chat_types.dart' as types;

View File

@ -91,7 +91,7 @@ class ActiveConversationMessagesCubit extends BlocMapCubit<TypedKey,
required proto.Conversation localConversation, required proto.Conversation localConversation,
required proto.Conversation remoteConversation}) async => required proto.Conversation remoteConversation}) async =>
add(() => MapEntry( add(() => MapEntry(
contact.remoteConversationRecordKey, proto.TypedKeyProto.fromProto(contact.remoteConversationRecordKey),
MessagesCubit( MessagesCubit(
activeAccountInfo: _activeAccountInfo, activeAccountInfo: _activeAccountInfo,
remoteIdentityPublicKey: contact.identityPublicKey, remoteIdentityPublicKey: contact.identityPublicKey,

View File

@ -40,14 +40,15 @@ class ActiveConversationsCubit extends BlocMapCubit<TypedKey,
// Add an active conversation to be tracked for changes // Add an active conversation to be tracked for changes
Future<void> addConversation({required proto.Contact contact}) async => Future<void> addConversation({required proto.Contact contact}) async =>
add(() => MapEntry( add(() => MapEntry(
contact.remoteConversationRecordKey, contact.remoteConversationRecordKey.toVeilid(),
TransformerCubit( TransformerCubit(
ConversationCubit( ConversationCubit(
activeAccountInfo: _activeAccountInfo, activeAccountInfo: _activeAccountInfo,
remoteIdentityPublicKey: contact.identityPublicKey, remoteIdentityPublicKey: contact.identityPublicKey.toVeilid(),
localConversationRecordKey: contact.localConversationRecordKey, localConversationRecordKey:
contact.localConversationRecordKey.toVeilid(),
remoteConversationRecordKey: remoteConversationRecordKey:
contact.remoteConversationRecordKey, contact.remoteConversationRecordKey.toVeilid(),
), ),
// Transformer that only passes through completed conversations // Transformer that only passes through completed conversations
// along with the contact that corresponds to the completed // along with the contact that corresponds to the completed

View File

@ -1,81 +1,6 @@
import 'package:flutter/material.dart'; export 'home_account_invalid.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; export 'home_account_locked.dart';
import 'package:provider/provider.dart'; export 'home_account_missing.dart';
export 'home_account_ready/home_account_ready.dart';
import '../../account_manager/account_manager.dart'; export 'home_no_active.dart';
import '../../theme/theme.dart'; export 'home_shell.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<HomePage> 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<ActiveUserLoginCubit>().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<ActiveAccountInfo>.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<ScaleScheme>()!;
return SafeArea(
child: GestureDetector(
onTap: () => FocusScope.of(context).requestFocus(_unfocusNode),
child: DecoratedBox(
decoration: BoxDecoration(
color: scale.primaryScale.activeElementBackground),
child: buildWithLogin(context))));
}
}

View File

@ -1,146 +1,3 @@
import 'package:awesome_extensions/awesome_extensions.dart'; export 'home_account_ready_chat.dart';
import 'package:fast_immutable_collections/fast_immutable_collections.dart'; export 'home_account_ready_main.dart';
import 'package:flutter/material.dart'; export 'home_account_ready_shell.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<HomeAccountReady>
with TickerProviderStateMixin {
//
@override
void initState() {
super.initState();
}
Widget buildUnlockAccount(
BuildContext context,
IList<LocalAccount> localAccounts,
// ignore: prefer_expression_function_bodies
) {
return const Center(child: Text('unlock account'));
}
Widget buildUserPanel() => Builder(builder: (context) {
final account = context.watch<AccountRecordCubit>().state;
final theme = Theme.of(context);
final scale = theme.extension<ScaleScheme>()!;
return Column(children: <Widget>[
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<ActiveChatCubit>().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<ScaleScheme>()!;
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<ActiveAccountInfo>();
final accountData = context.watch<AccountRecordCubit>().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));
}
}

View File

@ -2,28 +2,20 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import '../../../chat/chat.dart'; import '../../../chat/chat.dart';
import '../../../tools/tools.dart';
class ChatOnlyPage extends StatefulWidget { class HomeAccountReadyChat extends StatefulWidget {
const ChatOnlyPage({super.key}); const HomeAccountReadyChat({super.key});
@override @override
ChatOnlyPageState createState() => ChatOnlyPageState(); HomeAccountReadyChatState createState() => HomeAccountReadyChatState();
} }
class ChatOnlyPageState extends State<ChatOnlyPage> class HomeAccountReadyChatState extends State<HomeAccountReadyChat> {
with TickerProviderStateMixin {
final _unfocusNode = FocusNode(); final _unfocusNode = FocusNode();
@override @override
void initState() { void initState() {
super.initState(); super.initState();
WidgetsBinding.instance.addPostFrameCallback((_) async {
setState(() {});
await changeWindowSetup(
TitleBarStyle.normal, OrientationCapability.normal);
});
} }
@override @override

View File

@ -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<AccountRecordCubit>().state;
final theme = Theme.of(context);
final scale = theme.extension<ScaleScheme>()!;
return Column(children: <Widget>[
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<ActiveChatCubit>().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<ScaleScheme>()!;
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);
}

View File

@ -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<HomeAccountReadyShell>
with TickerProviderStateMixin {
//
@override
void initState() {
super.initState();
}
// xxx figure out how to do this switch
// Widget buildWithLogin(BuildContext context) {
// final activeUserLogin = context.watch<ActiveUserLoginCubit>().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<ActiveAccountInfo>.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<ActiveUserLoginCubit>().state!;
final accountInfo = AccountRepository.instance
.getAccountInfo(accountMasterRecordKey: activeUserLogin)!;
final activeAccountInfo = accountInfo.activeAccountInfo!;
return Provider<ActiveAccountInfo>.value(
value: activeAccountInfo,
child: BlocProvider(
create: (context) => AccountRecordCubit(
record: accountInfo.activeAccountInfo!.accountRecord),
child: Builder(builder: (context) {
final account =
context.watch<AccountRecordCubit>().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);
})));
}
}

View File

@ -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<HomeShell> {
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<ScaleScheme>()!;
// 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)));
}
}

View File

@ -42,7 +42,7 @@ void main() async {
await initializeWindowControl(); await initializeWindowControl();
// Make localization delegate // Make localization delegate
final delegate = await LocalizationDelegate.create( final localizationDelegate = await LocalizationDelegate.create(
fallbackLocale: 'en_US', supportedLocales: ['en_US']); fallbackLocale: 'en_US', supportedLocales: ['en_US']);
await initializeDateFormatting(); await initializeDateFormatting();
@ -51,8 +51,8 @@ void main() async {
// Run the app // Run the app
// Hot reloads will only restart this part, not Veilid // Hot reloads will only restart this part, not Veilid
runApp(LocalizedApp( runApp(LocalizedApp(localizationDelegate,
delegate, VeilidChatApp(initialThemeData: initialThemeData))); VeilidChatApp(initialThemeData: initialThemeData)));
}, (error, stackTrace) { }, (error, stackTrace) {
log.error('Dart Runtime: {$error}\n{$stackTrace}'); log.error('Dart Runtime: {$error}\n{$stackTrace}');
}); });

File diff suppressed because it is too large Load Diff

View File

@ -1,13 +1,16 @@
import 'dart:async'; import 'dart:async';
import 'package:bloc/bloc.dart'; import 'package:bloc/bloc.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:go_router/go_router.dart'; import 'package:go_router/go_router.dart';
import 'package:stream_transform/stream_transform.dart';
import '../../../account_manager/account_manager.dart'; import '../../../account_manager/account_manager.dart';
import '../../init.dart'; import '../../init.dart';
import '../../layout/layout.dart'; import '../../layout/layout.dart';
import '../../settings/settings.dart';
import '../../tools/tools.dart'; import '../../tools/tools.dart';
import '../../veilid_processor/views/developer.dart'; import '../../veilid_processor/views/developer.dart';
@ -15,6 +18,11 @@ part 'router_cubit.freezed.dart';
part 'router_cubit.g.dart'; part 'router_cubit.g.dart';
part 'router_state.dart'; part 'router_state.dart';
final _rootNavKey = GlobalKey<NavigatorState>(debugLabel: 'rootNavKey');
final _homeNavKey = GlobalKey<NavigatorState>(debugLabel: 'homeNavKey');
final _readyAccountNavKey =
GlobalKey<NavigatorState>(debugLabel: 'readyAccountNavKey');
class RouterCubit extends Cubit<RouterState> { class RouterCubit extends Cubit<RouterState> {
RouterCubit(AccountRepository accountRepository) RouterCubit(AccountRepository accountRepository)
: super(const RouterState( : super(const RouterState(
@ -27,9 +35,9 @@ class RouterCubit extends Cubit<RouterState> {
await eventualInitialized.future; await eventualInitialized.future;
emit(state.copyWith(isInitialized: true)); emit(state.copyWith(isInitialized: true));
}); });
// Subscribe to repository streams // Subscribe to repository streams
_accountRepositorySubscription = _accountRepositorySubscription = accountRepository.stream.listen((event) {
accountRepository.stream().listen((event) {
switch (event) { switch (event) {
case AccountRepositoryChange.localAccounts: case AccountRepositoryChange.localAccounts:
emit(state.copyWith( emit(state.copyWith(
@ -40,7 +48,6 @@ class RouterCubit extends Cubit<RouterState> {
break; break;
} }
}); });
_chatListRepositorySubscription = ...
} }
@override @override
@ -50,34 +57,50 @@ class RouterCubit extends Cubit<RouterState> {
} }
/// Our application routes /// Our application routes
List<GoRoute> get routes => [ List<RouteBase> get routes => [
GoRoute( GoRoute(
path: '/', path: '/',
builder: (context, state) => const IndexPage(), builder: (context, state) => const IndexPage(),
), ),
GoRoute( ShellRoute(
path: '/home', navigatorKey: _homeNavKey,
builder: (context, state) => const HomePage(), builder: (context, state, child) => HomeShell(child: child),
routes: [ routes: [
GoRoute( GoRoute(
path: 'settings', path: '/home/no_active',
builder: (context, state) => const SettingsPage(), builder: (context, state) => const HomeNoActive(),
), ),
GoRoute( GoRoute(
path: 'chat', path: '/home/account_missing',
builder: (context, state) => const ChatOnlyPage(), 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( GoRoute(
path: '/new_account', path: '/new_account',
builder: (context, state) => const NewAccountPage(), builder: (context, state) => const NewAccountPage(),
routes: [
GoRoute(
path: 'settings',
builder: (context, state) => const SettingsPage(),
), ),
], GoRoute(
path: '/settings',
builder: (context, state) => const SettingsPage(),
), ),
GoRoute( GoRoute(
path: '/developer', path: '/developer',
@ -87,11 +110,8 @@ class RouterCubit extends Cubit<RouterState> {
/// Redirects when our state changes /// Redirects when our state changes
String? redirect(BuildContext context, GoRouterState goRouterState) { String? redirect(BuildContext context, GoRouterState goRouterState) {
// if (state.isLoading || state.hasError) {
// return null;
// }
// No matter where we are, if there's not // No matter where we are, if there's not
switch (goRouterState.matchedLocation) { switch (goRouterState.matchedLocation) {
case '/': case '/':
@ -133,8 +153,7 @@ class RouterCubit extends Cubit<RouterState> {
return '/home'; return '/home';
} }
return null; return null;
case '/home/settings': case '/settings':
case '/new_account/settings':
return null; return null;
case '/developer': case '/developer':
return null; return null;
@ -143,6 +162,18 @@ class RouterCubit extends Cubit<RouterState> {
} }
} }
/// 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<AccountRepositoryChange> late final StreamSubscription<AccountRepositoryChange>
_accountRepositorySubscription; _accountRepositorySubscription;
} }

View File

@ -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>(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<String, dynamic> json) {
return _RouterState.fromJson(json);
}
/// @nodoc
mixin _$RouterState {
bool get isInitialized => throw _privateConstructorUsedError;
bool get hasAnyAccount => throw _privateConstructorUsedError;
bool get hasActiveChat => throw _privateConstructorUsedError;
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$RouterStateCopyWith<RouterState> 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<String, dynamic> 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<String, dynamic> 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<String, dynamic> 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;
}

View File

@ -0,0 +1,21 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'router_cubit.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
_$RouterStateImpl _$$RouterStateImplFromJson(Map<String, dynamic> json) =>
_$RouterStateImpl(
isInitialized: json['is_initialized'] as bool,
hasAnyAccount: json['has_any_account'] as bool,
hasActiveChat: json['has_active_chat'] as bool,
);
Map<String, dynamic> _$$RouterStateImplToJson(_$RouterStateImpl instance) =>
<String, dynamic>{
'is_initialized': instance.isInitialized,
'has_any_account': instance.hasAnyAccount,
'has_active_chat': instance.hasActiveChat,
};

View File

@ -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<NavigatorState>(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,
);

View File

@ -1,2 +1 @@
export 'cubit/router_cubit.dart'; export 'cubit/router_cubit.dart';
export 'make_router.dart';

View File

@ -12,7 +12,7 @@ part of 'preferences.dart';
T _$identity<T>(T value) => value; T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError( 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<String, dynamic> json) { LockPreference _$LockPreferenceFromJson(Map<String, dynamic> json) {
return _LockPreference.fromJson(json); return _LockPreference.fromJson(json);

View File

@ -12,7 +12,7 @@ part of 'theme_preference.dart';
T _$identity<T>(T value) => value; T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError( 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<String, dynamic> json) { ThemePreferences _$ThemePreferencesFromJson(Map<String, dynamic> json) {
return _ThemePreferences.fromJson(json); return _ThemePreferences.fromJson(json);

View File

@ -12,7 +12,7 @@ part of 'processor_connection_state.dart';
T _$identity<T>(T value) => value; T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError( 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 /// @nodoc
mixin _$ProcessorConnectionState { mixin _$ProcessorConnectionState {

View File

@ -1,9 +1,6 @@
PODS: PODS:
- FlutterMacOS (1.0.0) - FlutterMacOS (1.0.0)
- FMDB (2.7.5): - mobile_scanner (3.5.6):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- mobile_scanner (3.5.5):
- FlutterMacOS - FlutterMacOS
- pasteboard (0.0.1): - pasteboard (0.0.1):
- FlutterMacOS - FlutterMacOS
@ -19,9 +16,9 @@ PODS:
- FlutterMacOS - FlutterMacOS
- smart_auth (0.0.1): - smart_auth (0.0.1):
- FlutterMacOS - FlutterMacOS
- sqflite (0.0.2): - sqflite (0.0.3):
- Flutter
- FlutterMacOS - FlutterMacOS
- FMDB (>= 2.7.5)
- url_launcher_macos (0.0.1): - url_launcher_macos (0.0.1):
- FlutterMacOS - FlutterMacOS
- veilid (0.0.1): - veilid (0.0.1):
@ -38,15 +35,11 @@ DEPENDENCIES:
- share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`) - share_plus (from `Flutter/ephemeral/.symlinks/plugins/share_plus/macos`)
- shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`) - shared_preferences_foundation (from `Flutter/ephemeral/.symlinks/plugins/shared_preferences_foundation/darwin`)
- smart_auth (from `Flutter/ephemeral/.symlinks/plugins/smart_auth/macos`) - 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`) - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
- veilid (from `Flutter/ephemeral/.symlinks/plugins/veilid/macos`) - veilid (from `Flutter/ephemeral/.symlinks/plugins/veilid/macos`)
- window_manager (from `Flutter/ephemeral/.symlinks/plugins/window_manager/macos`) - window_manager (from `Flutter/ephemeral/.symlinks/plugins/window_manager/macos`)
SPEC REPOS:
trunk:
- FMDB
EXTERNAL SOURCES: EXTERNAL SOURCES:
FlutterMacOS: FlutterMacOS:
:path: Flutter/ephemeral :path: Flutter/ephemeral
@ -65,7 +58,7 @@ EXTERNAL SOURCES:
smart_auth: smart_auth:
:path: Flutter/ephemeral/.symlinks/plugins/smart_auth/macos :path: Flutter/ephemeral/.symlinks/plugins/smart_auth/macos
sqflite: sqflite:
:path: Flutter/ephemeral/.symlinks/plugins/sqflite/macos :path: Flutter/ephemeral/.symlinks/plugins/sqflite/darwin
url_launcher_macos: url_launcher_macos:
:path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
veilid: veilid:
@ -75,15 +68,14 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a mobile_scanner: 54ceceae0c8da2457e26a362a6be5c61154b1829
mobile_scanner: d12930b68bf502497f78b8b5182aeccfaa1e04f6
pasteboard: 9b69dba6fedbb04866be632205d532fe2f6b1d99 pasteboard: 9b69dba6fedbb04866be632205d532fe2f6b1d99
path_provider_foundation: 29f094ae23ebbca9d3d0cec13889cd9060c0e943 path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
screen_retriever: 59634572a57080243dd1bf715e55b6c54f241a38 screen_retriever: 59634572a57080243dd1bf715e55b6c54f241a38
share_plus: 76dd39142738f7a68dd57b05093b5e8193f220f7 share_plus: 76dd39142738f7a68dd57b05093b5e8193f220f7
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126 shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
smart_auth: b38e3ab4bfe089eacb1e233aca1a2340f96c28e9 smart_auth: b38e3ab4bfe089eacb1e233aca1a2340f96c28e9
sqflite: a5789cceda41d54d23f31d6de539d65bb14100ea sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
url_launcher_macos: d2691c7dd33ed713bf3544850a623080ec693d95 url_launcher_macos: d2691c7dd33ed713bf3544850a623080ec693d95
veilid: a54f57b7bcf0e4e072fe99272d76ca126b2026d0 veilid: a54f57b7bcf0e4e072fe99272d76ca126b2026d0
window_manager: 3a1844359a6295ab1e47659b1a777e36773cd6e8 window_manager: 3a1844359a6295ab1e47659b1a777e36773cd6e8

View File

@ -0,0 +1,2 @@
@echo off
dart run build_runner build --delete-conflicting-outputs

3
packages/async_tools/build.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
set -e
dart run build_runner build --delete-conflicting-outputs

View File

@ -12,7 +12,7 @@ part of 'async_value.dart';
T _$identity<T>(T value) => value; T _$identity<T>(T value) => value;
final _privateConstructorUsedError = UnsupportedError( 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 /// @nodoc
mixin _$AsyncValue<T> { mixin _$AsyncValue<T> {

View File

@ -13,6 +13,7 @@ dependencies:
path: ../mutex path: ../mutex
dev_dependencies: dev_dependencies:
build_runner: ^2.4.8
freezed: ^2.3.5 freezed: ^2.3.5
lint_hard: ^4.0.0 lint_hard: ^4.0.0
test: ^1.24.0 test: ^1.24.0

View File

@ -100,15 +100,17 @@ extension NonceProto on veilid.Nonce {
..u5 = b.getUint32(5 * 4); ..u5 = b.getUint32(5 * 4);
return out; return out;
} }
}
static veilid.Nonce fromProto(proto.Nonce p) { extension ProtoNonce on proto.Nonce {
veilid.Nonce toVeilid() {
final b = ByteData(24) final b = ByteData(24)
..setUint32(0 * 4, p.u0) ..setUint32(0 * 4, u0)
..setUint32(1 * 4, p.u1) ..setUint32(1 * 4, u1)
..setUint32(2 * 4, p.u2) ..setUint32(2 * 4, u2)
..setUint32(3 * 4, p.u3) ..setUint32(3 * 4, u3)
..setUint32(4 * 4, p.u4) ..setUint32(4 * 4, u4)
..setUint32(5 * 4, p.u5); ..setUint32(5 * 4, u5);
return veilid.Nonce.fromBytes(Uint8List.view(b.buffer)); return veilid.Nonce.fromBytes(Uint8List.view(b.buffer));
} }
} }
@ -122,9 +124,11 @@ extension TypedKeyProto on veilid.TypedKey {
..value = value.toProto(); ..value = value.toProto();
return out; return out;
} }
}
static veilid.TypedKey fromProto(proto.TypedKey p) => extension ProtoTypedKey on proto.TypedKey {
veilid.TypedKey(kind: p.kind, value: CryptoKeyProto.fromProto(p.value)); veilid.TypedKey toVeilid() =>
veilid.TypedKey(kind: kind, value: CryptoKeyProto.fromProto(value));
} }
/// KeyPair protobuf marshaling /// KeyPair protobuf marshaling

View File

@ -228,10 +228,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: camera_platform_interface name: camera_platform_interface
sha256: e971ebca970f7cfee396f76ef02070b5e441b4aa04942da9c108d725f57bbd32 sha256: fceb2c36038b6392317b1d5790c6ba9e6ca9f1da3031181b8bea03882bf9387a
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.7.2" version: "2.7.3"
camera_web: camera_web:
dependency: transitive dependency: transitive
description: description:
@ -449,10 +449,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: flutter_animate name: flutter_animate
sha256: cabe33af6201144be052352d53572a1b8a4f5782b46080be7520d95abe763715 sha256: "7c8a6594a9252dad30cc2ef16e33270b6248c4dedc3b3d06c86c4f3f4dc05ae5"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "4.4.1" version: "4.5.0"
flutter_bloc: flutter_bloc:
dependency: "direct main" dependency: "direct main"
description: description:
@ -481,26 +481,26 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: flutter_chat_ui name: flutter_chat_ui
sha256: "6a4712026429d3b28547bd3d147ded44f8dd53dacc1ff14113693d7b7dd14382" sha256: c8580c85e2d29359ffc84147e643d08d883eb6e757208652377f0105ef58807f
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.6.10" version: "1.6.12"
flutter_form_builder: flutter_form_builder:
dependency: "direct main" dependency: "direct main"
description: description:
name: flutter_form_builder name: flutter_form_builder
sha256: e8702c52dc45b43ed42e2b5d9b35f2970096d9cf1a58015cd3a76fad62a8f183 sha256: "560eb5e367d81170c6ade1e7ae63ecc5167936ae2cdfaae8a345e91bce19d2f2"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "9.2.0" version: "9.2.1"
flutter_hooks: flutter_hooks:
dependency: "direct main" dependency: "direct main"
description: description:
name: flutter_hooks name: flutter_hooks
sha256: "09f64db63fee3b2ab8b9038a1346be7d8986977fae3fec601275bf32455ccfc0" sha256: cde36b12f7188c85286fba9b38cc5a902e7279f36dd676967106c041dc9dde70
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.20.4" version: "0.20.5"
flutter_link_previewer: flutter_link_previewer:
dependency: transitive dependency: transitive
description: description:
@ -546,6 +546,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.0.17" 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: flutter_slidable:
dependency: "direct main" dependency: "direct main"
description: description:
@ -600,10 +608,10 @@ packages:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: freezed name: freezed
sha256: "6c5031daae12c7072b3a87eff98983076434b4889ef2a44384d0cae3f82372ba" sha256: "57247f692f35f068cae297549a46a9a097100685c6780fe67177503eea5ed4e5"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.4.6" version: "2.4.7"
freezed_annotation: freezed_annotation:
dependency: "direct main" dependency: "direct main"
description: description:
@ -640,10 +648,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: go_router name: go_router
sha256: "2ccd74480706e0a70a0e0dfa9543dede41bc11d0fe3b146a6ad7b7686f6b4407" sha256: "170c46e237d6eb0e6e9f0e8b3f56101e14fb64f787016e42edd74c39cf8b176a"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "11.1.4" version: "13.2.0"
graphs: graphs:
dependency: transitive dependency: transitive
description: description:
@ -712,10 +720,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: image name: image
sha256: "004a2e90ce080f8627b5a04aecb4cdfac87d2c3f3b520aa291260be5a32c033d" sha256: "4c68bfd5ae83e700b5204c1e74451e7bf3cf750e6843c6e158289cf56bda018e"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "4.1.4" version: "4.1.7"
intl: intl:
dependency: "direct main" dependency: "direct main"
description: description:
@ -824,10 +832,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: mobile_scanner name: mobile_scanner
sha256: "1b60b8f9d4ce0cb0e7d7bc223c955d083a0737bee66fa1fcfe5de48225e0d5b3" sha256: "619ed5fd43ca9007a151f00c3dc43feedeaf235fe5647735d0237c38849d49dc"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.5.7" version: "4.0.0"
motion_toast: motion_toast:
dependency: "direct main" dependency: "direct main"
description: description:
@ -959,10 +967,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: pinput name: pinput
sha256: a92b55ecf9c25d1b9e100af45905385d5bc34fc9b6b04177a9e82cb88fe4d805 sha256: "6d571e38a484f7515a52e89024ef416f11fa6171ac6f32303701374ab9890efa"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.1" version: "4.0.0"
platform: platform:
dependency: transitive dependency: transitive
description: description:
@ -1055,10 +1063,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: qr_code_dart_scan name: qr_code_dart_scan
sha256: ab40c5e8cf09e723fdd1c24ee23ae7187e44d958cc4b1554b4cd094845ae6989 sha256: ddf409177eeef07f7bdf4e4929858b3acf139873da273315789ebc97bd17bec8
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "0.7.3" version: "0.7.4"
qr_flutter: qr_flutter:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1236,10 +1244,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: smart_auth name: smart_auth
sha256: a25229b38c02f733d0a4e98d941b42bed91a976cb589e934895e60ccfa674cf6 sha256: "88aa8fe66e951c78a307f26d1c29672dce2e9eb3da2e12e853864d0e615a73ad"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.1" version: "2.0.0"
source_gen: source_gen:
dependency: transitive dependency: transitive
description: description:
@ -1272,6 +1280,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.2.1" version: "3.2.1"
sprintf:
dependency: transitive
description:
name: sprintf
sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23"
url: "https://pub.dev"
source: hosted
version: "7.0.0"
sqflite: sqflite:
dependency: transitive dependency: transitive
description: description:
@ -1468,34 +1484,34 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: uuid name: uuid
sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" sha256: cd210a09f7c18cbe5a02511718e0334de6559871052c90a90c0cca46a4aa81c8
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.7" version: "4.3.3"
vector_graphics: vector_graphics:
dependency: transitive dependency: transitive
description: description:
name: vector_graphics name: vector_graphics
sha256: "18f6690295af52d081f6808f2f7c69f0eed6d7e23a71539d75f4aeb8f0062172" sha256: "4ac59808bbfca6da38c99f415ff2d3a5d7ca0a6b4809c71d9cf30fba5daf9752"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.9+2" version: "1.1.10+1"
vector_graphics_codec: vector_graphics_codec:
dependency: transitive dependency: transitive
description: description:
name: vector_graphics_codec name: vector_graphics_codec
sha256: "531d20465c10dfac7f5cd90b60bbe4dd9921f1ec4ca54c83ebb176dbacb7bb2d" sha256: f3247e7ab0ec77dc759263e68394990edc608fb2b480b80db8aa86ed09279e33
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.9+2" version: "1.1.10+1"
vector_graphics_compiler: vector_graphics_compiler:
dependency: transitive dependency: transitive
description: description:
name: vector_graphics_compiler name: vector_graphics_compiler
sha256: "03012b0a33775c5530576b70240308080e1d5050f0faf000118c20e6463bc0ad" sha256: "18489bdd8850de3dd7ca8a34e0c446f719ec63e2bab2e7a8cc66a9028dd76c5a"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.9+2" version: "1.1.10+1"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:

View File

@ -29,12 +29,12 @@ dependencies:
fixnum: ^1.1.0 fixnum: ^1.1.0
flutter: flutter:
sdk: flutter sdk: flutter
flutter_animate: ^4.4.1 flutter_animate: ^4.5.0
flutter_bloc: ^8.1.3 flutter_bloc: ^8.1.3
flutter_chat_types: ^3.6.2 flutter_chat_types: ^3.6.2
flutter_chat_ui: ^1.6.10 flutter_chat_ui: ^1.6.12
flutter_form_builder: ^9.2.0 flutter_form_builder: ^9.2.1
flutter_hooks: ^0.20.4 flutter_hooks: ^0.20.5
flutter_localizations: flutter_localizations:
sdk: flutter sdk: flutter
flutter_native_splash: ^2.3.10 flutter_native_splash: ^2.3.10
@ -44,25 +44,25 @@ dependencies:
flutter_translate: ^4.0.4 flutter_translate: ^4.0.4
form_builder_validators: ^9.1.0 form_builder_validators: ^9.1.0
freezed_annotation: ^2.4.1 freezed_annotation: ^2.4.1
go_router: ^11.1.4 go_router: ^13.2.0
hydrated_bloc: ^9.1.3 hydrated_bloc: ^9.1.3
image: ^4.1.4 image: ^4.1.7
intl: ^0.18.1 intl: ^0.18.1
json_annotation: ^4.8.1 json_annotation: ^4.8.1
loggy: ^2.0.3 loggy: ^2.0.3
meta: ^1.10.0 meta: ^1.10.0
mobile_scanner: ^3.5.7 mobile_scanner: ^4.0.0
motion_toast: ^2.8.0 motion_toast: ^2.8.0
mutex: mutex:
path: packages/mutex path: packages/mutex
pasteboard: ^0.2.0 pasteboard: ^0.2.0
path: ^1.8.3 path: ^1.8.3
path_provider: ^2.1.2 path_provider: ^2.1.2
pinput: ^3.0.1 pinput: ^4.0.0
preload_page_view: ^0.2.0 preload_page_view: ^0.2.0
protobuf: ^3.1.0 protobuf: ^3.1.0
provider: ^6.1.1 provider: ^6.1.1
qr_code_dart_scan: ^0.7.3 qr_code_dart_scan: ^0.7.4
qr_flutter: ^4.1.0 qr_flutter: ^4.1.0
quickalert: ^1.0.2 quickalert: ^1.0.2
radix_colors: ^1.0.4 radix_colors: ^1.0.4
@ -75,7 +75,7 @@ dependencies:
stack_trace: ^1.11.1 stack_trace: ^1.11.1
stream_transform: ^2.1.0 stream_transform: ^2.1.0
stylish_bottom_bar: ^1.0.3 stylish_bottom_bar: ^1.0.3
uuid: ^3.0.7 uuid: ^4.3.3
veilid: veilid:
# veilid: ^0.0.1 # veilid: ^0.0.1
path: ../veilid/veilid-flutter path: ../veilid/veilid-flutter
@ -89,7 +89,7 @@ dev_dependencies:
build_runner: ^2.4.8 build_runner: ^2.4.8
flutter_test: flutter_test:
sdk: flutter sdk: flutter
freezed: ^2.4.6 freezed: ^2.4.7
icons_launcher: ^2.1.7 icons_launcher: ^2.1.7
json_serializable: ^6.7.1 json_serializable: ^6.7.1
lint_hard: ^4.0.0 lint_hard: ^4.0.0