From c516323e7dae73bff2324dd85c2cd2ec8ad28b2d Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Wed, 27 Dec 2023 22:56:24 -0500 Subject: [PATCH] refactor some more --- build.sh | 4 +- lib/account_manager/account_manager.dart | 3 + .../active_user_login_cubit.dart | 6 +- .../active_user_login_state.dart | 0 .../cubit/cubit.dart} | 2 +- .../local_accounts_cubit.dart | 4 +- .../local_accounts_state.dart | 0 .../user_logins_cubit/user_logins_cubit.dart | 4 +- .../user_logins_cubit/user_logins_state.dart | 0 .../account_repository.dart | 62 +- .../account_repository/active_logins.dart | 2 +- .../active_logins.freezed.dart | 0 .../account_repository/active_logins.g.dart | 0 .../encryption_key_type.dart | 43 +- .../account_repository/local_account.dart | 2 +- .../local_account.freezed.dart | 0 .../account_repository/local_account.g.dart | 0 .../account_repository/new_profile_spec.dart | 5 + .../account_repository/user_login.dart | 2 +- .../user_login.freezed.dart | 0 .../account_repository/user_login.g.dart | 0 .../repository/repository.dart | 1 + .../new_account_page/new_account_page.dart} | 53 +- lib/account_manager/view/view.dart | 1 + lib/app.dart | 60 +- lib/init.dart | 12 +- lib/main.dart | 6 +- .../components/signal_strength_meter.dart | 8 +- .../entities/preferences.g.dart | 53 -- lib/old_to_refactor/pages/developer.dart | 2 +- lib/old_to_refactor/pages/home.dart | 2 +- .../pages/main_pager/account.dart | 2 +- .../pages/main_pager/chats.dart | 2 +- .../pages/main_pager/main_pager.dart | 2 +- lib/old_to_refactor/providers/account.dart | 2 +- lib/old_to_refactor/providers/chat.dart | 2 +- .../providers/connection_state.dart | 2 +- .../providers/connection_state.freezed.dart | 28 +- lib/old_to_refactor/providers/contact.dart | 2 +- .../contact_invitation_list_manager.dart | 6 +- .../providers/contact_invite.dart | 2 +- .../providers/conversation.dart | 2 +- .../providers/window_control.dart | 83 -- lib/processor.dart | 15 +- lib/proto/proto.dart | 4 +- lib/router/cubit/router_cubit.dart | 4 +- lib/router/cubit/router_cubit.freezed.dart | 193 ----- lib/router/cubit/router_cubit.g.dart | 21 - lib/theme/theme_service.dart | 108 --- lib/tick.dart | 4 +- lib/tools/async_table_db_backed_cubit.dart | 2 +- lib/tools/loggy.dart | 2 +- lib/tools/secret_crypto.dart | 46 -- lib/tools/tools.dart | 2 +- lib/tools/window_control.dart | 65 ++ packages/veilid_support/.gitignore | 56 ++ packages/veilid_support/analysis_options.yaml | 15 + packages/veilid_support/build.bat | 7 + packages/veilid_support/build.sh | 8 + .../lib}/dht_support/dht_support.dart | 0 .../lib}/dht_support/proto/dht.proto | 0 .../lib}/dht_support/proto/proto.dart | 10 +- .../lib}/dht_support/src/dht_record.dart | 2 +- .../dht_support/src/dht_record_crypto.dart | 2 +- .../lib}/dht_support/src/dht_record_pool.dart | 2 +- .../src/dht_record_pool.freezed.dart | 0 .../dht_support/src/dht_record_pool.g.dart | 24 +- .../lib}/dht_support/src/dht_short_array.dart | 2 +- .../veilid_support/lib}/proto/dht.pb.dart | 0 .../veilid_support/lib}/proto/dht.pbenum.dart | 0 .../veilid_support/lib}/proto/dht.pbjson.dart | 0 .../lib}/proto/dht.pbserver.dart | 0 .../veilid_support/lib}/proto/proto.dart | 40 +- .../veilid_support/lib}/proto/veilid.pb.dart | 0 .../lib}/proto/veilid.pbenum.dart | 0 .../lib}/proto/veilid.pbjson.dart | 0 .../lib}/proto/veilid.pbserver.dart | 0 .../veilid_support/lib}/proto/veilid.proto | 0 .../veilid_support/lib}/src/config.dart | 10 +- .../veilid_support/lib}/src/identity.dart | 3 +- .../lib}/src/identity.freezed.dart | 0 .../veilid_support/lib}/src/identity.g.dart | 34 +- .../veilid_support/lib}/src/json_tools.dart | 0 .../lib}/src/protobuf_tools.dart | 0 .../veilid_support/lib}/src/table_db.dart | 0 .../veilid_support/lib}/src/veilid_log.dart | 5 +- .../veilid_support/lib}/veilid_support.dart | 0 packages/veilid_support/pubspec.lock | 780 ++++++++++++++++++ packages/veilid_support/pubspec.yaml | 26 + pubspec.lock | 19 +- pubspec.yaml | 2 + 91 files changed, 1237 insertions(+), 748 deletions(-) create mode 100644 lib/account_manager/account_manager.dart rename lib/{local_account_manager => account_manager/cubit}/active_user_login_cubit/active_user_login_cubit.dart (84%) rename lib/{local_account_manager => account_manager/cubit}/active_user_login_cubit/active_user_login_state.dart (100%) rename lib/{local_account_manager/local_account_manager.dart => account_manager/cubit/cubit.dart} (63%) rename lib/{local_account_manager => account_manager/cubit}/local_accounts_cubit/local_accounts_cubit.dart (89%) rename lib/{local_account_manager => account_manager/cubit}/local_accounts_cubit/local_accounts_state.dart (100%) rename lib/{local_account_manager => account_manager/cubit}/user_logins_cubit/user_logins_cubit.dart (89%) rename lib/{local_account_manager => account_manager/cubit}/user_logins_cubit/user_logins_state.dart (100%) rename lib/{local_account_manager => account_manager/repository}/account_repository/account_repository.dart (86%) rename lib/{local_account_manager => account_manager/repository}/account_repository/active_logins.dart (93%) rename lib/{local_account_manager => account_manager/repository}/account_repository/active_logins.freezed.dart (100%) rename lib/{local_account_manager => account_manager/repository}/account_repository/active_logins.g.dart (100%) rename lib/{local_account_manager => account_manager/repository}/account_repository/encryption_key_type.dart (52%) rename lib/{local_account_manager => account_manager/repository}/account_repository/local_account.dart (96%) rename lib/{local_account_manager => account_manager/repository}/account_repository/local_account.freezed.dart (100%) rename lib/{local_account_manager => account_manager/repository}/account_repository/local_account.g.dart (100%) create mode 100644 lib/account_manager/repository/account_repository/new_profile_spec.dart rename lib/{local_account_manager => account_manager/repository}/account_repository/user_login.dart (94%) rename lib/{local_account_manager => account_manager/repository}/account_repository/user_login.freezed.dart (100%) rename lib/{local_account_manager => account_manager/repository}/account_repository/user_login.g.dart (100%) create mode 100644 lib/account_manager/repository/repository.dart rename lib/{old_to_refactor/pages/new_account.dart => account_manager/view/new_account_page/new_account_page.dart} (70%) create mode 100644 lib/account_manager/view/view.dart delete mode 100644 lib/old_to_refactor/entities/preferences.g.dart delete mode 100644 lib/old_to_refactor/providers/window_control.dart delete mode 100644 lib/router/cubit/router_cubit.freezed.dart delete mode 100644 lib/router/cubit/router_cubit.g.dart delete mode 100644 lib/theme/theme_service.dart delete mode 100644 lib/tools/secret_crypto.dart create mode 100644 lib/tools/window_control.dart create mode 100644 packages/veilid_support/.gitignore create mode 100644 packages/veilid_support/analysis_options.yaml create mode 100644 packages/veilid_support/build.bat create mode 100755 packages/veilid_support/build.sh rename {lib/veilid_support => packages/veilid_support/lib}/dht_support/dht_support.dart (100%) rename {lib/veilid_support => packages/veilid_support/lib}/dht_support/proto/dht.proto (100%) rename {lib/veilid_support => packages/veilid_support/lib}/dht_support/proto/proto.dart (75%) rename {lib/veilid_support => packages/veilid_support/lib}/dht_support/src/dht_record.dart (99%) rename {lib/veilid_support => packages/veilid_support/lib}/dht_support/src/dht_record_crypto.dart (97%) rename {lib/veilid_support => packages/veilid_support/lib}/dht_support/src/dht_record_pool.dart (99%) rename {lib/veilid_support => packages/veilid_support/lib}/dht_support/src/dht_record_pool.freezed.dart (100%) rename {lib/veilid_support => packages/veilid_support/lib}/dht_support/src/dht_record_pool.g.dart (75%) rename {lib/veilid_support => packages/veilid_support/lib}/dht_support/src/dht_short_array.dart (99%) rename {lib => packages/veilid_support/lib}/proto/dht.pb.dart (100%) rename {lib => packages/veilid_support/lib}/proto/dht.pbenum.dart (100%) rename {lib => packages/veilid_support/lib}/proto/dht.pbjson.dart (100%) rename {lib => packages/veilid_support/lib}/proto/dht.pbserver.dart (100%) rename {lib/veilid_support => packages/veilid_support/lib}/proto/proto.dart (75%) rename {lib => packages/veilid_support/lib}/proto/veilid.pb.dart (100%) rename {lib => packages/veilid_support/lib}/proto/veilid.pbenum.dart (100%) rename {lib => packages/veilid_support/lib}/proto/veilid.pbjson.dart (100%) rename {lib => packages/veilid_support/lib}/proto/veilid.pbserver.dart (100%) rename {lib/veilid_support => packages/veilid_support/lib}/proto/veilid.proto (100%) rename {lib/veilid_support => packages/veilid_support/lib}/src/config.dart (93%) rename {lib/veilid_support => packages/veilid_support/lib}/src/identity.dart (99%) rename {lib/veilid_support => packages/veilid_support/lib}/src/identity.freezed.dart (100%) rename {lib/veilid_support => packages/veilid_support/lib}/src/identity.g.dart (62%) rename {lib/veilid_support => packages/veilid_support/lib}/src/json_tools.dart (100%) rename {lib/veilid_support => packages/veilid_support/lib}/src/protobuf_tools.dart (100%) rename {lib/veilid_support => packages/veilid_support/lib}/src/table_db.dart (100%) rename {lib/veilid_support => packages/veilid_support/lib}/src/veilid_log.dart (94%) rename {lib/veilid_support => packages/veilid_support/lib}/veilid_support.dart (100%) create mode 100644 packages/veilid_support/pubspec.lock create mode 100644 packages/veilid_support/pubspec.yaml diff --git a/build.sh b/build.sh index 96cce52..1a6cdf5 100755 --- a/build.sh +++ b/build.sh @@ -3,7 +3,5 @@ set -e dart run build_runner build --delete-conflicting-outputs pushd lib > /dev/null -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 veilid.proto +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 diff --git a/lib/account_manager/account_manager.dart b/lib/account_manager/account_manager.dart new file mode 100644 index 0000000..d04e6f0 --- /dev/null +++ b/lib/account_manager/account_manager.dart @@ -0,0 +1,3 @@ +export 'cubit/cubit.dart'; +export 'repository/repository.dart'; +export 'view/view.dart'; diff --git a/lib/local_account_manager/active_user_login_cubit/active_user_login_cubit.dart b/lib/account_manager/cubit/active_user_login_cubit/active_user_login_cubit.dart similarity index 84% rename from lib/local_account_manager/active_user_login_cubit/active_user_login_cubit.dart rename to lib/account_manager/cubit/active_user_login_cubit/active_user_login_cubit.dart index b8d4dcf..ec0aaf5 100644 --- a/lib/local_account_manager/active_user_login_cubit/active_user_login_cubit.dart +++ b/lib/account_manager/cubit/active_user_login_cubit/active_user_login_cubit.dart @@ -1,14 +1,14 @@ import 'dart:async'; import 'package:bloc/bloc.dart'; +import 'package:veilid_support/veilid_support.dart'; -import '../../veilid_support/veilid_support.dart'; -import '../account_repository/account_repository.dart'; +import '../../repository/account_repository/account_repository.dart'; part 'active_user_login_state.dart'; class ActiveUserLoginCubit extends Cubit { - ActiveUserLoginCubit({required AccountRepository accountRepository}) + ActiveUserLoginCubit(AccountRepository accountRepository) : _accountRepository = accountRepository, super(null) { // Subscribe to streams diff --git a/lib/local_account_manager/active_user_login_cubit/active_user_login_state.dart b/lib/account_manager/cubit/active_user_login_cubit/active_user_login_state.dart similarity index 100% rename from lib/local_account_manager/active_user_login_cubit/active_user_login_state.dart rename to lib/account_manager/cubit/active_user_login_cubit/active_user_login_state.dart diff --git a/lib/local_account_manager/local_account_manager.dart b/lib/account_manager/cubit/cubit.dart similarity index 63% rename from lib/local_account_manager/local_account_manager.dart rename to lib/account_manager/cubit/cubit.dart index 2b0a87f..0f56c84 100644 --- a/lib/local_account_manager/local_account_manager.dart +++ b/lib/account_manager/cubit/cubit.dart @@ -1,3 +1,3 @@ -export 'account_repository/account_repository.dart'; +export 'active_user_login_cubit/active_user_login_cubit.dart'; export 'local_accounts_cubit/local_accounts_cubit.dart'; export 'user_logins_cubit/user_logins_cubit.dart'; diff --git a/lib/local_account_manager/local_accounts_cubit/local_accounts_cubit.dart b/lib/account_manager/cubit/local_accounts_cubit/local_accounts_cubit.dart similarity index 89% rename from lib/local_account_manager/local_accounts_cubit/local_accounts_cubit.dart rename to lib/account_manager/cubit/local_accounts_cubit/local_accounts_cubit.dart index aa54d6c..34fdccb 100644 --- a/lib/local_account_manager/local_accounts_cubit/local_accounts_cubit.dart +++ b/lib/account_manager/cubit/local_accounts_cubit/local_accounts_cubit.dart @@ -3,12 +3,12 @@ import 'dart:async'; import 'package:bloc/bloc.dart'; import 'package:fast_immutable_collections/fast_immutable_collections.dart'; -import '../account_repository/account_repository.dart'; +import '../../repository/account_repository/account_repository.dart'; part 'local_accounts_state.dart'; class LocalAccountsCubit extends Cubit { - LocalAccountsCubit({required AccountRepository accountRepository}) + LocalAccountsCubit(AccountRepository accountRepository) : _accountRepository = accountRepository, super(LocalAccountsState()) { // Subscribe to streams diff --git a/lib/local_account_manager/local_accounts_cubit/local_accounts_state.dart b/lib/account_manager/cubit/local_accounts_cubit/local_accounts_state.dart similarity index 100% rename from lib/local_account_manager/local_accounts_cubit/local_accounts_state.dart rename to lib/account_manager/cubit/local_accounts_cubit/local_accounts_state.dart diff --git a/lib/local_account_manager/user_logins_cubit/user_logins_cubit.dart b/lib/account_manager/cubit/user_logins_cubit/user_logins_cubit.dart similarity index 89% rename from lib/local_account_manager/user_logins_cubit/user_logins_cubit.dart rename to lib/account_manager/cubit/user_logins_cubit/user_logins_cubit.dart index e8d9bef..e6ad92a 100644 --- a/lib/local_account_manager/user_logins_cubit/user_logins_cubit.dart +++ b/lib/account_manager/cubit/user_logins_cubit/user_logins_cubit.dart @@ -3,12 +3,12 @@ import 'dart:async'; import 'package:bloc/bloc.dart'; import 'package:fast_immutable_collections/fast_immutable_collections.dart'; -import '../account_repository/account_repository.dart'; +import '../../repository/account_repository/account_repository.dart'; part 'user_logins_state.dart'; class UserLoginsCubit extends Cubit { - UserLoginsCubit({required AccountRepository accountRepository}) + UserLoginsCubit(AccountRepository accountRepository) : _accountRepository = accountRepository, super(UserLoginsState()) { // Subscribe to streams diff --git a/lib/local_account_manager/user_logins_cubit/user_logins_state.dart b/lib/account_manager/cubit/user_logins_cubit/user_logins_state.dart similarity index 100% rename from lib/local_account_manager/user_logins_cubit/user_logins_state.dart rename to lib/account_manager/cubit/user_logins_cubit/user_logins_state.dart diff --git a/lib/local_account_manager/account_repository/account_repository.dart b/lib/account_manager/repository/account_repository/account_repository.dart similarity index 86% rename from lib/local_account_manager/account_repository/account_repository.dart rename to lib/account_manager/repository/account_repository/account_repository.dart index 04be9e5..0e42a55 100644 --- a/lib/local_account_manager/account_repository/account_repository.dart +++ b/lib/account_manager/repository/account_repository/account_repository.dart @@ -1,11 +1,11 @@ import 'package:fast_immutable_collections/fast_immutable_collections.dart'; +import 'package:veilid_support/veilid_support.dart'; -import '../../../proto/proto.dart' as proto; -import '../../tools/tools.dart'; -import '../../veilid_support/veilid_support.dart'; +import '../../../../proto/proto.dart' as proto; import 'active_logins.dart'; import 'encryption_key_type.dart'; import 'local_account.dart'; +import 'new_profile_spec.dart'; import 'user_login.dart'; export 'active_logins.dart'; @@ -45,15 +45,7 @@ class AccountRepository { ////////////////////////////////////////////////////////////// /// Singleton initialization - static AccountRepository? _instance; - static Future get instance async { - if (_instance == null) { - final accountRepository = AccountRepository._(); - await accountRepository.init(); - _instance = accountRepository; - } - return _instance!; - } + static AccountRepository instance = AccountRepository._(); Future init() async { await _localAccounts.load(); @@ -104,13 +96,33 @@ class AccountRepository { await _localAccounts.set(updated); } + /// Creates a new master identity, an account associated with the master + /// identity, stores the account in the identity key and then logs into + /// that account with no password set at this time + Future createMasterIdentity(NewProfileSpec newProfileSpec) async { + final imws = await IdentityMasterWithSecrets.create(); + try { + final localAccount = await _newLocalAccount( + identityMaster: imws.identityMaster, + identitySecret: imws.identitySecret, + newProfileSpec: newProfileSpec); + + // Log in the new account by default with no pin + final ok = await login(localAccount.identityMaster.masterRecordKey, + EncryptionKeyType.none, ''); + assert(ok, 'login with none should never fail'); + } on Exception catch (_) { + await imws.delete(); + rethrow; + } + } + /// Creates a new Account associated with master identity /// Adds a logged-out LocalAccount to track its existence on this device - Future newLocalAccount( + Future _newLocalAccount( {required IdentityMaster identityMaster, required SecretKey identitySecret, - required String name, - required String pronouns, + required NewProfileSpec newProfileSpec, EncryptionKeyType encryptionKeyType = EncryptionKeyType.none, String encryptionKey = ''}) async { final localAccounts = await _localAccounts.get(); @@ -136,8 +148,8 @@ class AccountRepository { // Make account object final account = proto.Account() ..profile = (proto.Profile() - ..name = name - ..pronouns = pronouns) + ..name = newProfileSpec.name + ..pronouns = newProfileSpec.pronouns) ..contactList = contactList.toProto() ..contactInvitationRecords = contactInvitationRecords.toProto() ..chatList = chatRecords.toProto(); @@ -145,11 +157,11 @@ class AccountRepository { }); // Encrypt identitySecret with key - final identitySecretBytes = await encryptSecretToBytes( - secret: identitySecret, - cryptoKind: identityMaster.identityRecordKey.kind, - encryptionKey: encryptionKey, - encryptionKeyType: encryptionKeyType); + final identitySecretBytes = await encryptionKeyType.encryptSecretToBytes( + secret: identitySecret, + cryptoKind: identityMaster.identityRecordKey.kind, + encryptionKey: encryptionKey, + ); // Create local account object // Does not contain the account key or its secret @@ -161,7 +173,7 @@ class AccountRepository { encryptionKeyType: encryptionKeyType, biometricsEnabled: false, hiddenAccount: false, - name: name, + name: newProfileSpec.name, ); // Add local account object to internal store @@ -257,10 +269,10 @@ class AccountRepository { throw Exception('Wrong authentication type'); } - final identitySecret = await decryptSecretFromBytes( + final identitySecret = + await localAccount.encryptionKeyType.decryptSecretFromBytes( secretBytes: localAccount.identitySecretBytes, cryptoKind: localAccount.identityMaster.identityRecordKey.kind, - encryptionKeyType: localAccount.encryptionKeyType, encryptionKey: encryptionKey, ); diff --git a/lib/local_account_manager/account_repository/active_logins.dart b/lib/account_manager/repository/account_repository/active_logins.dart similarity index 93% rename from lib/local_account_manager/account_repository/active_logins.dart rename to lib/account_manager/repository/account_repository/active_logins.dart index fd83e37..2fab41f 100644 --- a/lib/local_account_manager/account_repository/active_logins.dart +++ b/lib/account_manager/repository/account_repository/active_logins.dart @@ -1,8 +1,8 @@ // Represents a set of user logins and the currently selected account import 'package:fast_immutable_collections/fast_immutable_collections.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:veilid_support/veilid_support.dart'; -import '../../veilid_support/veilid_support.dart'; import 'user_login.dart'; part 'active_logins.g.dart'; diff --git a/lib/local_account_manager/account_repository/active_logins.freezed.dart b/lib/account_manager/repository/account_repository/active_logins.freezed.dart similarity index 100% rename from lib/local_account_manager/account_repository/active_logins.freezed.dart rename to lib/account_manager/repository/account_repository/active_logins.freezed.dart diff --git a/lib/local_account_manager/account_repository/active_logins.g.dart b/lib/account_manager/repository/account_repository/active_logins.g.dart similarity index 100% rename from lib/local_account_manager/account_repository/active_logins.g.dart rename to lib/account_manager/repository/account_repository/active_logins.g.dart diff --git a/lib/local_account_manager/account_repository/encryption_key_type.dart b/lib/account_manager/repository/account_repository/encryption_key_type.dart similarity index 52% rename from lib/local_account_manager/account_repository/encryption_key_type.dart rename to lib/account_manager/repository/account_repository/encryption_key_type.dart index 45fd682..2c00f27 100644 --- a/lib/local_account_manager/account_repository/encryption_key_type.dart +++ b/lib/account_manager/repository/account_repository/encryption_key_type.dart @@ -4,9 +4,12 @@ // * Pin : Code is a numeric pin (4-256 numeric digits) hashed with Argon2 // * Password: Code is a UTF-8 string that is hashed with Argon2 -import 'package:change_case/change_case.dart'; +import 'dart:typed_data'; -import '../../../proto/proto.dart' as proto; +import 'package:change_case/change_case.dart'; +import 'package:veilid_support/veilid_support.dart'; + +import '../../../../proto/proto.dart' as proto; enum EncryptionKeyType { none, @@ -37,4 +40,40 @@ enum EncryptionKeyType { EncryptionKeyType.password => proto.EncryptionKeyType.ENCRYPTION_KEY_TYPE_PASSWORD, }; + + Future encryptSecretToBytes( + {required SecretKey secret, + required CryptoKind cryptoKind, + String encryptionKey = ''}) async { + late final Uint8List secretBytes; + switch (this) { + case EncryptionKeyType.none: + secretBytes = secret.decode(); + case EncryptionKeyType.pin: + case EncryptionKeyType.password: + final cs = await Veilid.instance.getCryptoSystem(cryptoKind); + + secretBytes = + await cs.encryptAeadWithPassword(secret.decode(), encryptionKey); + } + return secretBytes; + } + + Future decryptSecretFromBytes( + {required Uint8List secretBytes, + required CryptoKind cryptoKind, + String encryptionKey = ''}) async { + late final SecretKey secret; + switch (this) { + case EncryptionKeyType.none: + secret = SecretKey.fromBytes(secretBytes); + case EncryptionKeyType.pin: + case EncryptionKeyType.password: + final cs = await Veilid.instance.getCryptoSystem(cryptoKind); + + secret = SecretKey.fromBytes( + await cs.decryptAeadWithPassword(secretBytes, encryptionKey)); + } + return secret; + } } diff --git a/lib/local_account_manager/account_repository/local_account.dart b/lib/account_manager/repository/account_repository/local_account.dart similarity index 96% rename from lib/local_account_manager/account_repository/local_account.dart rename to lib/account_manager/repository/account_repository/local_account.dart index 6aa2c4a..eaf0fa8 100644 --- a/lib/local_account_manager/account_repository/local_account.dart +++ b/lib/account_manager/repository/account_repository/local_account.dart @@ -1,8 +1,8 @@ import 'dart:typed_data'; import 'package:freezed_annotation/freezed_annotation.dart'; +import 'package:veilid_support/veilid_support.dart'; -import '../../veilid_support/veilid_support.dart'; import 'encryption_key_type.dart'; part 'local_account.g.dart'; diff --git a/lib/local_account_manager/account_repository/local_account.freezed.dart b/lib/account_manager/repository/account_repository/local_account.freezed.dart similarity index 100% rename from lib/local_account_manager/account_repository/local_account.freezed.dart rename to lib/account_manager/repository/account_repository/local_account.freezed.dart diff --git a/lib/local_account_manager/account_repository/local_account.g.dart b/lib/account_manager/repository/account_repository/local_account.g.dart similarity index 100% rename from lib/local_account_manager/account_repository/local_account.g.dart rename to lib/account_manager/repository/account_repository/local_account.g.dart diff --git a/lib/account_manager/repository/account_repository/new_profile_spec.dart b/lib/account_manager/repository/account_repository/new_profile_spec.dart new file mode 100644 index 0000000..173a382 --- /dev/null +++ b/lib/account_manager/repository/account_repository/new_profile_spec.dart @@ -0,0 +1,5 @@ +class NewProfileSpec { + NewProfileSpec({required this.name, required this.pronouns}); + String name; + String pronouns; +} diff --git a/lib/local_account_manager/account_repository/user_login.dart b/lib/account_manager/repository/account_repository/user_login.dart similarity index 94% rename from lib/local_account_manager/account_repository/user_login.dart rename to lib/account_manager/repository/account_repository/user_login.dart index 2708ce4..4e23184 100644 --- a/lib/local_account_manager/account_repository/user_login.dart +++ b/lib/account_manager/repository/account_repository/user_login.dart @@ -1,6 +1,6 @@ import 'package:freezed_annotation/freezed_annotation.dart'; -import '../../veilid_support/veilid_support.dart'; +import 'package:veilid_support/veilid_support.dart'; part 'user_login.freezed.dart'; part 'user_login.g.dart'; diff --git a/lib/local_account_manager/account_repository/user_login.freezed.dart b/lib/account_manager/repository/account_repository/user_login.freezed.dart similarity index 100% rename from lib/local_account_manager/account_repository/user_login.freezed.dart rename to lib/account_manager/repository/account_repository/user_login.freezed.dart diff --git a/lib/local_account_manager/account_repository/user_login.g.dart b/lib/account_manager/repository/account_repository/user_login.g.dart similarity index 100% rename from lib/local_account_manager/account_repository/user_login.g.dart rename to lib/account_manager/repository/account_repository/user_login.g.dart diff --git a/lib/account_manager/repository/repository.dart b/lib/account_manager/repository/repository.dart new file mode 100644 index 0000000..9d1b9fe --- /dev/null +++ b/lib/account_manager/repository/repository.dart @@ -0,0 +1 @@ +export 'account_repository/account_repository.dart'; diff --git a/lib/old_to_refactor/pages/new_account.dart b/lib/account_manager/view/new_account_page/new_account_page.dart similarity index 70% rename from lib/old_to_refactor/pages/new_account.dart rename to lib/account_manager/view/new_account_page/new_account_page.dart index 18d3963..acf3f8d 100644 --- a/lib/old_to_refactor/pages/new_account.dart +++ b/lib/account_manager/view/new_account_page/new_account_page.dart @@ -2,19 +2,15 @@ import 'package:awesome_extensions/awesome_extensions.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter_form_builder/flutter_form_builder.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_translate/flutter_translate.dart'; import 'package:form_builder_validators/form_builder_validators.dart'; import 'package:go_router/go_router.dart'; +import 'package:veilid_support/veilid_support.dart'; -import '../../components/default_app_bar.dart'; -import '../../components/signal_strength_meter.dart'; -import '../../entities/entities.dart'; -import '../../local_accounts/local_accounts.dart'; -import '../providers/logins.dart'; -import '../providers/window_control.dart'; -import '../../tools/tools.dart'; -import '../../veilid_support/veilid_support.dart'; +import '../../../components/default_app_bar.dart'; +import '../../../components/signal_strength_meter.dart'; +import '../../../entities/entities.dart'; +import '../../../tools/tools.dart'; class NewAccountPage extends StatefulWidget { const NewAccountPage({super.key}); @@ -23,7 +19,7 @@ class NewAccountPage extends StatefulWidget { NewAccountPageState createState() => NewAccountPageState(); } -class NewAccountPageState extends ConsumerState { +class NewAccountPageState extends State { final _formKey = GlobalKey(); late bool isInAsyncCall = false; static const String formFieldName = 'name'; @@ -35,41 +31,11 @@ class NewAccountPageState extends ConsumerState { WidgetsBinding.instance.addPostFrameCallback((_) async { setState(() {}); - await ref.read(windowControlProvider.notifier).changeWindowSetup( + await changeWindowSetup( TitleBarStyle.normal, OrientationCapability.portraitOnly); }); } - /// Creates a new master identity, an account associated with the master - /// identity, stores the account in the identity key and then logs into - /// that account with no password set at this time - Future createAccount() async { - final localAccounts = ref.read(localAccountsProvider.notifier); - final logins = ref.read(loginsProvider.notifier); - - final name = _formKey.currentState!.fields[formFieldName]!.value as String; - final pronouns = - _formKey.currentState!.fields[formFieldPronouns]!.value as String? ?? - ''; - - final imws = await IdentityMasterWithSecrets.create(); - try { - final localAccount = await localAccounts.newLocalAccount( - identityMaster: imws.identityMaster, - identitySecret: imws.identitySecret, - name: name, - pronouns: pronouns); - - // Log in the new account by default with no pin - final ok = await logins.login(localAccount.identityMaster.masterRecordKey, - EncryptionKeyType.none, ''); - assert(ok, 'login with none should never fail'); - } on Exception catch (_) { - await imws.delete(); - rethrow; - } - } - Widget _newAccountForm(BuildContext context, {required Future Function(GlobalKey) onSubmit}) => @@ -129,11 +95,6 @@ class NewAccountPageState extends ConsumerState { @override Widget build(BuildContext context) { - ref.watch(windowControlProvider); - - final localAccounts = ref.watch(localAccountsProvider); - final logins = ref.watch(loginsProvider); - final displayModalHUD = isInAsyncCall || !localAccounts.hasValue || !logins.hasValue; diff --git a/lib/account_manager/view/view.dart b/lib/account_manager/view/view.dart new file mode 100644 index 0000000..3304b76 --- /dev/null +++ b/lib/account_manager/view/view.dart @@ -0,0 +1 @@ +export 'new_account_page/new_account_page.dart'; diff --git a/lib/app.dart b/lib/app.dart index 2510f69..903d4f9 100644 --- a/lib/app.dart +++ b/lib/app.dart @@ -6,6 +6,7 @@ import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_translate/flutter_translate.dart'; import 'package:form_builder_validators/form_builder_validators.dart'; +import 'account_manager/account_manager.dart'; import 'router/router.dart'; import 'tick.dart'; @@ -15,6 +16,8 @@ class VeilidChatApp extends StatelessWidget { super.key, }); + static const String name = 'VeilidChat'; + final ThemeData themeData; @override @@ -25,27 +28,42 @@ class VeilidChatApp extends StatelessWidget { initTheme: themeData, builder: (_, theme) => LocalizationProvider( state: LocalizationProvider.of(context).state, - child: BackgroundTicker( - builder: (context) => BlocProvider( - create: (context) => RouterCubit(), - child: MaterialApp.router( - debugShowCheckedModeBanner: false, - routerConfig: router( - routerCubit: - BlocProvider.of(context)), - title: translate('app.title'), - theme: theme, - localizationsDelegates: [ - GlobalMaterialLocalizations.delegate, - GlobalWidgetsLocalizations.delegate, - FormBuilderLocalizations.delegate, - localizationDelegate - ], - supportedLocales: - localizationDelegate.supportedLocales, - locale: localizationDelegate.currentLocale, - ), - )), + child: MultiBlocProvider( + providers: [ + BlocProvider( + create: (context) => + RouterCubit(AccountRepository.instance), + ), + BlocProvider( + create: (context) => + LocalAccountsCubit(AccountRepository.instance), + ), + BlocProvider( + create: (context) => + UserLoginsCubit(AccountRepository.instance), + ), + BlocProvider( + create: (context) => + ActiveUserLoginCubit(AccountRepository.instance), + ), + ], + child: BackgroundTicker( + builder: (context) => MaterialApp.router( + debugShowCheckedModeBanner: false, + routerConfig: router( + routerCubit: BlocProvider.of(context)), + title: translate('app.title'), + theme: theme, + localizationsDelegates: [ + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + FormBuilderLocalizations.delegate, + localizationDelegate + ], + supportedLocales: localizationDelegate.supportedLocales, + locale: localizationDelegate.currentLocale, + ), + )), )); } diff --git a/lib/init.dart b/lib/init.dart index 3305e33..7c0ac92 100644 --- a/lib/init.dart +++ b/lib/init.dart @@ -1,11 +1,10 @@ import 'dart:async'; -import 'local_account_manager/local_account_manager.dart'; +import 'app.dart'; +import 'local_account_manager/account_manager.dart'; import 'processor.dart'; import 'tools/tools.dart'; -import 'veilid_support/veilid_support.dart'; - -const String appName = 'VeilidChat'; +import '../packages/veilid_support/veilid_support.dart'; final Completer eventualVeilid = Completer(); final Processor processor = Processor(); @@ -20,7 +19,8 @@ Future initializeVeilid() async { } // Init Veilid - Veilid.instance.initializeVeilidCore(getDefaultVeilidPlatformConfig(appName)); + Veilid.instance + .initializeVeilidCore(getDefaultVeilidPlatformConfig(VeilidChatApp.name)); // Veilid logging initVeilidLog(); @@ -34,7 +34,7 @@ Future initializeVeilid() async { // Initialize repositories Future initializeRepositories() async { - await AccountRepository.instance; + await AccountRepository.instance.init(); } Future initializeVeilidChat() async { diff --git a/lib/main.dart b/lib/main.dart index 522bd00..3a44cc9 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -8,11 +8,9 @@ import 'package:flutter_translate/flutter_translate.dart'; import 'package:intl/date_symbol_data_local.dart'; import 'app.dart'; -import 'old_to_refactor/providers/window_control.dart'; +import 'init.dart'; import 'theme/theme.dart'; import 'tools/tools.dart'; -import 'init.dart'; - void main() async { // Disable all debugprints in release mode @@ -39,7 +37,7 @@ void main() async { final themeData = themeRepository.themeData(); // Manage window on desktop platforms - await WindowControl.initialize(); + await initializeWindowControl(); // Make localization delegate final delegate = await LocalizationDelegate.create( diff --git a/lib/old_to_refactor/components/signal_strength_meter.dart b/lib/old_to_refactor/components/signal_strength_meter.dart index c093529..2593515 100644 --- a/lib/old_to_refactor/components/signal_strength_meter.dart +++ b/lib/old_to_refactor/components/signal_strength_meter.dart @@ -1,13 +1,13 @@ import 'package:flutter/material.dart'; -import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:signal_strength_indicator/signal_strength_indicator.dart'; -import 'package:go_router/go_router.dart'; +import 'package:veilid_support/veilid_support.dart'; import '../providers/connection_state.dart'; import '../tools/tools.dart'; -import '../veilid_support/veilid_support.dart'; -class SignalStrengthMeterWidget extends ConsumerWidget { +xxx move to feature level + +class SignalStrengthMeterWidget extends Widget { const SignalStrengthMeterWidget({super.key}); @override diff --git a/lib/old_to_refactor/entities/preferences.g.dart b/lib/old_to_refactor/entities/preferences.g.dart deleted file mode 100644 index 0e6f96c..0000000 --- a/lib/old_to_refactor/entities/preferences.g.dart +++ /dev/null @@ -1,53 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'preferences.dart'; - -// ************************************************************************** -// JsonSerializableGenerator -// ************************************************************************** - -_$LockPreferenceImpl _$$LockPreferenceImplFromJson(Map json) => - _$LockPreferenceImpl( - inactivityLockSecs: json['inactivity_lock_secs'] as int, - lockWhenSwitching: json['lock_when_switching'] as bool, - lockWithSystemLock: json['lock_with_system_lock'] as bool, - ); - -Map _$$LockPreferenceImplToJson( - _$LockPreferenceImpl instance) => - { - 'inactivity_lock_secs': instance.inactivityLockSecs, - 'lock_when_switching': instance.lockWhenSwitching, - 'lock_with_system_lock': instance.lockWithSystemLock, - }; - -_$ThemePreferencesImpl _$$ThemePreferencesImplFromJson( - Map json) => - _$ThemePreferencesImpl( - brightnessPreference: - BrightnessPreference.fromJson(json['brightness_preference']), - colorPreference: ColorPreference.fromJson(json['color_preference']), - displayScale: (json['display_scale'] as num).toDouble(), - ); - -Map _$$ThemePreferencesImplToJson( - _$ThemePreferencesImpl instance) => - { - 'brightness_preference': instance.brightnessPreference.toJson(), - 'color_preference': instance.colorPreference.toJson(), - 'display_scale': instance.displayScale, - }; - -_$PreferencesImpl _$$PreferencesImplFromJson(Map json) => - _$PreferencesImpl( - themePreferences: ThemePreferences.fromJson(json['theme_preferences']), - language: LanguagePreference.fromJson(json['language']), - locking: LockPreference.fromJson(json['locking']), - ); - -Map _$$PreferencesImplToJson(_$PreferencesImpl instance) => - { - 'theme_preferences': instance.themePreferences.toJson(), - 'language': instance.language.toJson(), - 'locking': instance.locking.toJson(), - }; diff --git a/lib/old_to_refactor/pages/developer.dart b/lib/old_to_refactor/pages/developer.dart index 6a7bd91..1dc56cd 100644 --- a/lib/old_to_refactor/pages/developer.dart +++ b/lib/old_to_refactor/pages/developer.dart @@ -14,7 +14,7 @@ import 'package:quickalert/quickalert.dart'; import 'package:xterm/xterm.dart'; import '../../tools/tools.dart'; -import '../../veilid_support/veilid_support.dart'; +import '../../../packages/veilid_support/veilid_support.dart'; final globalDebugTerminal = Terminal( maxLines: 50000, diff --git a/lib/old_to_refactor/pages/home.dart b/lib/old_to_refactor/pages/home.dart index 78b09aa..6284dfd 100644 --- a/lib/old_to_refactor/pages/home.dart +++ b/lib/old_to_refactor/pages/home.dart @@ -18,7 +18,7 @@ import '../../local_accounts/local_accounts.dart'; import '../providers/logins.dart'; import '../providers/window_control.dart'; import '../../tools/tools.dart'; -import '../../veilid_support/veilid_support.dart'; +import '../../../packages/veilid_support/veilid_support.dart'; import 'main_pager/main_pager.dart'; class HomePage extends StatefulWidget { diff --git a/lib/old_to_refactor/pages/main_pager/account.dart b/lib/old_to_refactor/pages/main_pager/account.dart index ca6aa1d..553c288 100644 --- a/lib/old_to_refactor/pages/main_pager/account.dart +++ b/lib/old_to_refactor/pages/main_pager/account.dart @@ -15,7 +15,7 @@ import '../../providers/contact.dart'; import '../../providers/contact_invite.dart'; import '../../../theme/theme.dart'; import '../../../tools/tools.dart'; -import '../../../veilid_support/veilid_support.dart'; +import '../../../../packages/veilid_support/veilid_support.dart'; class AccountPage extends ConsumerStatefulWidget { const AccountPage({ diff --git a/lib/old_to_refactor/pages/main_pager/chats.dart b/lib/old_to_refactor/pages/main_pager/chats.dart index c98d128..d35fe6b 100644 --- a/lib/old_to_refactor/pages/main_pager/chats.dart +++ b/lib/old_to_refactor/pages/main_pager/chats.dart @@ -13,7 +13,7 @@ import '../../providers/contact.dart'; import '../../../local_accounts/local_accounts.dart'; import '../../providers/logins.dart'; import '../../../tools/tools.dart'; -import '../../../veilid_support/veilid_support.dart'; +import '../../../../packages/veilid_support/veilid_support.dart'; class ChatsPage extends ConsumerStatefulWidget { const ChatsPage({super.key}); diff --git a/lib/old_to_refactor/pages/main_pager/main_pager.dart b/lib/old_to_refactor/pages/main_pager/main_pager.dart index fd3ef14..971ec1f 100644 --- a/lib/old_to_refactor/pages/main_pager/main_pager.dart +++ b/lib/old_to_refactor/pages/main_pager/main_pager.dart @@ -20,7 +20,7 @@ import '../../../components/send_invite_dialog.dart'; import '../../../entities/local_account.dart'; import '../../../proto/proto.dart' as proto; import '../../../tools/tools.dart'; -import '../../../veilid_support/veilid_support.dart'; +import '../../../../packages/veilid_support/veilid_support.dart'; import 'account.dart'; import 'chats.dart'; diff --git a/lib/old_to_refactor/providers/account.dart b/lib/old_to_refactor/providers/account.dart index 8da8d58..22bdca1 100644 --- a/lib/old_to_refactor/providers/account.dart +++ b/lib/old_to_refactor/providers/account.dart @@ -4,7 +4,7 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; import '../../entities/local_account.dart'; import '../../entities/user_login.dart'; import '../../proto/proto.dart' as proto; -import '../../veilid_support/veilid_support.dart'; +import '../../../packages/veilid_support/veilid_support.dart'; import '../../local_accounts/local_accounts.dart'; import 'logins.dart'; diff --git a/lib/old_to_refactor/providers/chat.dart b/lib/old_to_refactor/providers/chat.dart index ca1c086..fa4a011 100644 --- a/lib/old_to_refactor/providers/chat.dart +++ b/lib/old_to_refactor/providers/chat.dart @@ -4,7 +4,7 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; import '../../proto/proto.dart' as proto; -import '../../veilid_support/veilid_support.dart'; +import '../../../packages/veilid_support/veilid_support.dart'; import 'account.dart'; part 'chat.g.dart'; diff --git a/lib/old_to_refactor/providers/connection_state.dart b/lib/old_to_refactor/providers/connection_state.dart index 1adf8f7..a663190 100644 --- a/lib/old_to_refactor/providers/connection_state.dart +++ b/lib/old_to_refactor/providers/connection_state.dart @@ -1,7 +1,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; -import '../../veilid_support/veilid_support.dart'; +import '../../../packages/veilid_support/veilid_support.dart'; part 'connection_state.freezed.dart'; diff --git a/lib/old_to_refactor/providers/connection_state.freezed.dart b/lib/old_to_refactor/providers/connection_state.freezed.dart index 9616832..8ac0282 100644 --- a/lib/old_to_refactor/providers/connection_state.freezed.dart +++ b/lib/old_to_refactor/providers/connection_state.freezed.dart @@ -30,8 +30,6 @@ abstract class $ConnectionStateCopyWith<$Res> { _$ConnectionStateCopyWithImpl<$Res, ConnectionState>; @useResult $Res call({VeilidStateAttachment attachment}); - - $VeilidStateAttachmentCopyWith<$Res> get attachment; } /// @nodoc @@ -47,23 +45,15 @@ class _$ConnectionStateCopyWithImpl<$Res, $Val extends ConnectionState> @pragma('vm:prefer-inline') @override $Res call({ - Object? attachment = null, + Object? attachment = freezed, }) { return _then(_value.copyWith( - attachment: null == attachment + attachment: freezed == attachment ? _value.attachment : attachment // ignore: cast_nullable_to_non_nullable as VeilidStateAttachment, ) as $Val); } - - @override - @pragma('vm:prefer-inline') - $VeilidStateAttachmentCopyWith<$Res> get attachment { - return $VeilidStateAttachmentCopyWith<$Res>(_value.attachment, (value) { - return _then(_value.copyWith(attachment: value) as $Val); - }); - } } /// @nodoc @@ -75,9 +65,6 @@ abstract class _$$ConnectionStateImplCopyWith<$Res> @override @useResult $Res call({VeilidStateAttachment attachment}); - - @override - $VeilidStateAttachmentCopyWith<$Res> get attachment; } /// @nodoc @@ -91,10 +78,10 @@ class __$$ConnectionStateImplCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({ - Object? attachment = null, + Object? attachment = freezed, }) { return _then(_$ConnectionStateImpl( - attachment: null == attachment + attachment: freezed == attachment ? _value.attachment : attachment // ignore: cast_nullable_to_non_nullable as VeilidStateAttachment, @@ -120,12 +107,13 @@ class _$ConnectionStateImpl extends _ConnectionState { return identical(this, other) || (other.runtimeType == runtimeType && other is _$ConnectionStateImpl && - (identical(other.attachment, attachment) || - other.attachment == attachment)); + const DeepCollectionEquality() + .equals(other.attachment, attachment)); } @override - int get hashCode => Object.hash(runtimeType, attachment); + int get hashCode => + Object.hash(runtimeType, const DeepCollectionEquality().hash(attachment)); @JsonKey(ignore: true) @override diff --git a/lib/old_to_refactor/providers/contact.dart b/lib/old_to_refactor/providers/contact.dart index 731d5a7..ced5c24 100644 --- a/lib/old_to_refactor/providers/contact.dart +++ b/lib/old_to_refactor/providers/contact.dart @@ -5,7 +5,7 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; import '../../proto/proto.dart' as proto; -import '../../veilid_support/veilid_support.dart'; +import '../../../packages/veilid_support/veilid_support.dart'; import '../../tools/tools.dart'; import 'account.dart'; import 'chat.dart'; diff --git a/lib/old_to_refactor/providers/contact_invitation_list_manager.dart b/lib/old_to_refactor/providers/contact_invitation_list_manager.dart index 099bc26..550169e 100644 --- a/lib/old_to_refactor/providers/contact_invitation_list_manager.dart +++ b/lib/old_to_refactor/providers/contact_invitation_list_manager.dart @@ -7,7 +7,7 @@ import 'package:mutex/mutex.dart'; import '../../entities/entities.dart'; import '../../proto/proto.dart' as proto; import '../../tools/tools.dart'; -import '../../veilid_support/veilid_support.dart'; +import '../../../packages/veilid_support/veilid_support.dart'; import 'account.dart'; part 'contact_invitation_list_manager.g.dart'; @@ -115,11 +115,11 @@ class ContactInvitationListManager extends _$ContactInvitationListManager { final conversationWriter = _activeAccountInfo.getConversationWriter(); // Encrypt the writer secret with the encryption key - final encryptedSecret = await encryptSecretToBytes( + final encryptedSecret = await encryptionKeyType.encryptSecretToBytes( secret: contactRequestWriter.secret, cryptoKind: cs.kind(), encryptionKey: encryptionKey, - encryptionKeyType: encryptionKeyType); + ); // Create local chat DHT record with the account record key as its parent // Do not set the encryption of this key yet as it will not yet be written diff --git a/lib/old_to_refactor/providers/contact_invite.dart b/lib/old_to_refactor/providers/contact_invite.dart index a8f5787..24e792a 100644 --- a/lib/old_to_refactor/providers/contact_invite.dart +++ b/lib/old_to_refactor/providers/contact_invite.dart @@ -7,7 +7,7 @@ import 'package:riverpod_annotation/riverpod_annotation.dart'; import '../../entities/local_account.dart'; import '../../proto/proto.dart' as proto; import '../../tools/tools.dart'; -import '../../veilid_support/veilid_support.dart'; +import '../../../packages/veilid_support/veilid_support.dart'; import 'account.dart'; import 'conversation.dart'; diff --git a/lib/old_to_refactor/providers/conversation.dart b/lib/old_to_refactor/providers/conversation.dart index aedd01b..451f8e3 100644 --- a/lib/old_to_refactor/providers/conversation.dart +++ b/lib/old_to_refactor/providers/conversation.dart @@ -11,7 +11,7 @@ import '../../proto/proto.dart' as proto; import '../../tools/tools.dart'; import '../../init.dart'; -import '../../veilid_support/veilid_support.dart'; +import '../../../packages/veilid_support/veilid_support.dart'; import 'account.dart'; import 'chat.dart'; import 'contact.dart'; diff --git a/lib/old_to_refactor/providers/window_control.dart b/lib/old_to_refactor/providers/window_control.dart deleted file mode 100644 index b6dfb76..0000000 --- a/lib/old_to_refactor/providers/window_control.dart +++ /dev/null @@ -1,83 +0,0 @@ -import 'dart:async'; - -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:riverpod_annotation/riverpod_annotation.dart'; -import 'package:window_manager/window_manager.dart'; - -import '../../tools/responsive.dart'; - -export 'package:window_manager/window_manager.dart' show TitleBarStyle; - -part 'window_control.g.dart'; - -enum OrientationCapability { - normal, - portraitOnly, - landscapeOnly, -} - -// Window Control -@riverpod -class WindowControl extends _$WindowControl { - /// Change window control - @override - FutureOr build() async { - await _doWindowSetup(TitleBarStyle.hidden, OrientationCapability.normal); - return true; - } - - static Future initialize() async { - if (isDesktop) { - await windowManager.ensureInitialized(); - - const windowOptions = WindowOptions( - size: Size(768, 1024), - //minimumSize: Size(480, 480), - center: true, - backgroundColor: Colors.transparent, - skipTaskbar: false, - ); - await windowManager.waitUntilReadyToShow(windowOptions, () async { - await windowManager.show(); - await windowManager.focus(); - }); - } - } - - Future _doWindowSetup(TitleBarStyle titleBarStyle, - OrientationCapability orientationCapability) async { - if (isDesktop) { - await windowManager.setTitleBarStyle(titleBarStyle); - } else { - switch (orientationCapability) { - case OrientationCapability.normal: - await SystemChrome.setPreferredOrientations([ - DeviceOrientation.portraitUp, - DeviceOrientation.landscapeLeft, - DeviceOrientation.landscapeRight, - ]); - case OrientationCapability.portraitOnly: - await SystemChrome.setPreferredOrientations([ - DeviceOrientation.portraitUp, - ]); - case OrientationCapability.landscapeOnly: - await SystemChrome.setPreferredOrientations([ - DeviceOrientation.landscapeLeft, - DeviceOrientation.landscapeRight, - ]); - } - } - } - - ////////////////////////////////////////////////////////////// - /// Mutators and Selectors - - /// Reorder accounts - Future changeWindowSetup(TitleBarStyle titleBarStyle, - OrientationCapability orientationCapability) async { - state = const AsyncValue.loading(); - await _doWindowSetup(titleBarStyle, orientationCapability); - state = const AsyncValue.data(true); - } -} diff --git a/lib/processor.dart b/lib/processor.dart index 36878fd..d0c359a 100644 --- a/lib/processor.dart +++ b/lib/processor.dart @@ -2,10 +2,11 @@ import 'dart:async'; import 'package:veilid/veilid.dart'; +import 'app.dart'; import 'old_to_refactor/providers/connection_state.dart'; import 'tools/tools.dart'; -import 'veilid_support/src/config.dart'; -import 'veilid_support/src/veilid_log.dart'; +import '../packages/veilid_support/src/config.dart'; +import '../packages/veilid_support/src/veilid_log.dart'; class Processor { Processor(); @@ -27,13 +28,15 @@ class Processor { log.info('Veilid version: $_veilidVersion'); - // In case of hot restart shut down first + // HACK: In case of hot restart shut down first try { await Veilid.instance.shutdownVeilidCore(); - } on Exception {} + } on Exception { + // Do nothing on failure here + } - final updateStream = - await Veilid.instance.startupVeilidCore(await getVeilidConfig()); + final updateStream = await Veilid.instance + .startupVeilidCore(await getVeilidConfig(VeilidChatApp.name)); _updateStream = updateStream; _updateProcessor = processUpdates(); _startedUp = true; diff --git a/lib/proto/proto.dart b/lib/proto/proto.dart index 9d1aeb6..cfccda3 100644 --- a/lib/proto/proto.dart +++ b/lib/proto/proto.dart @@ -1,5 +1,5 @@ -export '../veilid_support/dht_support/proto/proto.dart'; -export '../veilid_support/proto/proto.dart'; +export 'package:veilid_support/dht_support/proto/proto.dart'; +export 'package:veilid_support/proto/proto.dart'; export 'veilidchat.pb.dart'; export 'veilidchat.pbenum.dart'; export 'veilidchat.pbjson.dart'; diff --git a/lib/router/cubit/router_cubit.dart b/lib/router/cubit/router_cubit.dart index 70936e7..5fcd379 100644 --- a/lib/router/cubit/router_cubit.dart +++ b/lib/router/cubit/router_cubit.dart @@ -6,12 +6,12 @@ import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:go_router/go_router.dart'; import '../../init.dart'; -import '../../local_account_manager/account_repository/account_repository.dart'; +import '../../local_account_manager/respository/account_repository/account_repository.dart'; import '../../old_to_refactor/pages/chat_only.dart'; import '../../old_to_refactor/pages/developer.dart'; import '../../old_to_refactor/pages/home.dart'; import '../../old_to_refactor/pages/index.dart'; -import '../../old_to_refactor/pages/new_account.dart'; +import '../../account_manager/view/new_account_page/new_account_page.dart'; import '../../old_to_refactor/pages/settings.dart'; import '../../tools/tools.dart'; diff --git a/lib/router/cubit/router_cubit.freezed.dart b/lib/router/cubit/router_cubit.freezed.dart deleted file mode 100644 index a79e746..0000000 --- a/lib/router/cubit/router_cubit.freezed.dart +++ /dev/null @@ -1,193 +0,0 @@ -// 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#custom-getters-and-methods'); - -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 deleted file mode 100644 index f67c770..0000000 --- a/lib/router/cubit/router_cubit.g.dart +++ /dev/null @@ -1,21 +0,0 @@ -// 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/theme/theme_service.dart b/lib/theme/theme_service.dart deleted file mode 100644 index 5464c04..0000000 --- a/lib/theme/theme_service.dart +++ /dev/null @@ -1,108 +0,0 @@ -// ignore_for_file: always_put_required_named_parameters_first - -import 'dart:convert'; - -import 'package:flutter/material.dart'; -import 'package:shared_preferences/shared_preferences.dart'; - -import '../entities/preferences.dart'; -import 'radix_generator.dart'; - -//////////////////////////////////////////////////////////////////////// - -class ThemeService { - ThemeService._(); - static late SharedPreferences prefs; - static ThemeService? _instance; - - static Future get instance async { - if (_instance == null) { - prefs = await SharedPreferences.getInstance(); - _instance = ThemeService._(); - } - return _instance!; - } - - static bool get isPlatformDark => - WidgetsBinding.instance.platformDispatcher.platformBrightness == - Brightness.dark; - - ThemeData get initial { - final themePreferences = load(); - return get(themePreferences); - } - - ThemePreferences load() { - final themePreferencesJson = prefs.getString('themePreferences'); - ThemePreferences? themePreferences; - if (themePreferencesJson != null) { - try { - themePreferences = - ThemePreferences.fromJson(jsonDecode(themePreferencesJson)); - // ignore: avoid_catches_without_on_clauses - } catch (_) { - // ignore - } - } - return themePreferences ?? - const ThemePreferences( - colorPreference: ColorPreference.vapor, - brightnessPreference: BrightnessPreference.system, - displayScale: 1, - ); - } - - Future save(ThemePreferences themePreferences) async { - await prefs.setString( - 'themePreferences', jsonEncode(themePreferences.toJson())); - } - - ThemeData get(ThemePreferences themePreferences) { - late final Brightness brightness; - switch (themePreferences.brightnessPreference) { - case BrightnessPreference.system: - if (isPlatformDark) { - brightness = Brightness.dark; - } else { - brightness = Brightness.light; - } - case BrightnessPreference.light: - brightness = Brightness.light; - case BrightnessPreference.dark: - brightness = Brightness.dark; - } - - late final ThemeData themeData; - switch (themePreferences.colorPreference) { - // Special cases - case ColorPreference.contrast: - // xxx do contrastGenerator - themeData = radixGenerator(brightness, RadixThemeColor.grim); - // Generate from Radix - case ColorPreference.scarlet: - themeData = radixGenerator(brightness, RadixThemeColor.scarlet); - case ColorPreference.babydoll: - themeData = radixGenerator(brightness, RadixThemeColor.babydoll); - case ColorPreference.vapor: - themeData = radixGenerator(brightness, RadixThemeColor.vapor); - case ColorPreference.gold: - themeData = radixGenerator(brightness, RadixThemeColor.gold); - case ColorPreference.garden: - themeData = radixGenerator(brightness, RadixThemeColor.garden); - case ColorPreference.forest: - themeData = radixGenerator(brightness, RadixThemeColor.forest); - case ColorPreference.arctic: - themeData = radixGenerator(brightness, RadixThemeColor.arctic); - case ColorPreference.lapis: - themeData = radixGenerator(brightness, RadixThemeColor.lapis); - case ColorPreference.eggplant: - themeData = radixGenerator(brightness, RadixThemeColor.eggplant); - case ColorPreference.lime: - themeData = radixGenerator(brightness, RadixThemeColor.lime); - case ColorPreference.grim: - themeData = radixGenerator(brightness, RadixThemeColor.grim); - } - - return themeData; - } -} diff --git a/lib/tick.dart b/lib/tick.dart index bcaa478..82909bc 100644 --- a/lib/tick.dart +++ b/lib/tick.dart @@ -5,14 +5,14 @@ import 'package:fast_immutable_collections/fast_immutable_collections.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'proto/proto.dart' as proto; +import 'init.dart'; import 'old_to_refactor/providers/account.dart'; import 'old_to_refactor/providers/chat.dart'; import 'old_to_refactor/providers/connection_state.dart'; import 'old_to_refactor/providers/contact.dart'; import 'old_to_refactor/providers/contact_invite.dart'; import 'old_to_refactor/providers/conversation.dart'; -import 'init.dart'; +import 'proto/proto.dart' as proto; const int ticksPerContactInvitationCheck = 5; const int ticksPerNewMessageCheck = 5; diff --git a/lib/tools/async_table_db_backed_cubit.dart b/lib/tools/async_table_db_backed_cubit.dart index b3aac2c..d8183a7 100644 --- a/lib/tools/async_table_db_backed_cubit.dart +++ b/lib/tools/async_table_db_backed_cubit.dart @@ -4,7 +4,7 @@ import 'package:bloc/bloc.dart'; import '../../tools/tools.dart'; import '../init.dart'; -import '../../veilid_support/veilid_support.dart'; +import '../../packages/veilid_support/veilid_support.dart'; abstract class AsyncTableDBBackedCubit extends Cubit> with TableDBBacked { diff --git a/lib/tools/loggy.dart b/lib/tools/loggy.dart index 0a7f6a5..3be0f5c 100644 --- a/lib/tools/loggy.dart +++ b/lib/tools/loggy.dart @@ -8,7 +8,7 @@ import 'package:intl/intl.dart'; import 'package:loggy/loggy.dart'; import '../old_to_refactor/pages/developer.dart'; -import '../veilid_support/veilid_support.dart'; +import '../../packages/veilid_support/veilid_support.dart'; import 'state_logger.dart'; String wrapWithLogColor(LogLevel? level, String text) { diff --git a/lib/tools/secret_crypto.dart b/lib/tools/secret_crypto.dart deleted file mode 100644 index 0920be7..0000000 --- a/lib/tools/secret_crypto.dart +++ /dev/null @@ -1,46 +0,0 @@ -import 'dart:typed_data'; -import '../local_accounts/local_account.dart'; -import '../init.dart'; -import '../veilid_support/veilid_support.dart'; - -Future encryptSecretToBytes( - {required SecretKey secret, - required CryptoKind cryptoKind, - EncryptionKeyType encryptionKeyType = EncryptionKeyType.none, - String encryptionKey = ''}) async { - final veilid = await eventualVeilid.future; - - late final Uint8List secretBytes; - switch (encryptionKeyType) { - case EncryptionKeyType.none: - secretBytes = secret.decode(); - case EncryptionKeyType.pin: - case EncryptionKeyType.password: - final cs = await veilid.getCryptoSystem(cryptoKind); - - secretBytes = - await cs.encryptAeadWithPassword(secret.decode(), encryptionKey); - } - return secretBytes; -} - -Future decryptSecretFromBytes( - {required Uint8List secretBytes, - required CryptoKind cryptoKind, - EncryptionKeyType encryptionKeyType = EncryptionKeyType.none, - String encryptionKey = ''}) async { - final veilid = await eventualVeilid.future; - - late final SecretKey secret; - switch (encryptionKeyType) { - case EncryptionKeyType.none: - secret = SecretKey.fromBytes(secretBytes); - case EncryptionKeyType.pin: - case EncryptionKeyType.password: - final cs = await veilid.getCryptoSystem(cryptoKind); - - secret = SecretKey.fromBytes( - await cs.decryptAeadWithPassword(secretBytes, encryptionKey)); - } - return secret; -} diff --git a/lib/tools/tools.dart b/lib/tools/tools.dart index 34af70d..203cfc3 100644 --- a/lib/tools/tools.dart +++ b/lib/tools/tools.dart @@ -5,6 +5,6 @@ export 'loggy.dart'; export 'phono_byte.dart'; export 'responsive.dart'; export 'scanner_error_widget.dart'; -export 'secret_crypto.dart'; export 'state_logger.dart'; export 'widget_helpers.dart'; +export 'window_control.dart'; diff --git a/lib/tools/window_control.dart b/lib/tools/window_control.dart new file mode 100644 index 0000000..d3be316 --- /dev/null +++ b/lib/tools/window_control.dart @@ -0,0 +1,65 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:window_manager/window_manager.dart'; + +import '../../tools/responsive.dart'; + +export 'package:window_manager/window_manager.dart' show TitleBarStyle; + +enum OrientationCapability { + normal, + portraitOnly, + landscapeOnly, +} + +// Window Control +Future initializeWindowControl() async { + if (isDesktop) { + await windowManager.ensureInitialized(); + + const windowOptions = WindowOptions( + size: Size(768, 1024), + //minimumSize: Size(480, 480), + center: true, + backgroundColor: Colors.transparent, + skipTaskbar: false, + ); + await windowManager.waitUntilReadyToShow(windowOptions, () async { + await _doWindowSetup(TitleBarStyle.hidden, OrientationCapability.normal); + await windowManager.show(); + await windowManager.focus(); + }); + } +} + +Future _doWindowSetup(TitleBarStyle titleBarStyle, + OrientationCapability orientationCapability) async { + if (isDesktop) { + await windowManager.setTitleBarStyle(titleBarStyle); + } else { + switch (orientationCapability) { + case OrientationCapability.normal: + await SystemChrome.setPreferredOrientations([ + DeviceOrientation.portraitUp, + DeviceOrientation.landscapeLeft, + DeviceOrientation.landscapeRight, + ]); + case OrientationCapability.portraitOnly: + await SystemChrome.setPreferredOrientations([ + DeviceOrientation.portraitUp, + ]); + case OrientationCapability.landscapeOnly: + await SystemChrome.setPreferredOrientations([ + DeviceOrientation.landscapeLeft, + DeviceOrientation.landscapeRight, + ]); + } + } +} + +Future changeWindowSetup(TitleBarStyle titleBarStyle, + OrientationCapability orientationCapability) async { + await _doWindowSetup(titleBarStyle, orientationCapability); +} diff --git a/packages/veilid_support/.gitignore b/packages/veilid_support/.gitignore new file mode 100644 index 0000000..df26946 --- /dev/null +++ b/packages/veilid_support/.gitignore @@ -0,0 +1,56 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Flutter generated files +# Not doing this at this time: https://stackoverflow.com/questions/56110386/should-i-commit-generated-code-in-flutter-dart-to-vcs +# *.g.dart +# *.freezed.dart +# *.pb.dart +# *.pbenum.dart +# *.pbjson.dart +# *.pbserver.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json + +# Android Studio will place build artifacts here +/android/app/debug +/android/app/profile +/android/app/release + +# WASM +/web/wasm/ diff --git a/packages/veilid_support/analysis_options.yaml b/packages/veilid_support/analysis_options.yaml new file mode 100644 index 0000000..e1620f7 --- /dev/null +++ b/packages/veilid_support/analysis_options.yaml @@ -0,0 +1,15 @@ +include: package:lint_hard/all.yaml +analyzer: + errors: + invalid_annotation_target: ignore + exclude: + - '**/*.g.dart' + - '**/*.freezed.dart' + - '**/*.pb.dart' + - '**/*.pbenum.dart' + - '**/*.pbjson.dart' + - '**/*.pbserver.dart' +linter: + rules: + unawaited_futures: true + avoid_positional_boolean_parameters: false \ No newline at end of file diff --git a/packages/veilid_support/build.bat b/packages/veilid_support/build.bat new file mode 100644 index 0000000..88d2bb0 --- /dev/null +++ b/packages/veilid_support/build.bat @@ -0,0 +1,7 @@ +@echo off +dart run build_runner build --delete-conflicting-outputs + +pushd lib +protoc --dart_out=proto -I proto -I dht_support\proto dht.proto +protoc --dart_out=proto -I proto veilid.proto +popd diff --git a/packages/veilid_support/build.sh b/packages/veilid_support/build.sh new file mode 100755 index 0000000..0c43bc6 --- /dev/null +++ b/packages/veilid_support/build.sh @@ -0,0 +1,8 @@ +#!/bin/bash +set -e +dart run build_runner build --delete-conflicting-outputs + +pushd lib > /dev/null +protoc --dart_out=proto -I proto -I dht_support/proto dht.proto +protoc --dart_out=proto -I proto veilid.proto +popd > /dev/null diff --git a/lib/veilid_support/dht_support/dht_support.dart b/packages/veilid_support/lib/dht_support/dht_support.dart similarity index 100% rename from lib/veilid_support/dht_support/dht_support.dart rename to packages/veilid_support/lib/dht_support/dht_support.dart diff --git a/lib/veilid_support/dht_support/proto/dht.proto b/packages/veilid_support/lib/dht_support/proto/dht.proto similarity index 100% rename from lib/veilid_support/dht_support/proto/dht.proto rename to packages/veilid_support/lib/dht_support/proto/dht.proto diff --git a/lib/veilid_support/dht_support/proto/proto.dart b/packages/veilid_support/lib/dht_support/proto/proto.dart similarity index 75% rename from lib/veilid_support/dht_support/proto/proto.dart rename to packages/veilid_support/lib/dht_support/proto/proto.dart index f4244c7..f61e342 100644 --- a/lib/veilid_support/dht_support/proto/proto.dart +++ b/packages/veilid_support/lib/dht_support/proto/proto.dart @@ -1,11 +1,11 @@ -import '../../../proto/dht.pb.dart' as dhtproto; +import '../../proto/dht.pb.dart' as dhtproto; import '../../proto/proto.dart' as veilidproto; import '../dht_support.dart'; -export '../../../proto/dht.pb.dart'; -export '../../../proto/dht.pbenum.dart'; -export '../../../proto/dht.pbjson.dart'; -export '../../../proto/dht.pbserver.dart'; +export '../../proto/dht.pb.dart'; +export '../../proto/dht.pbenum.dart'; +export '../../proto/dht.pbjson.dart'; +export '../../proto/dht.pbserver.dart'; export '../../proto/proto.dart'; /// OwnedDHTRecordPointer protobuf marshaling diff --git a/lib/veilid_support/dht_support/src/dht_record.dart b/packages/veilid_support/lib/dht_support/src/dht_record.dart similarity index 99% rename from lib/veilid_support/dht_support/src/dht_record.dart rename to packages/veilid_support/lib/dht_support/src/dht_record.dart index 3722027..bc6dea2 100644 --- a/lib/veilid_support/dht_support/src/dht_record.dart +++ b/packages/veilid_support/lib/dht_support/src/dht_record.dart @@ -3,7 +3,7 @@ import 'dart:typed_data'; import 'package:protobuf/protobuf.dart'; -import '../../veilid_support.dart'; +import '../../../../veilid_support.dart'; class DHTRecord { DHTRecord( diff --git a/lib/veilid_support/dht_support/src/dht_record_crypto.dart b/packages/veilid_support/lib/dht_support/src/dht_record_crypto.dart similarity index 97% rename from lib/veilid_support/dht_support/src/dht_record_crypto.dart rename to packages/veilid_support/lib/dht_support/src/dht_record_crypto.dart index 41a8949..7d59453 100644 --- a/lib/veilid_support/dht_support/src/dht_record_crypto.dart +++ b/packages/veilid_support/lib/dht_support/src/dht_record_crypto.dart @@ -1,6 +1,6 @@ import 'dart:async'; import 'dart:typed_data'; -import '../../veilid_support.dart'; +import '../../../../veilid_support.dart'; abstract class DHTRecordCrypto { FutureOr encrypt(Uint8List data, int subkey); diff --git a/lib/veilid_support/dht_support/src/dht_record_pool.dart b/packages/veilid_support/lib/dht_support/src/dht_record_pool.dart similarity index 99% rename from lib/veilid_support/dht_support/src/dht_record_pool.dart rename to packages/veilid_support/lib/dht_support/src/dht_record_pool.dart index 88edf37..33960bb 100644 --- a/lib/veilid_support/dht_support/src/dht_record_pool.dart +++ b/packages/veilid_support/lib/dht_support/src/dht_record_pool.dart @@ -2,7 +2,7 @@ import 'package:fast_immutable_collections/fast_immutable_collections.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:mutex/mutex.dart'; -import '../../veilid_support.dart'; +import '../../../../veilid_support.dart'; part 'dht_record_pool.freezed.dart'; part 'dht_record_pool.g.dart'; diff --git a/lib/veilid_support/dht_support/src/dht_record_pool.freezed.dart b/packages/veilid_support/lib/dht_support/src/dht_record_pool.freezed.dart similarity index 100% rename from lib/veilid_support/dht_support/src/dht_record_pool.freezed.dart rename to packages/veilid_support/lib/dht_support/src/dht_record_pool.freezed.dart diff --git a/lib/veilid_support/dht_support/src/dht_record_pool.g.dart b/packages/veilid_support/lib/dht_support/src/dht_record_pool.g.dart similarity index 75% rename from lib/veilid_support/dht_support/src/dht_record_pool.g.dart rename to packages/veilid_support/lib/dht_support/src/dht_record_pool.g.dart index b7bb9c2..ea2a61b 100644 --- a/lib/veilid_support/dht_support/src/dht_record_pool.g.dart +++ b/packages/veilid_support/lib/dht_support/src/dht_record_pool.g.dart @@ -11,47 +11,47 @@ _$DHTRecordPoolAllocationsImpl _$$DHTRecordPoolAllocationsImplFromJson( _$DHTRecordPoolAllocationsImpl( childrenByParent: IMap>>.fromJson( - json['children_by_parent'] as Map, + json['childrenByParent'] as Map, (value) => value as String, (value) => ISet>.fromJson(value, (value) => Typed.fromJson(value))), parentByChild: IMap>.fromJson( - json['parent_by_child'] as Map, + json['parentByChild'] as Map, (value) => value as String, (value) => Typed.fromJson(value)), rootRecords: ISet>.fromJson( - json['root_records'], + json['rootRecords'], (value) => Typed.fromJson(value)), ); Map _$$DHTRecordPoolAllocationsImplToJson( _$DHTRecordPoolAllocationsImpl instance) => { - 'children_by_parent': instance.childrenByParent.toJson( + 'childrenByParent': instance.childrenByParent.toJson( (value) => value, (value) => value.toJson( - (value) => value.toJson(), + (value) => value, ), ), - 'parent_by_child': instance.parentByChild.toJson( + 'parentByChild': instance.parentByChild.toJson( + (value) => value, (value) => value, - (value) => value.toJson(), ), - 'root_records': instance.rootRecords.toJson( - (value) => value.toJson(), + 'rootRecords': instance.rootRecords.toJson( + (value) => value, ), }; _$OwnedDHTRecordPointerImpl _$$OwnedDHTRecordPointerImplFromJson( Map json) => _$OwnedDHTRecordPointerImpl( - recordKey: Typed.fromJson(json['record_key']), + recordKey: Typed.fromJson(json['recordKey']), owner: KeyPair.fromJson(json['owner']), ); Map _$$OwnedDHTRecordPointerImplToJson( _$OwnedDHTRecordPointerImpl instance) => { - 'record_key': instance.recordKey.toJson(), - 'owner': instance.owner.toJson(), + 'recordKey': instance.recordKey, + 'owner': instance.owner, }; diff --git a/lib/veilid_support/dht_support/src/dht_short_array.dart b/packages/veilid_support/lib/dht_support/src/dht_short_array.dart similarity index 99% rename from lib/veilid_support/dht_support/src/dht_short_array.dart rename to packages/veilid_support/lib/dht_support/src/dht_short_array.dart index 82b701f..f115e5a 100644 --- a/lib/veilid_support/dht_support/src/dht_short_array.dart +++ b/packages/veilid_support/lib/dht_support/src/dht_short_array.dart @@ -3,7 +3,7 @@ import 'dart:typed_data'; import 'package:protobuf/protobuf.dart'; -import '../../veilid_support.dart'; +import '../../../../veilid_support.dart'; import '../proto/proto.dart' as proto; class _DHTShortArrayCache { diff --git a/lib/proto/dht.pb.dart b/packages/veilid_support/lib/proto/dht.pb.dart similarity index 100% rename from lib/proto/dht.pb.dart rename to packages/veilid_support/lib/proto/dht.pb.dart diff --git a/lib/proto/dht.pbenum.dart b/packages/veilid_support/lib/proto/dht.pbenum.dart similarity index 100% rename from lib/proto/dht.pbenum.dart rename to packages/veilid_support/lib/proto/dht.pbenum.dart diff --git a/lib/proto/dht.pbjson.dart b/packages/veilid_support/lib/proto/dht.pbjson.dart similarity index 100% rename from lib/proto/dht.pbjson.dart rename to packages/veilid_support/lib/proto/dht.pbjson.dart diff --git a/lib/proto/dht.pbserver.dart b/packages/veilid_support/lib/proto/dht.pbserver.dart similarity index 100% rename from lib/proto/dht.pbserver.dart rename to packages/veilid_support/lib/proto/dht.pbserver.dart diff --git a/lib/veilid_support/proto/proto.dart b/packages/veilid_support/lib/proto/proto.dart similarity index 75% rename from lib/veilid_support/proto/proto.dart rename to packages/veilid_support/lib/proto/proto.dart index 941c2af..86f3606 100644 --- a/lib/veilid_support/proto/proto.dart +++ b/packages/veilid_support/lib/proto/proto.dart @@ -1,16 +1,16 @@ import 'dart:typed_data'; -import '../../proto/veilid.pb.dart' as proto; -import '../veilid_support.dart'; +import '../veilid_support.dart' as veilid; +import 'veilid.pb.dart' as proto; -export '../../proto/veilid.pb.dart'; -export '../../proto/veilid.pbenum.dart'; -export '../../proto/veilid.pbjson.dart'; -export '../../proto/veilid.pbserver.dart'; +export 'veilid.pb.dart'; +export 'veilid.pbenum.dart'; +export 'veilid.pbjson.dart'; +export 'veilid.pbserver.dart'; /// CryptoKey protobuf marshaling /// -extension CryptoKeyProto on CryptoKey { +extension CryptoKeyProto on veilid.CryptoKey { proto.CryptoKey toProto() { final b = decode().buffer.asByteData(); final out = proto.CryptoKey() @@ -25,7 +25,7 @@ extension CryptoKeyProto on CryptoKey { return out; } - static CryptoKey fromProto(proto.CryptoKey p) { + static veilid.CryptoKey fromProto(proto.CryptoKey p) { final b = ByteData(32) ..setUint32(0 * 4, p.u0) ..setUint32(1 * 4, p.u1) @@ -35,13 +35,13 @@ extension CryptoKeyProto on CryptoKey { ..setUint32(5 * 4, p.u5) ..setUint32(6 * 4, p.u6) ..setUint32(7 * 4, p.u7); - return CryptoKey.fromBytes(Uint8List.view(b.buffer)); + return veilid.CryptoKey.fromBytes(Uint8List.view(b.buffer)); } } /// Signature protobuf marshaling /// -extension SignatureProto on Signature { +extension SignatureProto on veilid.Signature { proto.Signature toProto() { final b = decode().buffer.asByteData(); final out = proto.Signature() @@ -64,7 +64,7 @@ extension SignatureProto on Signature { return out; } - static Signature fromProto(proto.Signature p) { + static veilid.Signature fromProto(proto.Signature p) { final b = ByteData(64) ..setUint32(0 * 4, p.u0) ..setUint32(1 * 4, p.u1) @@ -82,13 +82,13 @@ extension SignatureProto on Signature { ..setUint32(13 * 4, p.u13) ..setUint32(14 * 4, p.u14) ..setUint32(15 * 4, p.u15); - return Signature.fromBytes(Uint8List.view(b.buffer)); + return veilid.Signature.fromBytes(Uint8List.view(b.buffer)); } } /// Nonce protobuf marshaling /// -extension NonceProto on Nonce { +extension NonceProto on veilid.Nonce { proto.Nonce toProto() { final b = decode().buffer.asByteData(); final out = proto.Nonce() @@ -101,7 +101,7 @@ extension NonceProto on Nonce { return out; } - static Nonce fromProto(proto.Nonce p) { + static veilid.Nonce fromProto(proto.Nonce p) { final b = ByteData(24) ..setUint32(0 * 4, p.u0) ..setUint32(1 * 4, p.u1) @@ -109,13 +109,13 @@ extension NonceProto on Nonce { ..setUint32(3 * 4, p.u3) ..setUint32(4 * 4, p.u4) ..setUint32(5 * 4, p.u5); - return Nonce.fromBytes(Uint8List.view(b.buffer)); + return veilid.Nonce.fromBytes(Uint8List.view(b.buffer)); } } /// TypedKey protobuf marshaling /// -extension TypedKeyProto on TypedKey { +extension TypedKeyProto on veilid.TypedKey { proto.TypedKey toProto() { final out = proto.TypedKey() ..kind = kind @@ -123,13 +123,13 @@ extension TypedKeyProto on TypedKey { return out; } - static TypedKey fromProto(proto.TypedKey p) => - TypedKey(kind: p.kind, value: CryptoKeyProto.fromProto(p.value)); + static veilid.TypedKey fromProto(proto.TypedKey p) => + veilid.TypedKey(kind: p.kind, value: CryptoKeyProto.fromProto(p.value)); } /// KeyPair protobuf marshaling /// -extension KeyPairProto on KeyPair { +extension KeyPairProto on veilid.KeyPair { proto.KeyPair toProto() { final out = proto.KeyPair() ..key = key.toProto() @@ -137,7 +137,7 @@ extension KeyPairProto on KeyPair { return out; } - static KeyPair fromProto(proto.KeyPair p) => KeyPair( + static veilid.KeyPair fromProto(proto.KeyPair p) => veilid.KeyPair( key: CryptoKeyProto.fromProto(p.key), secret: CryptoKeyProto.fromProto(p.secret)); } diff --git a/lib/proto/veilid.pb.dart b/packages/veilid_support/lib/proto/veilid.pb.dart similarity index 100% rename from lib/proto/veilid.pb.dart rename to packages/veilid_support/lib/proto/veilid.pb.dart diff --git a/lib/proto/veilid.pbenum.dart b/packages/veilid_support/lib/proto/veilid.pbenum.dart similarity index 100% rename from lib/proto/veilid.pbenum.dart rename to packages/veilid_support/lib/proto/veilid.pbenum.dart diff --git a/lib/proto/veilid.pbjson.dart b/packages/veilid_support/lib/proto/veilid.pbjson.dart similarity index 100% rename from lib/proto/veilid.pbjson.dart rename to packages/veilid_support/lib/proto/veilid.pbjson.dart diff --git a/lib/proto/veilid.pbserver.dart b/packages/veilid_support/lib/proto/veilid.pbserver.dart similarity index 100% rename from lib/proto/veilid.pbserver.dart rename to packages/veilid_support/lib/proto/veilid.pbserver.dart diff --git a/lib/veilid_support/proto/veilid.proto b/packages/veilid_support/lib/proto/veilid.proto similarity index 100% rename from lib/veilid_support/proto/veilid.proto rename to packages/veilid_support/lib/proto/veilid.proto diff --git a/lib/veilid_support/src/config.dart b/packages/veilid_support/lib/src/config.dart similarity index 93% rename from lib/veilid_support/src/config.dart rename to packages/veilid_support/lib/src/config.dart index 3e3aa76..99860a0 100644 --- a/lib/veilid_support/src/config.dart +++ b/packages/veilid_support/lib/src/config.dart @@ -1,8 +1,8 @@ -import 'package:flutter/foundation.dart'; import 'package:veilid/veilid.dart'; -Map getDefaultVeilidPlatformConfig(String appName) { - if (kIsWeb) { +Map getDefaultVeilidPlatformConfig( + bool isWeb, String appName) { + if (isWeb) { return const VeilidWASMConfig( logging: VeilidWASMConfigLogging( performance: VeilidWASMConfigLoggingPerformance( @@ -30,7 +30,7 @@ Map getDefaultVeilidPlatformConfig(String appName) { .toJson(); } -Future getVeilidConfig(String appName) async { +Future getVeilidConfig(bool isWeb, String appName) async { var config = await getDefaultVeilidConfig(appName); // ignore: do_not_use_environment if (const String.fromEnvironment('DELETE_TABLE_STORE') == '1') { @@ -51,7 +51,7 @@ Future getVeilidConfig(String appName) async { // ignore: do_not_use_environment const envNetwork = String.fromEnvironment('NETWORK'); if (envNetwork.isNotEmpty) { - final bootstrap = kIsWeb + final bootstrap = isWeb ? ['ws://bootstrap.$envNetwork.veilid.net:5150/ws'] : ['bootstrap.$envNetwork.veilid.net']; config = config.copyWith( diff --git a/lib/veilid_support/src/identity.dart b/packages/veilid_support/lib/src/identity.dart similarity index 99% rename from lib/veilid_support/src/identity.dart rename to packages/veilid_support/lib/src/identity.dart index 0baf34b..c4162df 100644 --- a/lib/veilid_support/src/identity.dart +++ b/packages/veilid_support/lib/src/identity.dart @@ -3,8 +3,9 @@ import 'dart:typed_data'; import 'package:fast_immutable_collections/fast_immutable_collections.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:protobuf/protobuf.dart'; +import 'package:veilid/veilid.dart'; -import '../veilid_support.dart'; +import '../dht_support/dht_support.dart'; part 'identity.freezed.dart'; part 'identity.g.dart'; diff --git a/lib/veilid_support/src/identity.freezed.dart b/packages/veilid_support/lib/src/identity.freezed.dart similarity index 100% rename from lib/veilid_support/src/identity.freezed.dart rename to packages/veilid_support/lib/src/identity.freezed.dart diff --git a/lib/veilid_support/src/identity.g.dart b/packages/veilid_support/lib/src/identity.g.dart similarity index 62% rename from lib/veilid_support/src/identity.g.dart rename to packages/veilid_support/lib/src/identity.g.dart index 616477a..7d3687e 100644 --- a/lib/veilid_support/src/identity.g.dart +++ b/packages/veilid_support/lib/src/identity.g.dart @@ -9,19 +9,19 @@ part of 'identity.dart'; _$AccountRecordInfoImpl _$$AccountRecordInfoImplFromJson( Map json) => _$AccountRecordInfoImpl( - accountRecord: OwnedDHTRecordPointer.fromJson(json['account_record']), + accountRecord: OwnedDHTRecordPointer.fromJson(json['accountRecord']), ); Map _$$AccountRecordInfoImplToJson( _$AccountRecordInfoImpl instance) => { - 'account_record': instance.accountRecord.toJson(), + 'accountRecord': instance.accountRecord, }; _$IdentityImpl _$$IdentityImplFromJson(Map json) => _$IdentityImpl( accountRecords: IMap>.fromJson( - json['account_records'] as Map, + json['accountRecords'] as Map, (value) => value as String, (value) => ISet.fromJson( value, (value) => AccountRecordInfo.fromJson(value))), @@ -29,10 +29,10 @@ _$IdentityImpl _$$IdentityImplFromJson(Map json) => Map _$$IdentityImplToJson(_$IdentityImpl instance) => { - 'account_records': instance.accountRecords.toJson( + 'accountRecords': instance.accountRecords.toJson( (value) => value, (value) => value.toJson( - (value) => value.toJson(), + (value) => value, ), ), }; @@ -40,24 +40,24 @@ Map _$$IdentityImplToJson(_$IdentityImpl instance) => _$IdentityMasterImpl _$$IdentityMasterImplFromJson(Map json) => _$IdentityMasterImpl( identityRecordKey: - Typed.fromJson(json['identity_record_key']), + Typed.fromJson(json['identityRecordKey']), identityPublicKey: - FixedEncodedString43.fromJson(json['identity_public_key']), + FixedEncodedString43.fromJson(json['identityPublicKey']), masterRecordKey: - Typed.fromJson(json['master_record_key']), - masterPublicKey: FixedEncodedString43.fromJson(json['master_public_key']), + Typed.fromJson(json['masterRecordKey']), + masterPublicKey: FixedEncodedString43.fromJson(json['masterPublicKey']), identitySignature: - FixedEncodedString86.fromJson(json['identity_signature']), - masterSignature: FixedEncodedString86.fromJson(json['master_signature']), + FixedEncodedString86.fromJson(json['identitySignature']), + masterSignature: FixedEncodedString86.fromJson(json['masterSignature']), ); Map _$$IdentityMasterImplToJson( _$IdentityMasterImpl instance) => { - 'identity_record_key': instance.identityRecordKey.toJson(), - 'identity_public_key': instance.identityPublicKey.toJson(), - 'master_record_key': instance.masterRecordKey.toJson(), - 'master_public_key': instance.masterPublicKey.toJson(), - 'identity_signature': instance.identitySignature.toJson(), - 'master_signature': instance.masterSignature.toJson(), + 'identityRecordKey': instance.identityRecordKey, + 'identityPublicKey': instance.identityPublicKey, + 'masterRecordKey': instance.masterRecordKey, + 'masterPublicKey': instance.masterPublicKey, + 'identitySignature': instance.identitySignature, + 'masterSignature': instance.masterSignature, }; diff --git a/lib/veilid_support/src/json_tools.dart b/packages/veilid_support/lib/src/json_tools.dart similarity index 100% rename from lib/veilid_support/src/json_tools.dart rename to packages/veilid_support/lib/src/json_tools.dart diff --git a/lib/veilid_support/src/protobuf_tools.dart b/packages/veilid_support/lib/src/protobuf_tools.dart similarity index 100% rename from lib/veilid_support/src/protobuf_tools.dart rename to packages/veilid_support/lib/src/protobuf_tools.dart diff --git a/lib/veilid_support/src/table_db.dart b/packages/veilid_support/lib/src/table_db.dart similarity index 100% rename from lib/veilid_support/src/table_db.dart rename to packages/veilid_support/lib/src/table_db.dart diff --git a/lib/veilid_support/src/veilid_log.dart b/packages/veilid_support/lib/src/veilid_log.dart similarity index 94% rename from lib/veilid_support/src/veilid_log.dart rename to packages/veilid_support/lib/src/veilid_log.dart index 8a343eb..b112292 100644 --- a/lib/veilid_support/src/veilid_log.dart +++ b/packages/veilid_support/lib/src/veilid_log.dart @@ -1,4 +1,3 @@ -import 'package:flutter/foundation.dart'; import 'package:loggy/loggy.dart'; import 'package:veilid/veilid.dart'; @@ -68,14 +67,14 @@ Future processLog(VeilidLog log) async { } } -void initVeilidLog() { +void initVeilidLog(bool debugMode) { // ignore: do_not_use_environment const isTrace = String.fromEnvironment('LOG_TRACE') != ''; LogLevel logLevel; if (isTrace) { logLevel = traceLevel; } else { - logLevel = kDebugMode ? LogLevel.debug : LogLevel.info; + logLevel = debugMode ? LogLevel.debug : LogLevel.info; } setVeilidLogLevel(logLevel); } diff --git a/lib/veilid_support/veilid_support.dart b/packages/veilid_support/lib/veilid_support.dart similarity index 100% rename from lib/veilid_support/veilid_support.dart rename to packages/veilid_support/lib/veilid_support.dart diff --git a/packages/veilid_support/pubspec.lock b/packages/veilid_support/pubspec.lock new file mode 100644 index 0000000..cba74d2 --- /dev/null +++ b/packages/veilid_support/pubspec.lock @@ -0,0 +1,780 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051 + url: "https://pub.dev" + source: hosted + version: "64.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893" + url: "https://pub.dev" + source: hosted + version: "6.2.0" + args: + dependency: transitive + description: + name: args + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" + source: hosted + version: "2.4.2" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + build: + dependency: transitive + description: + name: build + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + build_config: + dependency: transitive + description: + name: build_config + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + url: "https://pub.dev" + source: hosted + version: "1.1.1" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "0343061a33da9c5810b2d6cee51945127d8f4c060b7fbdd9d54917f0a3feaaa1" + url: "https://pub.dev" + source: hosted + version: "4.0.1" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: "339086358431fa15d7eca8b6a36e5d783728cf025e559b834f4609a1fcfb7b0a" + url: "https://pub.dev" + source: hosted + version: "2.4.2" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: "67d591d602906ef9201caf93452495ad1812bea2074f04e25dbd7c133785821b" + url: "https://pub.dev" + source: hosted + version: "2.4.7" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: c9e32d21dd6626b5c163d48b037ce906bbe428bc23ab77bcd77bb21e593b6185 + url: "https://pub.dev" + source: hosted + version: "7.2.11" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: c9aabae0718ec394e5bc3c7272e6bb0dc0b32201a08fe185ec1d8401d3e39309 + url: "https://pub.dev" + source: hosted + version: "8.8.1" + change_case: + dependency: transitive + description: + name: change_case + sha256: f4e08feaa845e75e4f5ad2b0e15f24813d7ea6c27e7b78252f0c17f752cf1157 + url: "https://pub.dev" + source: hosted + version: "1.1.0" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + charcode: + dependency: transitive + description: + name: charcode + sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 + url: "https://pub.dev" + source: hosted + version: "1.3.1" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: feee43a5c05e7b3199bb375a86430b8ada1b04104f2923d0e03cc01ca87b6d84 + url: "https://pub.dev" + source: hosted + version: "4.9.0" + collection: + dependency: transitive + description: + name: collection + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a + url: "https://pub.dev" + source: hosted + version: "1.18.0" + convert: + dependency: transitive + description: + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + coverage: + dependency: transitive + description: + name: coverage + sha256: "8acabb8306b57a409bf4c83522065672ee13179297a6bb0cb9ead73948df7c76" + url: "https://pub.dev" + source: hosted + version: "1.7.2" + crypto: + dependency: transitive + description: + name: crypto + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" + source: hosted + version: "3.0.3" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "40ae61a5d43feea6d24bd22c0537a6629db858963b99b4bc1c3db80676f32368" + url: "https://pub.dev" + source: hosted + version: "2.3.4" + equatable: + dependency: transitive + description: + name: equatable + sha256: c2b87cb7756efdf69892005af546c56c0b5037f54d2a88269b4f347a505e3ca2 + url: "https://pub.dev" + source: hosted + version: "2.0.5" + fast_immutable_collections: + dependency: "direct main" + description: + name: fast_immutable_collections + sha256: "3eb1d7495c70598964add20e10666003fad6e855b108fe684ebcbf8ad0c8e120" + url: "https://pub.dev" + source: hosted + version: "9.2.0" + ffi: + dependency: transitive + description: + name: ffi + sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + file: + dependency: transitive + description: + name: file + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + file_utils: + dependency: transitive + description: + name: file_utils + sha256: d1e64389a22649095c8405c9e177272caf05139255931c9ff30d53b5c9bcaa34 + url: "https://pub.dev" + source: hosted + version: "1.0.1" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + flutter: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + freezed: + dependency: "direct dev" + description: + name: freezed + sha256: "6c5031daae12c7072b3a87eff98983076434b4889ef2a44384d0cae3f82372ba" + url: "https://pub.dev" + source: hosted + version: "2.4.6" + freezed_annotation: + dependency: "direct main" + description: + name: freezed_annotation + sha256: c3fd9336eb55a38cc1bbd79ab17573113a8deccd0ecbbf926cca3c62803b5c2d + url: "https://pub.dev" + source: hosted + version: "2.4.1" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + url: "https://pub.dev" + source: hosted + version: "3.2.0" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + globbing: + dependency: transitive + description: + name: globbing + sha256: "4f89cfaf6fa74c9c1740a96259da06bd45411ede56744e28017cc534a12b6e2d" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + graphs: + dependency: transitive + description: + name: graphs + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 + url: "https://pub.dev" + source: hosted + version: "2.3.1" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" + source: hosted + version: "3.2.1" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + io: + dependency: transitive + description: + name: io + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + json_annotation: + dependency: "direct main" + description: + name: json_annotation + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" + source: hosted + version: "4.8.1" + json_serializable: + dependency: "direct dev" + description: + name: json_serializable + sha256: aa1f5a8912615733e0fdc7a02af03308933c93235bdc8d50d0b0c8a8ccb0b969 + url: "https://pub.dev" + source: hosted + version: "6.7.1" + lint_hard: + dependency: "direct dev" + description: + name: lint_hard + sha256: "44d15ec309b1a8e1aff99069df9dcb1597f49d5f588f32811ca28fb7b38c32fe" + url: "https://pub.dev" + source: hosted + version: "4.0.0" + logging: + dependency: transitive + description: + name: logging + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + loggy: + dependency: "direct main" + description: + name: loggy + sha256: "981e03162bbd3a5a843026f75f73d26e4a0d8aa035ae060456ca7b30dfd1e339" + url: "https://pub.dev" + source: hosted + version: "2.0.3" + matcher: + dependency: transitive + description: + name: matcher + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" + source: hosted + version: "0.12.16+1" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + url: "https://pub.dev" + source: hosted + version: "0.5.0" + meta: + dependency: transitive + description: + name: meta + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + url: "https://pub.dev" + source: hosted + version: "1.10.0" + mime: + dependency: transitive + description: + name: mime + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + url: "https://pub.dev" + source: hosted + version: "1.0.4" + mutex: + dependency: "direct main" + description: + name: mutex + sha256: "8827da25de792088eb33e572115a5eb0d61d61a3c01acbc8bcbe76ed78f1a1f2" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + node_preamble: + dependency: transitive + description: + name: node_preamble + sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + path: + dependency: transitive + description: + name: path + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" + source: hosted + version: "1.9.0" + path_provider: + dependency: transitive + description: + name: path_provider + sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa + url: "https://pub.dev" + source: hosted + version: "2.1.1" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: "477184d672607c0a3bf68fbbf601805f92ef79c82b64b4d6eb318cbca4c48668" + url: "https://pub.dev" + source: hosted + version: "2.2.2" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d" + url: "https://pub.dev" + source: hosted + version: "2.3.1" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + url: "https://pub.dev" + source: hosted + version: "2.2.1" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: "8bc9f22eee8690981c22aa7fc602f5c85b497a6fb2ceb35ee5a5e5ed85ad8170" + url: "https://pub.dev" + source: hosted + version: "2.2.1" + platform: + dependency: transitive + description: + name: platform + sha256: "0a279f0707af40c890e80b1e9df8bb761694c074ba7e1d4ab1bc4b728e200b59" + url: "https://pub.dev" + source: hosted + version: "3.1.3" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: f4f88d4a900933e7267e2b353594774fc0d07fb072b47eedcd5b54e1ea3269f8 + url: "https://pub.dev" + source: hosted + version: "2.1.7" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + protobuf: + dependency: "direct main" + description: + name: protobuf + sha256: "68645b24e0716782e58948f8467fd42a880f255096a821f9e7d0ec625b00c84d" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 + url: "https://pub.dev" + source: hosted + version: "1.2.3" + shelf: + dependency: transitive + description: + name: shelf + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" + source: hosted + version: "1.4.1" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + shelf_static: + dependency: transitive + description: + name: shelf_static + sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e + url: "https://pub.dev" + source: hosted + version: "1.1.2" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: "14658ba5f669685cd3d63701d01b31ea748310f7ab854e471962670abcf57832" + url: "https://pub.dev" + source: hosted + version: "1.5.0" + source_helper: + dependency: transitive + description: + name: source_helper + sha256: "6adebc0006c37dd63fe05bca0a929b99f06402fc95aa35bf36d67f5c06de01fd" + url: "https://pub.dev" + source: hosted + version: "1.3.4" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + source_maps: + dependency: transitive + description: + name: source_maps + sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" + url: "https://pub.dev" + source: hosted + version: "0.10.12" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" + source: hosted + version: "1.11.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + system_info2: + dependency: transitive + description: + name: system_info2 + sha256: af2f948e3f31a3367a049932a8ad59faf0063ecf836a020d975b9f41566d8bc9 + url: "https://pub.dev" + source: hosted + version: "3.0.2" + system_info_plus: + dependency: transitive + description: + name: system_info_plus + sha256: b915c811c6605b802f3988859bc2bb79c95f735762a75b5451741f7a2b949d1b + url: "https://pub.dev" + source: hosted + version: "0.0.5" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test: + dependency: "direct dev" + description: + name: test + sha256: "3d028996109ad5c253674c7f347822fb994a087614d6f353e6039704b4661ff2" + url: "https://pub.dev" + source: hosted + version: "1.25.0" + test_api: + dependency: transitive + description: + name: test_api + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + test_core: + dependency: transitive + description: + name: test_core + sha256: "2bc4b4ecddd75309300d8096f781c0e3280ca1ef85beda558d33fcbedc2eead4" + url: "https://pub.dev" + source: hosted + version: "0.6.0" + timing: + dependency: transitive + description: + name: timing + sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + veilid: + dependency: "direct main" + description: + path: "../../../veilid/veilid-flutter" + relative: true + source: path + version: "0.2.5" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: a2662fb1f114f4296cf3f5a50786a2d888268d7776cf681aa17d660ffa23b246 + url: "https://pub.dev" + source: hosted + version: "14.0.0" + watcher: + dependency: transitive + description: + name: watcher + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + web: + dependency: transitive + description: + name: web + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + url: "https://pub.dev" + source: hosted + version: "0.3.0" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + url: "https://pub.dev" + source: hosted + version: "2.4.0" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + sha256: "87d3f2333bb240704cd3f1c6b5b7acd8a10e7f0bc28c28dcf14e782014f4a572" + url: "https://pub.dev" + source: hosted + version: "1.2.1" + win32: + dependency: transitive + description: + name: win32 + sha256: b0f37db61ba2f2e9b7a78a1caece0052564d1bc70668156cf3a29d676fe4e574 + url: "https://pub.dev" + source: hosted + version: "5.1.1" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: "589ada45ba9e39405c198fe34eb0f607cddb2108527e658136120892beac46d2" + url: "https://pub.dev" + source: hosted + version: "1.0.3" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" +sdks: + dart: ">=3.2.0-194.0.dev <4.0.0" + flutter: ">=3.10.6" diff --git a/packages/veilid_support/pubspec.yaml b/packages/veilid_support/pubspec.yaml new file mode 100644 index 0000000..397b24b --- /dev/null +++ b/packages/veilid_support/pubspec.yaml @@ -0,0 +1,26 @@ +name: veilid_support +description: Veilid Support Library +publish_to: 'none' +version: 1.0.2+0 + +environment: + sdk: '>=3.0.5 <4.0.0' + flutter: ">=3.10.0" + +dependencies: + fast_immutable_collections: ^9.1.5 + freezed_annotation: ^2.2.0 + json_annotation: ^4.8.1 + loggy: ^2.0.3 + mutex: ^3.1.0 + protobuf: ^3.0.0 + veilid: + # veilid: ^0.0.1 + path: ../../../veilid/veilid-flutter + +dev_dependencies: + build_runner: ^2.4.6 + test: ^1.25.0 + freezed: ^2.3.5 + json_serializable: ^6.7.1 + lint_hard: ^4.0.0 diff --git a/pubspec.lock b/pubspec.lock index 72af3e7..036283a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -21,10 +21,10 @@ packages: dependency: "direct main" description: name: animated_theme_switcher - sha256: de8ce9872d6e6676ab1140f76ff00cd0084a9dfee62168044062629927949652 + sha256: "24ccd74437b8db78f6d1ec701804702817bced5f925b1b3419c7a93071e3d3e9" url: "https://pub.dev" source: hosted - version: "2.0.9" + version: "2.0.10" ansicolor: dependency: "direct main" description: @@ -61,10 +61,10 @@ packages: dependency: "direct main" description: name: awesome_extensions - sha256: "79bb5a24f1224795e599c75ec047ca6f4718e17be535544350d213bb37bc88cd" + sha256: a8b68d567119b9be85bc62d8dc2ab6712d74c0130bdc31a52c53d1058c4fe33a url: "https://pub.dev" source: hosted - version: "2.0.10" + version: "2.0.11" badges: dependency: "direct main" description: @@ -897,10 +897,10 @@ packages: dependency: transitive description: name: path_provider_android - sha256: e595b98692943b4881b219f0a9e3945118d3c16bd7e2813f98ec6e532d905f72 + sha256: "477184d672607c0a3bf68fbbf601805f92ef79c82b64b4d6eb318cbca4c48668" url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.2.2" path_provider_foundation: dependency: transitive description: @@ -1505,6 +1505,13 @@ packages: relative: true source: path version: "0.2.5" + veilid_support: + dependency: "direct main" + description: + path: "packages/veilid_support" + relative: true + source: path + version: "1.0.2+0" visibility_detector: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index b061813..fc88a54 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -75,6 +75,8 @@ dependencies: veilid: # veilid: ^0.0.1 path: ../veilid/veilid-flutter + veilid_support: + path: packages/veilid_support window_manager: ^0.3.5 xterm: ^3.5.0 zxing2: ^0.2.0