From 43b01c75555e84aa29fbd3c0a9942712702dc6ab Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Mon, 26 Feb 2024 23:34:17 -0500 Subject: [PATCH] refactor bloc tools to its own package --- lib/chat/cubits/active_chat_cubit.dart | 2 +- ..._conversation_messages_bloc_map_cubit.dart | 2 +- .../active_conversations_bloc_map_cubit.dart | 2 +- lib/chat_list/cubits/chat_list_cubit.dart | 2 + .../chat_single_contact_list_widget.dart | 1 - .../cubits/waiting_invitation_cubit.dart | 1 + .../waiting_invitations_bloc_map_cubit.dart | 2 +- .../views/contact_invitation_display.dart | 1 + lib/contacts/cubits/conversation_cubit.dart | 2 +- lib/contacts/views/contact_list_widget.dart | 1 - lib/settings/preferences_cubit.dart | 3 +- lib/tools/tools.dart | 7 -- .../cubit/connection_state_cubit.dart | 3 +- packages/async_tools/pubspec.yaml | 8 +- packages/bloc_tools/.gitignore | 7 ++ packages/bloc_tools/analysis_options.yaml | 15 +++ .../example/bloc_tools_example.dart | 6 ++ packages/bloc_tools/lib/bloc_tools.dart | 11 ++ .../lib/src}/async_transformer_cubit.dart | 0 .../bloc_tools/lib/src/bloc_busy_wrapper.dart | 54 ++++++++++ .../bloc_tools/lib/src}/bloc_map_cubit.dart | 0 .../lib/src/bloc_tools_extension.dart | 0 .../bloc_tools/lib/src}/future_cubit.dart | 0 .../bloc_tools/lib/src}/state_follower.dart | 0 .../lib/src}/stream_wrapper_cubit.dart | 0 .../lib/src}/transformer_cubit.dart | 0 packages/bloc_tools/pubspec.yaml | 24 +++++ packages/bloc_tools/test/bloc_tools_test.dart | 16 +++ packages/mutex/pubspec.yaml | 6 +- .../src/dht_short_array_cubit.dart | 35 +++--- packages/veilid_support/pubspec.lock | 77 +++++++------ packages/veilid_support/pubspec.yaml | 18 ++-- pubspec.lock | 102 +++++++++--------- pubspec.yaml | 22 ++-- 34 files changed, 284 insertions(+), 146 deletions(-) create mode 100644 packages/bloc_tools/.gitignore create mode 100644 packages/bloc_tools/analysis_options.yaml create mode 100644 packages/bloc_tools/example/bloc_tools_example.dart create mode 100644 packages/bloc_tools/lib/bloc_tools.dart rename {lib/tools => packages/bloc_tools/lib/src}/async_transformer_cubit.dart (100%) create mode 100644 packages/bloc_tools/lib/src/bloc_busy_wrapper.dart rename {lib/tools => packages/bloc_tools/lib/src}/bloc_map_cubit.dart (100%) rename lib/tools/bloc_tools.dart => packages/bloc_tools/lib/src/bloc_tools_extension.dart (100%) rename {lib/tools => packages/bloc_tools/lib/src}/future_cubit.dart (100%) rename {lib/tools => packages/bloc_tools/lib/src}/state_follower.dart (100%) rename {lib/tools => packages/bloc_tools/lib/src}/stream_wrapper_cubit.dart (100%) rename {lib/tools => packages/bloc_tools/lib/src}/transformer_cubit.dart (100%) create mode 100644 packages/bloc_tools/pubspec.yaml create mode 100644 packages/bloc_tools/test/bloc_tools_test.dart diff --git a/lib/chat/cubits/active_chat_cubit.dart b/lib/chat/cubits/active_chat_cubit.dart index fa88d56..5c7119d 100644 --- a/lib/chat/cubits/active_chat_cubit.dart +++ b/lib/chat/cubits/active_chat_cubit.dart @@ -1,7 +1,7 @@ +import 'package:bloc_tools/bloc_tools.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:veilid_support/veilid_support.dart'; -import '../../tools/tools.dart'; class ActiveChatCubit extends Cubit with BlocTools { ActiveChatCubit(super.initialState); diff --git a/lib/chat_list/cubits/active_conversation_messages_bloc_map_cubit.dart b/lib/chat_list/cubits/active_conversation_messages_bloc_map_cubit.dart index a906bfc..3fd47f2 100644 --- a/lib/chat_list/cubits/active_conversation_messages_bloc_map_cubit.dart +++ b/lib/chat_list/cubits/active_conversation_messages_bloc_map_cubit.dart @@ -1,13 +1,13 @@ import 'dart:async'; import 'package:async_tools/async_tools.dart'; +import 'package:bloc_tools/bloc_tools.dart'; import 'package:fast_immutable_collections/fast_immutable_collections.dart'; import 'package:veilid_support/veilid_support.dart'; import '../../account_manager/account_manager.dart'; import '../../chat/chat.dart'; import '../../proto/proto.dart' as proto; -import '../../tools/tools.dart'; import 'active_conversations_bloc_map_cubit.dart'; // Map of remoteConversationRecordKey to MessagesCubit diff --git a/lib/chat_list/cubits/active_conversations_bloc_map_cubit.dart b/lib/chat_list/cubits/active_conversations_bloc_map_cubit.dart index 78bf8ff..0c32523 100644 --- a/lib/chat_list/cubits/active_conversations_bloc_map_cubit.dart +++ b/lib/chat_list/cubits/active_conversations_bloc_map_cubit.dart @@ -1,4 +1,5 @@ import 'package:async_tools/async_tools.dart'; +import 'package:bloc_tools/bloc_tools.dart'; import 'package:equatable/equatable.dart'; import 'package:fast_immutable_collections/fast_immutable_collections.dart'; import 'package:meta/meta.dart'; @@ -7,7 +8,6 @@ import 'package:veilid_support/veilid_support.dart'; import '../../account_manager/account_manager.dart'; import '../../contacts/contacts.dart'; import '../../proto/proto.dart' as proto; -import '../../tools/tools.dart'; @immutable class ActiveConversationState extends Equatable { diff --git a/lib/chat_list/cubits/chat_list_cubit.dart b/lib/chat_list/cubits/chat_list_cubit.dart index f0b85ee..606c5b8 100644 --- a/lib/chat_list/cubits/chat_list_cubit.dart +++ b/lib/chat_list/cubits/chat_list_cubit.dart @@ -1,5 +1,7 @@ import 'dart:async'; +import 'package:bloc/bloc.dart'; +import 'package:bloc_tools/bloc_tools.dart'; import 'package:veilid_support/veilid_support.dart'; import '../../account_manager/account_manager.dart'; diff --git a/lib/chat_list/views/chat_single_contact_list_widget.dart b/lib/chat_list/views/chat_single_contact_list_widget.dart index 4a31e2d..4331187 100644 --- a/lib/chat_list/views/chat_single_contact_list_widget.dart +++ b/lib/chat_list/views/chat_single_contact_list_widget.dart @@ -37,7 +37,6 @@ class ChatSingleContactListWidget extends StatelessWidget { child: (chatList.isEmpty) ? const EmptyChatListWidget() : SearchableList( - autoFocusOnSearch: false, initialList: chatList.toList(), builder: (l, i, c) { final contact = diff --git a/lib/contact_invitation/cubits/waiting_invitation_cubit.dart b/lib/contact_invitation/cubits/waiting_invitation_cubit.dart index 0c618c0..04342e0 100644 --- a/lib/contact_invitation/cubits/waiting_invitation_cubit.dart +++ b/lib/contact_invitation/cubits/waiting_invitation_cubit.dart @@ -1,6 +1,7 @@ import 'dart:typed_data'; import 'package:async_tools/async_tools.dart'; +import 'package:bloc_tools/bloc_tools.dart'; import 'package:equatable/equatable.dart'; import 'package:meta/meta.dart'; import 'package:veilid_support/veilid_support.dart'; diff --git a/lib/contact_invitation/cubits/waiting_invitations_bloc_map_cubit.dart b/lib/contact_invitation/cubits/waiting_invitations_bloc_map_cubit.dart index 15f0649..3762d28 100644 --- a/lib/contact_invitation/cubits/waiting_invitations_bloc_map_cubit.dart +++ b/lib/contact_invitation/cubits/waiting_invitations_bloc_map_cubit.dart @@ -1,10 +1,10 @@ import 'package:async_tools/async_tools.dart'; +import 'package:bloc_tools/bloc_tools.dart'; import 'package:fast_immutable_collections/fast_immutable_collections.dart'; import 'package:veilid_support/veilid_support.dart'; import '../../account_manager/account_manager.dart'; import '../../proto/proto.dart' as proto; -import '../../tools/tools.dart'; import 'cubits.dart'; typedef WaitingInvitationsBlocMapState diff --git a/lib/contact_invitation/views/contact_invitation_display.dart b/lib/contact_invitation/views/contact_invitation_display.dart index 4e75f57..fe2ed33 100644 --- a/lib/contact_invitation/views/contact_invitation_display.dart +++ b/lib/contact_invitation/views/contact_invitation_display.dart @@ -2,6 +2,7 @@ import 'dart:math'; import 'package:awesome_extensions/awesome_extensions.dart'; import 'package:basic_utils/basic_utils.dart'; +import 'package:bloc_tools/bloc_tools.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; diff --git a/lib/contacts/cubits/conversation_cubit.dart b/lib/contacts/cubits/conversation_cubit.dart index c927a1b..91ae098 100644 --- a/lib/contacts/cubits/conversation_cubit.dart +++ b/lib/contacts/cubits/conversation_cubit.dart @@ -64,7 +64,7 @@ class ConversationCubit extends Cubit> { // Open remote record key if it is specified final pool = DHTRecordPool.instance; final crypto = await getConversationCrypto(); - final record = await pool.openRead(_remoteConversationRecordKey!, + final record = await pool.openRead(_remoteConversationRecordKey, parent: accountRecordKey, crypto: crypto); await _setRemoteConversation(record); }); diff --git a/lib/contacts/views/contact_list_widget.dart b/lib/contacts/views/contact_list_widget.dart index 12a4d0a..10c4a64 100644 --- a/lib/contacts/views/contact_list_widget.dart +++ b/lib/contacts/views/contact_list_widget.dart @@ -35,7 +35,6 @@ class ContactListWidget extends StatelessWidget { child: (contactList.isEmpty) ? const EmptyContactListWidget() : SearchableList( - autoFocusOnSearch: false, initialList: contactList.toList(), builder: (l, i, c) => ContactItemWidget(contact: c), filter: (value) { diff --git a/lib/settings/preferences_cubit.dart b/lib/settings/preferences_cubit.dart index 5d85ce5..6cfd249 100644 --- a/lib/settings/preferences_cubit.dart +++ b/lib/settings/preferences_cubit.dart @@ -1,4 +1,5 @@ -import '../tools/tools.dart'; +import 'package:bloc_tools/bloc_tools.dart'; + import 'settings.dart'; class PreferencesCubit extends StreamWrapperCubit { diff --git a/lib/tools/tools.dart b/lib/tools/tools.dart index 4c9cf07..0457d43 100644 --- a/lib/tools/tools.dart +++ b/lib/tools/tools.dart @@ -1,19 +1,12 @@ export 'animations.dart'; -export 'async_transformer_cubit.dart'; -export 'bloc_map_cubit.dart'; -export 'bloc_tools.dart'; export 'enter_password.dart'; export 'enter_pin.dart'; -export 'future_cubit.dart'; export 'loggy.dart'; export 'phono_byte.dart'; export 'responsive.dart'; export 'scanner_error_widget.dart'; export 'shared_preferences.dart'; -export 'state_follower.dart'; export 'state_logger.dart'; export 'stream_listenable.dart'; -export 'stream_wrapper_cubit.dart'; -export 'transformer_cubit.dart'; export 'widget_helpers.dart'; export 'window_control.dart'; diff --git a/lib/veilid_processor/cubit/connection_state_cubit.dart b/lib/veilid_processor/cubit/connection_state_cubit.dart index e3ef7fa..8bf18f8 100644 --- a/lib/veilid_processor/cubit/connection_state_cubit.dart +++ b/lib/veilid_processor/cubit/connection_state_cubit.dart @@ -1,4 +1,5 @@ -import '../../tools/tools.dart'; +import 'package:bloc_tools/bloc_tools.dart'; + import '../models/models.dart'; import '../repository/processor_repository.dart'; diff --git a/packages/async_tools/pubspec.yaml b/packages/async_tools/pubspec.yaml index 34ae0a4..42d7a71 100644 --- a/packages/async_tools/pubspec.yaml +++ b/packages/async_tools/pubspec.yaml @@ -4,16 +4,16 @@ version: 1.0.0 publish_to: none environment: - sdk: ^3.2.6 + sdk: '>=3.2.0 <4.0.0' # Add regular dependencies here. dependencies: - freezed_annotation: ^2.2.0 + freezed_annotation: ^2.4.1 mutex: path: ../mutex dev_dependencies: build_runner: ^2.4.8 - freezed: ^2.3.5 + freezed: ^2.4.7 lint_hard: ^4.0.0 - test: ^1.24.0 + test: ^1.25.2 diff --git a/packages/bloc_tools/.gitignore b/packages/bloc_tools/.gitignore new file mode 100644 index 0000000..3cceda5 --- /dev/null +++ b/packages/bloc_tools/.gitignore @@ -0,0 +1,7 @@ +# https://dart.dev/guides/libraries/private-files +# Created by `dart pub` +.dart_tool/ + +# Avoid committing pubspec.lock for library packages; see +# https://dart.dev/guides/libraries/private-files#pubspeclock. +pubspec.lock diff --git a/packages/bloc_tools/analysis_options.yaml b/packages/bloc_tools/analysis_options.yaml new file mode 100644 index 0000000..e1620f7 --- /dev/null +++ b/packages/bloc_tools/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/bloc_tools/example/bloc_tools_example.dart b/packages/bloc_tools/example/bloc_tools_example.dart new file mode 100644 index 0000000..25e6326 --- /dev/null +++ b/packages/bloc_tools/example/bloc_tools_example.dart @@ -0,0 +1,6 @@ +// import 'package:bloc_tools/bloc_tools.dart'; + +// void main() { +// var awesome = Awesome(); +// print('awesome: ${awesome.isAwesome}'); +// } diff --git a/packages/bloc_tools/lib/bloc_tools.dart b/packages/bloc_tools/lib/bloc_tools.dart new file mode 100644 index 0000000..4cc7304 --- /dev/null +++ b/packages/bloc_tools/lib/bloc_tools.dart @@ -0,0 +1,11 @@ +/// BLoC Tools +library; + +export 'src/async_transformer_cubit.dart'; +export 'src/bloc_busy_wrapper.dart'; +export 'src/bloc_map_cubit.dart'; +export 'src/bloc_tools_extension.dart'; +export 'src/future_cubit.dart'; +export 'src/state_follower.dart'; +export 'src/stream_wrapper_cubit.dart'; +export 'src/transformer_cubit.dart'; diff --git a/lib/tools/async_transformer_cubit.dart b/packages/bloc_tools/lib/src/async_transformer_cubit.dart similarity index 100% rename from lib/tools/async_transformer_cubit.dart rename to packages/bloc_tools/lib/src/async_transformer_cubit.dart diff --git a/packages/bloc_tools/lib/src/bloc_busy_wrapper.dart b/packages/bloc_tools/lib/src/bloc_busy_wrapper.dart new file mode 100644 index 0000000..a6bb2d7 --- /dev/null +++ b/packages/bloc_tools/lib/src/bloc_busy_wrapper.dart @@ -0,0 +1,54 @@ +import 'dart:async'; + +import 'package:bloc/bloc.dart'; +import 'package:equatable/equatable.dart'; +import 'package:meta/meta.dart'; +import 'package:mutex/mutex.dart'; + +@immutable +class BlocBusyState extends Equatable { + const BlocBusyState(this.state) : busy = false; + const BlocBusyState._busy(this.state) : busy = true; + final bool busy; + final S state; + + @override + List get props => [busy, state]; +} + +mixin BlocBusyWrapper on BlocBase> { + Future busy(Future Function(void Function(S) emit) closure) async => + _mutex.protect(() async { + void busyemit(S state) { + changedState = state; + } + + // Turn on busy state + emit(BlocBusyState._busy(state.state)); + + // Run the closure + final out = await closure(busyemit); + + // If the closure did one or more 'busy emits' then + // take the most recent one and emit it for real + final finalState = changedState; + if (finalState != null && finalState != state.state) { + emit(BlocBusyState._busy(finalState)); + } else { + emit(BlocBusyState._busy(state.state)); + } + + return out; + }); + + void changeState(S state) { + if (_mutex.isLocked) { + changedState = state; + } else { + emit(BlocBusyState(state)); + } + } + + final Mutex _mutex = Mutex(); + S? changedState; +} diff --git a/lib/tools/bloc_map_cubit.dart b/packages/bloc_tools/lib/src/bloc_map_cubit.dart similarity index 100% rename from lib/tools/bloc_map_cubit.dart rename to packages/bloc_tools/lib/src/bloc_map_cubit.dart diff --git a/lib/tools/bloc_tools.dart b/packages/bloc_tools/lib/src/bloc_tools_extension.dart similarity index 100% rename from lib/tools/bloc_tools.dart rename to packages/bloc_tools/lib/src/bloc_tools_extension.dart diff --git a/lib/tools/future_cubit.dart b/packages/bloc_tools/lib/src/future_cubit.dart similarity index 100% rename from lib/tools/future_cubit.dart rename to packages/bloc_tools/lib/src/future_cubit.dart diff --git a/lib/tools/state_follower.dart b/packages/bloc_tools/lib/src/state_follower.dart similarity index 100% rename from lib/tools/state_follower.dart rename to packages/bloc_tools/lib/src/state_follower.dart diff --git a/lib/tools/stream_wrapper_cubit.dart b/packages/bloc_tools/lib/src/stream_wrapper_cubit.dart similarity index 100% rename from lib/tools/stream_wrapper_cubit.dart rename to packages/bloc_tools/lib/src/stream_wrapper_cubit.dart diff --git a/lib/tools/transformer_cubit.dart b/packages/bloc_tools/lib/src/transformer_cubit.dart similarity index 100% rename from lib/tools/transformer_cubit.dart rename to packages/bloc_tools/lib/src/transformer_cubit.dart diff --git a/packages/bloc_tools/pubspec.yaml b/packages/bloc_tools/pubspec.yaml new file mode 100644 index 0000000..73bbe16 --- /dev/null +++ b/packages/bloc_tools/pubspec.yaml @@ -0,0 +1,24 @@ +name: bloc_tools +description: A starting point for Dart libraries or applications. +version: 1.0.0 +publish_to: none + +environment: + sdk: '>=3.2.0 <4.0.0' + +dependencies: + async_tools: + path: ../async_tools + bloc: ^8.1.3 + equatable: ^2.0.5 + fast_immutable_collections: ^10.1.1 + freezed_annotation: ^2.4.1 + meta: ^1.10.0 + mutex: + path: ../mutex + +dev_dependencies: + build_runner: ^2.4.8 + freezed: ^2.4.7 + lint_hard: ^4.0.0 + test: ^1.25.2 \ No newline at end of file diff --git a/packages/bloc_tools/test/bloc_tools_test.dart b/packages/bloc_tools/test/bloc_tools_test.dart new file mode 100644 index 0000000..5a81be4 --- /dev/null +++ b/packages/bloc_tools/test/bloc_tools_test.dart @@ -0,0 +1,16 @@ +// import 'package:bloc_tools/bloc_tools.dart'; +// import 'package:test/test.dart'; + +// void main() { +// group('A group of tests', () { +// final awesome = Awesome(); + +// setUp(() { +// // Additional setup goes here. +// }); + +// test('First Test', () { +// expect(awesome.isAwesome, isTrue); +// }); +// }); +// } diff --git a/packages/mutex/pubspec.yaml b/packages/mutex/pubspec.yaml index 52d86a1..30db4a2 100644 --- a/packages/mutex/pubspec.yaml +++ b/packages/mutex/pubspec.yaml @@ -4,9 +4,9 @@ version: 3.1.0 publish_to: none environment: - sdk: '>=2.15.0 <4.0.0' + sdk: '>=3.2.0 <4.0.0' dev_dependencies: lint_hard: ^4.0.0 - pana: ^0.21.37 - test: ^1.16.3 + pana: ^0.21.45 + test: ^1.25.2 diff --git a/packages/veilid_support/lib/dht_support/src/dht_short_array_cubit.dart b/packages/veilid_support/lib/dht_support/src/dht_short_array_cubit.dart index cbcd54d..79837b2 100644 --- a/packages/veilid_support/lib/dht_support/src/dht_short_array_cubit.dart +++ b/packages/veilid_support/lib/dht_support/src/dht_short_array_cubit.dart @@ -2,11 +2,13 @@ import 'dart:async'; import 'package:async_tools/async_tools.dart'; import 'package:bloc/bloc.dart'; +import 'package:bloc_tools/bloc_tools.dart'; import 'package:fast_immutable_collections/fast_immutable_collections.dart'; import '../../veilid_support.dart'; -class DHTShortArrayCubit extends Cubit>> { +class DHTShortArrayCubit extends Cubit>>> + with BlocBusyWrapper>> { DHTShortArrayCubit({ required Future Function() open, required T Function(List data) decodeElement, @@ -14,7 +16,7 @@ class DHTShortArrayCubit extends Cubit>> { _wantsUpdate = false, _isUpdating = false, _wantsCloseRecord = false, - super(const AsyncValue.loading()) { + super(const BlocBusyState(AsyncValue.loading())) { Future.delayed(Duration.zero, () async { // Open DHT record _shortArray = await open(); @@ -34,7 +36,7 @@ class DHTShortArrayCubit extends Cubit>> { _wantsUpdate = false, _isUpdating = false, _wantsCloseRecord = false, - super(const AsyncValue.loading()) { + super(const BlocBusyState(AsyncValue.loading())) { // Make initial state update _update(); Future.delayed(Duration.zero, () async { @@ -42,21 +44,24 @@ class DHTShortArrayCubit extends Cubit>> { }); } - Future refresh({bool forceRefresh = false}) async { - var out = IList(); - // xxx could be parallelized but we need to watch out for rate limits - for (var i = 0; i < _shortArray.length; i++) { - final cir = await _shortArray.getItem(i, forceRefresh: forceRefresh); - if (cir == null) { - throw Exception('Failed to get short array element'); - } - out = out.add(_decodeElement(cir)); - } - emit(AsyncValue.data(out)); - } + Future refresh({bool forceRefresh = false}) async => busy((emit) async { + var out = IList(); + // xxx could be parallelized but we need to watch out for rate limits + for (var i = 0; i < _shortArray.length; i++) { + final cir = await _shortArray.getItem(i, forceRefresh: forceRefresh); + if (cir == null) { + throw Exception('Failed to get short array element'); + } + out = out.add(_decodeElement(cir)); + } + emit(AsyncValue.data(out)); + }); void _update() { // Run at most one background update process + +xxx convert to singleFuture with onBusy that sets wantsupdate + _wantsUpdate = true; if (_isUpdating) { return; diff --git a/packages/veilid_support/pubspec.lock b/packages/veilid_support/pubspec.lock index 3ce09e2..ede8275 100644 --- a/packages/veilid_support/pubspec.lock +++ b/packages/veilid_support/pubspec.lock @@ -44,10 +44,17 @@ packages: dependency: "direct main" description: name: bloc - sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49" + sha256: f53a110e3b48dcd78136c10daa5d51512443cea5e1348c9d80a320095fa2db9e url: "https://pub.dev" source: hosted - version: "8.1.2" + version: "8.1.3" + bloc_tools: + dependency: "direct main" + description: + path: "../bloc_tools" + relative: true + source: path + version: "1.0.0" boolean_selector: dependency: transitive description: @@ -92,18 +99,18 @@ packages: dependency: "direct dev" description: name: build_runner - sha256: "67d591d602906ef9201caf93452495ad1812bea2074f04e25dbd7c133785821b" + sha256: "581bacf68f89ec8792f5e5a0b2c4decd1c948e97ce659dc783688c8a88fbec21" url: "https://pub.dev" source: hosted - version: "2.4.7" + version: "2.4.8" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: c9e32d21dd6626b5c163d48b037ce906bbe428bc23ab77bcd77bb21e593b6185 + sha256: "4ae8ffe5ac758da294ecf1802f2aff01558d8b1b00616aa7538ea9a8a5d50799" url: "https://pub.dev" source: hosted - version: "7.2.11" + version: "7.3.0" built_collection: dependency: transitive description: @@ -116,10 +123,10 @@ packages: dependency: transitive description: name: built_value - sha256: c9aabae0718ec394e5bc3c7272e6bb0dc0b32201a08fe185ec1d8401d3e39309 + sha256: fedde275e0a6b798c3296963c5cd224e3e1b55d0e478d5b7e65e6b540f363a0e url: "https://pub.dev" source: hosted - version: "8.8.1" + version: "8.9.1" change_case: dependency: transitive description: @@ -156,10 +163,10 @@ packages: dependency: transitive description: name: code_builder - sha256: feee43a5c05e7b3199bb375a86430b8ada1b04104f2923d0e03cc01ca87b6d84 + sha256: f692079e25e7869c14132d39f223f8eec9830eb76131925143b2129c4bb01b37 url: "https://pub.dev" source: hosted - version: "4.9.0" + version: "4.10.0" collection: dependency: transitive description: @@ -212,10 +219,10 @@ packages: dependency: "direct main" description: name: fast_immutable_collections - sha256: "3eb1d7495c70598964add20e10666003fad6e855b108fe684ebcbf8ad0c8e120" + sha256: "6df5b5bb29f52644c4c653ef0ae7d26c8463f8d6551b0ac94561103ff6c5ca17" url: "https://pub.dev" source: hosted - version: "9.2.0" + version: "10.1.1" ffi: dependency: transitive description: @@ -262,10 +269,10 @@ packages: dependency: "direct dev" description: name: freezed - sha256: "6c5031daae12c7072b3a87eff98983076434b4889ef2a44384d0cae3f82372ba" + sha256: "57247f692f35f068cae297549a46a9a097100685c6780fe67177503eea5ed4e5" url: "https://pub.dev" source: hosted - version: "2.4.6" + version: "2.4.7" freezed_annotation: dependency: "direct main" description: @@ -334,10 +341,10 @@ packages: dependency: transitive description: name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + sha256: c1b2e9b5ea78c45e1a0788d29606ba27dc5f71f019f32ca5140f61ef071838cf url: "https://pub.dev" source: hosted - version: "0.6.7" + version: "0.7.1" json_annotation: dependency: "direct main" description: @@ -406,10 +413,10 @@ packages: dependency: transitive description: name: mime - sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2" url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.0.5" mutex: dependency: "direct main" description: @@ -445,10 +452,10 @@ packages: dependency: transitive description: name: path_provider - sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa + sha256: b27217933eeeba8ff24845c34003b003b2b22151de3c908d0e679e8fe1aa078b url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" path_provider_android: dependency: transitive description: @@ -461,10 +468,10 @@ packages: dependency: transitive description: name: path_provider_foundation - sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d" + sha256: "5a7999be66e000916500be4f15a3633ebceb8302719b47b9cc49ce924125350f" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.2" path_provider_linux: dependency: transitive description: @@ -477,10 +484,10 @@ packages: dependency: transitive description: name: path_provider_platform_interface - sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c" + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" path_provider_windows: dependency: transitive description: @@ -493,18 +500,18 @@ packages: dependency: transitive description: name: platform - sha256: "0a279f0707af40c890e80b1e9df8bb761694c074ba7e1d4ab1bc4b728e200b59" + sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" url: "https://pub.dev" source: hosted - version: "3.1.3" + version: "3.1.4" plugin_platform_interface: dependency: transitive description: name: plugin_platform_interface - sha256: f4f88d4a900933e7267e2b353594774fc0d07fb072b47eedcd5b54e1ea3269f8 + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" url: "https://pub.dev" source: hosted - version: "2.1.7" + version: "2.1.8" pool: dependency: transitive description: @@ -674,10 +681,10 @@ packages: dependency: "direct dev" description: name: test - sha256: "3d028996109ad5c253674c7f347822fb994a087614d6f353e6039704b4661ff2" + sha256: "7ee446762c2c50b3bd4ea96fe13ffac69919352bd3b4b17bac3f3465edc58073" url: "https://pub.dev" source: hosted - version: "1.25.0" + version: "1.25.2" test_api: dependency: transitive description: @@ -769,18 +776,18 @@ packages: dependency: transitive description: name: win32 - sha256: b0f37db61ba2f2e9b7a78a1caece0052564d1bc70668156cf3a29d676fe4e574 + sha256: "464f5674532865248444b4c3daca12bd9bf2d7c47f759ce2617986e7229494a8" url: "https://pub.dev" source: hosted - version: "5.1.1" + version: "5.2.0" xdg_directories: dependency: transitive description: name: xdg_directories - sha256: "589ada45ba9e39405c198fe34eb0f607cddb2108527e658136120892beac46d2" + sha256: faea9dee56b520b55a566385b84f2e8de55e7496104adada9962e0bd11bcff1d url: "https://pub.dev" source: hosted - version: "1.0.3" + version: "1.0.4" yaml: dependency: transitive description: @@ -790,5 +797,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.2.6 <4.0.0" + dart: ">=3.2.0 <4.0.0" flutter: ">=3.10.6" diff --git a/packages/veilid_support/pubspec.yaml b/packages/veilid_support/pubspec.yaml index acbe5af..7d03995 100644 --- a/packages/veilid_support/pubspec.yaml +++ b/packages/veilid_support/pubspec.yaml @@ -4,29 +4,31 @@ publish_to: 'none' version: 1.0.2+0 environment: - sdk: '>=3.0.5 <4.0.0' + sdk: '>=3.2.0 <4.0.0' dependencies: async_tools: path: ../async_tools - bloc: ^8.1.2 + bloc: ^8.1.3 + bloc_tools: + path: ../bloc_tools equatable: ^2.0.5 - fast_immutable_collections: ^9.1.5 - freezed_annotation: ^2.2.0 + fast_immutable_collections: ^10.1.1 + freezed_annotation: ^2.4.1 json_annotation: ^4.8.1 loggy: ^2.0.3 meta: ^1.10.0 mutex: path: ../mutex - protobuf: ^3.0.0 + protobuf: ^3.1.0 veilid: # veilid: ^0.0.1 path: ../../../veilid/veilid-flutter dev_dependencies: - build_runner: ^2.4.6 - freezed: ^2.3.5 + build_runner: ^2.4.8 + freezed: ^2.4.7 json_serializable: ^6.7.1 lint_hard: ^4.0.0 - test: ^1.25.0 + test: ^1.25.2 diff --git a/pubspec.lock b/pubspec.lock index 284c9b7..4b6dbd1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -92,10 +92,17 @@ packages: dependency: "direct main" description: name: bloc - sha256: "3820f15f502372d979121de1f6b97bfcf1630ebff8fe1d52fb2b0bfa49be5b49" + sha256: f53a110e3b48dcd78136c10daa5d51512443cea5e1348c9d80a320095fa2db9e url: "https://pub.dev" source: hosted - version: "8.1.2" + version: "8.1.3" + bloc_tools: + dependency: "direct main" + description: + path: "packages/bloc_tools" + relative: true + source: path + version: "1.0.0" blurry_modal_progress_hud: dependency: "direct main" description: @@ -172,10 +179,10 @@ packages: dependency: transitive description: name: built_value - sha256: a3ec2e0f967bc47f69f95009bb93db936288d61d5343b9436e378b28a2f830c6 + sha256: fedde275e0a6b798c3296963c5cd224e3e1b55d0e478d5b7e65e6b540f363a0e url: "https://pub.dev" source: hosted - version: "8.9.0" + version: "8.9.1" cached_network_image: dependency: transitive description: @@ -228,10 +235,10 @@ packages: dependency: transitive description: name: camera_platform_interface - sha256: fceb2c36038b6392317b1d5790c6ba9e6ca9f1da3031181b8bea03882bf9387a + sha256: a250314a48ea337b35909a4c9d5416a208d736dcb01d0b02c6af122be66660b0 url: "https://pub.dev" source: hosted - version: "2.7.3" + version: "2.7.4" camera_web: dependency: transitive description: @@ -268,10 +275,10 @@ packages: dependency: transitive description: name: charset - sha256: e8346cf597b6cea278d2d3a29b2d01ed8fb325aad718e70f22b0cb653cb31700 + sha256: "27802032a581e01ac565904ece8c8962564b1070690794f0072f6865958ce8b9" url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "2.0.1" checked_yaml: dependency: transitive description: @@ -392,22 +399,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.5" - fake_async: - dependency: transitive - description: - name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" - url: "https://pub.dev" - source: hosted - version: "1.3.1" fast_immutable_collections: dependency: "direct main" description: name: fast_immutable_collections - sha256: b910ccdc99bb38a2abbce07c5afb8f81d4e222a892e4d095a548b99814837b0c + sha256: "6df5b5bb29f52644c4c653ef0ae7d26c8463f8d6551b0ac94561103ff6c5ca17" url: "https://pub.dev" source: hosted - version: "9.2.1" + version: "10.1.1" ffi: dependency: transitive description: @@ -457,10 +456,10 @@ packages: dependency: "direct main" description: name: flutter_bloc - sha256: e74efb89ee6945bcbce74a5b3a5a3376b088e5f21f55c263fc38cbdc6237faae + sha256: "87325da1ac757fcc4813e6b34ed5dd61169973871fdf181d6c2109dd6935ece1" url: "https://pub.dev" source: hosted - version: "8.1.3" + version: "8.1.4" flutter_cache_manager: dependency: transitive description: @@ -574,15 +573,10 @@ packages: dependency: "direct main" description: name: flutter_svg - sha256: d39e7f95621fc84376bc0f7d504f05c3a41488c562f4a8ad410569127507402c + sha256: "7b4ca6cf3304575fe9c8ec64813c8d02ee41d2afe60bcfe0678bcb5375d596a2" url: "https://pub.dev" source: hosted - version: "2.0.9" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" + version: "2.0.10+1" flutter_translate: dependency: "direct main" description: @@ -704,10 +698,10 @@ packages: dependency: "direct main" description: name: hydrated_bloc - sha256: c925e49704c052a8f249226ae7603f86bfa776b910816390763b956c71d2cbaf + sha256: "00a2099680162e74b5a836b8a7f446e478520a9cae9f6032e028ad8129f4432d" url: "https://pub.dev" source: hosted - version: "9.1.3" + version: "9.1.4" icons_launcher: dependency: "direct dev" description: @@ -800,10 +794,10 @@ packages: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.16+1" material_color_utilities: dependency: transitive description: @@ -1063,10 +1057,10 @@ packages: dependency: "direct main" description: name: qr_code_dart_scan - sha256: ddf409177eeef07f7bdf4e4929858b3acf139873da273315789ebc97bd17bec8 + sha256: b42d097e346a546fcf9ff2f5a0e39ea1315449608cfd9b2bc6513988b488a371 url: "https://pub.dev" source: hosted - version: "0.7.4" + version: "0.7.5" qr_flutter: dependency: "direct main" description: @@ -1135,10 +1129,10 @@ packages: dependency: "direct main" description: name: searchable_listview - sha256: fad781a412d1fec251c7a66e4aca49e49ab8b7104bda733b476d4b5c81891bea + sha256: "5cd3cd87e0cbd4e6685f6798a9bb4bcc170df20fb92beb662b978f5fccded634" url: "https://pub.dev" source: hosted - version: "2.10.1" + version: "2.10.2" share_plus: dependency: "direct main" description: @@ -1380,10 +1374,10 @@ packages: dependency: transitive description: name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" url: "https://pub.dev" source: hosted - version: "0.6.1" + version: "0.7.0" timing: dependency: transitive description: @@ -1420,18 +1414,18 @@ packages: dependency: transitive description: name: url_launcher - sha256: c512655380d241a337521703af62d2c122bf7b77a46ff7dd750092aa9433499c + sha256: "0ecc004c62fd3ed36a2ffcbe0dd9700aee63bd7532d0b642a488b1ec310f492e" url: "https://pub.dev" source: hosted - version: "6.2.4" + version: "6.2.5" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: "507dc655b1d9cb5ebc756032eb785f114e415f91557b73bf60b7e201dfedeb2f" + sha256: d4ed0711849dd8e33eb2dd69c25db0d0d3fdc37e0a62e629fe32f57a22db2745 url: "https://pub.dev" source: hosted - version: "6.2.2" + version: "6.3.0" url_launcher_ios: dependency: transitive description: @@ -1460,10 +1454,10 @@ packages: dependency: transitive description: name: url_launcher_platform_interface - sha256: a932c3a8082e118f80a475ce692fde89dc20fddb24c57360b96bc56f7035de1f + sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.2" url_launcher_web: dependency: transitive description: @@ -1492,26 +1486,26 @@ packages: dependency: transitive description: name: vector_graphics - sha256: "4ac59808bbfca6da38c99f415ff2d3a5d7ca0a6b4809c71d9cf30fba5daf9752" + sha256: "32c3c684e02f9bc0afb0ae0aa653337a2fe022e8ab064bcd7ffda27a74e288e3" url: "https://pub.dev" source: hosted - version: "1.1.10+1" + version: "1.1.11+1" vector_graphics_codec: dependency: transitive description: name: vector_graphics_codec - sha256: f3247e7ab0ec77dc759263e68394990edc608fb2b480b80db8aa86ed09279e33 + sha256: c86987475f162fadff579e7320c7ddda04cd2fdeffbe1129227a85d9ac9e03da url: "https://pub.dev" source: hosted - version: "1.1.10+1" + version: "1.1.11+1" vector_graphics_compiler: dependency: transitive description: name: vector_graphics_compiler - sha256: "18489bdd8850de3dd7ca8a34e0c446f719ec63e2bab2e7a8cc66a9028dd76c5a" + sha256: "12faff3f73b1741a36ca7e31b292ddeb629af819ca9efe9953b70bd63fc8cd81" url: "https://pub.dev" source: hosted - version: "1.1.10+1" + version: "1.1.11+1" vector_math: dependency: transitive description: @@ -1618,18 +1612,18 @@ packages: dependency: "direct main" description: name: zxing2 - sha256: a042961441bd400f59595f9125ef5fca4c888daf0ea59c17f41e0e151f8a12b5 + sha256: "6cf995abd3c86f01ba882968dedffa7bc130185e382f2300239d2e857fc7912c" url: "https://pub.dev" source: hosted - version: "0.2.1" + version: "0.2.3" zxing_lib: dependency: transitive description: name: zxing_lib - sha256: "84f6ec19b04dd54bc0b25c539c7c3567a5f9e872e3feb23763df027a1f855c11" + sha256: "870a63610be3f20009ca9201f7ba2d53d7eaefa675c154b3e8c1f6fc55984d04" url: "https://pub.dev" source: hosted - version: "0.9.0" + version: "1.1.2" sdks: - dart: ">=3.2.6 <4.0.0" + dart: ">=3.2.3 <4.0.0" flutter: ">=3.16.6" diff --git a/pubspec.yaml b/pubspec.yaml index ebcbef7..68cbd1c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,7 +4,7 @@ publish_to: 'none' version: 1.0.2+0 environment: - sdk: '>=3.0.5 <4.0.0' + sdk: '>=3.2.0 <4.0.0' flutter: ">=3.10.0" dependencies: @@ -16,7 +16,9 @@ dependencies: awesome_extensions: ^2.0.12 badges: ^3.1.2 basic_utils: ^5.7.0 - bloc: ^8.1.2 + bloc: ^8.1.3 + bloc_tools: + path: packages/bloc_tools blurry_modal_progress_hud: ^1.1.1 change_case: ^1.1.0 charcode: ^1.3.1 @@ -25,12 +27,12 @@ dependencies: cool_dropdown: ^2.1.0 cupertino_icons: ^1.0.6 equatable: ^2.0.5 - fast_immutable_collections: ^9.2.1 + fast_immutable_collections: ^10.1.1 fixnum: ^1.1.0 flutter: sdk: flutter flutter_animate: ^4.5.0 - flutter_bloc: ^8.1.3 + flutter_bloc: ^8.1.4 flutter_chat_types: ^3.6.2 flutter_chat_ui: ^1.6.12 flutter_form_builder: ^9.2.1 @@ -40,12 +42,12 @@ dependencies: flutter_native_splash: ^2.3.10 flutter_slidable: ^3.0.1 flutter_spinkit: ^5.2.0 - flutter_svg: ^2.0.9 + flutter_svg: ^2.0.10+1 flutter_translate: ^4.0.4 form_builder_validators: ^9.1.0 freezed_annotation: ^2.4.1 go_router: ^13.2.0 - hydrated_bloc: ^9.1.3 + hydrated_bloc: ^9.1.4 image: ^4.1.7 intl: ^0.18.1 json_annotation: ^4.8.1 @@ -62,12 +64,12 @@ dependencies: preload_page_view: ^0.2.0 protobuf: ^3.1.0 provider: ^6.1.1 - qr_code_dart_scan: ^0.7.4 + qr_code_dart_scan: ^0.7.5 qr_flutter: ^4.1.0 quickalert: ^1.0.2 radix_colors: ^1.0.4 reorderable_grid: ^1.0.10 - searchable_listview: ^2.10.1 + searchable_listview: ^2.10.2 share_plus: ^7.2.2 shared_preferences: ^2.2.2 signal_strength_indicator: ^0.4.1 @@ -83,12 +85,10 @@ dependencies: path: packages/veilid_support window_manager: ^0.3.8 xterm: ^3.5.0 - zxing2: ^0.2.1 + zxing2: ^0.2.3 dev_dependencies: build_runner: ^2.4.8 - flutter_test: - sdk: flutter freezed: ^2.4.7 icons_launcher: ^2.1.7 json_serializable: ^6.7.1