flutter 3.19 upgrade
This commit is contained in:
Christien Rioux 2024-02-27 21:37:39 -05:00
parent c6f017b0d1
commit efb7b95980
17 changed files with 131 additions and 127 deletions

View File

@ -59,6 +59,8 @@ class MessagesCubit extends Cubit<AsyncValue<IList<proto.Message>>> {
@override
Future<void> close() async {
await _localSubscription?.cancel();
await _remoteSubscription?.cancel();
await super.close();
}
@ -132,7 +134,8 @@ class MessagesCubit extends Cubit<AsyncValue<IList<proto.Message>>> {
_localMessagesCubit = DHTShortArrayCubit.value(
shortArray: localMessagesRecord,
decodeElement: proto.Message.fromBuffer);
_localMessagesCubit!.stream.listen(updateLocalMessagesState);
_localSubscription =
_localMessagesCubit!.stream.listen(updateLocalMessagesState);
}
// Open remote messages key
@ -141,7 +144,8 @@ class MessagesCubit extends Cubit<AsyncValue<IList<proto.Message>>> {
_remoteMessagesCubit = DHTShortArrayCubit.value(
shortArray: remoteMessagesRecord,
decodeElement: proto.Message.fromBuffer);
_remoteMessagesCubit!.stream.listen(updateRemoteMessagesState);
_remoteSubscription =
_remoteMessagesCubit!.stream.listen(updateRemoteMessagesState);
}
// Initialize local messages
@ -209,6 +213,10 @@ class MessagesCubit extends Cubit<AsyncValue<IList<proto.Message>>> {
DHTShortArrayCubit<proto.Message>? _localMessagesCubit;
DHTShortArrayCubit<proto.Message>? _remoteMessagesCubit;
final StreamController<_MessageQueueEntry> _remoteMessagesQueue;
StreamSubscription<BlocBusyState<AsyncValue<IList<proto.Message>>>>?
_localSubscription;
StreamSubscription<BlocBusyState<AsyncValue<IList<proto.Message>>>>?
_remoteSubscription;
//
DHTRecordCrypto? _messagesCrypto;
}

View File

@ -53,15 +53,18 @@ class ContactInvitationItemWidget extends StatelessWidget {
children: [
// A SlidableAction can have an icon and/or a label.
SlidableAction(
onPressed: (context) async {
final contactInvitationListCubit =
context.read<ContactInvitationListCubit>();
await contactInvitationListCubit.deleteInvitation(
accepted: false,
contactRequestInboxRecordKey: contactInvitationRecord
.contactRequestInbox.recordKey
.toVeilid());
},
onPressed: disabled
? null
: (context) async {
final contactInvitationListCubit =
context.read<ContactInvitationListCubit>();
await contactInvitationListCubit.deleteInvitation(
accepted: false,
contactRequestInboxRecordKey:
contactInvitationRecord
.contactRequestInbox.recordKey
.toVeilid());
},
backgroundColor: scale.tertiaryScale.background,
foregroundColor: scale.tertiaryScale.text,
icon: Icons.delete,
@ -96,21 +99,23 @@ class ContactInvitationItemWidget extends StatelessWidget {
// component is not dragged.
child: ListTile(
//title: Text(translate('contact_list.invitation')),
onTap: () async {
// ignore: use_build_context_synchronously
if (!context.mounted) {
return;
}
await showDialog<void>(
context: context,
builder: (context) => BlocProvider(
create: (context) => InvitationGeneratorCubit(
Future.value(Uint8List.fromList(
contactInvitationRecord.invitation))),
child: ContactInvitationDisplayDialog(
message: contactInvitationRecord.message,
)));
},
onTap: disabled
? null
: () async {
// ignore: use_build_context_synchronously
if (!context.mounted) {
return;
}
await showDialog<void>(
context: context,
builder: (context) => BlocProvider(
create: (context) => InvitationGeneratorCubit(
Future.value(Uint8List.fromList(
contactInvitationRecord.invitation))),
child: ContactInvitationDisplayDialog(
message: contactInvitationRecord.message,
)));
},
title: Text(
contactInvitationRecord.message.isEmpty
? translate('contact_list.invitation')

View File

@ -73,6 +73,8 @@ class ConversationCubit extends Cubit<AsyncValue<ConversationState>> {
@override
Future<void> close() async {
await _localSubscription?.cancel();
await _remoteSubscription?.cancel();
await super.close();
}
@ -127,7 +129,8 @@ class ConversationCubit extends Cubit<AsyncValue<ConversationState>> {
_localConversationCubit = DefaultDHTRecordCubit.value(
record: localConversationRecord,
decodeState: proto.Conversation.fromBuffer);
_localConversationCubit!.stream.listen(updateLocalConversationState);
_localSubscription =
_localConversationCubit!.stream.listen(updateLocalConversationState);
}
// Open remote converation key
@ -138,7 +141,8 @@ class ConversationCubit extends Cubit<AsyncValue<ConversationState>> {
_remoteConversationCubit = DefaultDHTRecordCubit.value(
record: remoteConversationRecord,
decodeState: proto.Conversation.fromBuffer);
_remoteConversationCubit!.stream.listen(updateRemoteConversationState);
_remoteSubscription =
_remoteConversationCubit!.stream.listen(updateRemoteConversationState);
}
// Initialize a local conversation
@ -265,6 +269,8 @@ class ConversationCubit extends Cubit<AsyncValue<ConversationState>> {
final TypedKey? _remoteConversationRecordKey;
DefaultDHTRecordCubit<proto.Conversation>? _localConversationCubit;
DefaultDHTRecordCubit<proto.Conversation>? _remoteConversationCubit;
StreamSubscription<AsyncValue<proto.Conversation>>? _localSubscription;
StreamSubscription<AsyncValue<proto.Conversation>>? _remoteSubscription;
ConversationState _incrementalState;
//
DHTRecordCrypto? _conversationCrypto;

View File

@ -43,7 +43,7 @@ class ContactItemWidget extends StatelessWidget {
motion: const DrawerMotion(),
children: [
SlidableAction(
onPressed: disabled || context.read<ChatListCubit>().isBusy
onPressed: disabled || context.watch<ChatListCubit>().isBusy
? null
: (context) async {
final contactListCubit =
@ -77,7 +77,7 @@ class ContactItemWidget extends StatelessWidget {
// The child of the Slidable is what the user sees when the
// component is not dragged.
child: ListTile(
onTap: disabled || context.read<ChatListCubit>().isBusy
onTap: disabled || context.watch<ChatListCubit>().isBusy
? null
: () async {
// Start a chat

View File

@ -1,6 +1,4 @@
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:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
@ -145,19 +143,13 @@ class HomeAccountReadyShellState extends State<HomeAccountReadyShell> {
create: (context) => ActiveConversationsBlocMapCubit(
activeAccountInfo: widget.activeAccountInfo,
contactListCubit: context.read<ContactListCubit>())
..follow(
initialInputState:
const BlocBusyState(AsyncValue.loading()),
stream: context.read<ChatListCubit>().stream)),
..followBloc(context.read<ChatListCubit>())),
BlocProvider(
create: (context) =>
ActiveConversationMessagesBlocMapCubit(
activeAccountInfo: widget.activeAccountInfo,
)..follow(
initialInputState: IMap(),
stream: context
.read<ActiveConversationsBlocMapCubit>()
.stream)),
)..followBloc(
context.read<ActiveConversationsBlocMapCubit>())),
BlocProvider(
create: (context) => ActiveChatCubit(null)
..withStateListen((event) {
@ -167,12 +159,8 @@ class HomeAccountReadyShellState extends State<HomeAccountReadyShell> {
create: (context) => WaitingInvitationsBlocMapCubit(
activeAccountInfo: widget.activeAccountInfo,
account: account)
..follow(
initialInputState:
const BlocBusyState(AsyncValue.loading()),
stream: context
.read<ContactInvitationListCubit>()
.stream))
..followBloc(
context.read<ContactInvitationListCubit>()))
],
child: MultiBlocListener(listeners: [
BlocListener<WaitingInvitationsBlocMapCubit,

View File

@ -82,4 +82,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: ff0a9a3ce75ee73f200ca7e2f47745698c917ef9
COCOAPODS: 1.12.1
COCOAPODS: 1.15.2

View File

@ -206,7 +206,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
33CC10EC2044A3C60003C045 = {

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"

View File

@ -54,12 +54,13 @@ mixin BlocBusyWrapper<S> on BlocBase<BlocBusyState<S>> {
await closure(busyemit);
// If the closure did one or more 'busy emits' then
// take the most recent one and emit it for real
// take the most recent one and emit it for real and
// turn off the busy state
final finalState = changedState;
if (finalState != null && finalState != state.state) {
emit(BlocBusyState._busy(finalState));
emit(BlocBusyState(finalState));
} else {
emit(BlocBusyState._busy(state.state));
emit(BlocBusyState(state.state));
}
});
void changeState(S state) {

View File

@ -1,6 +1,7 @@
import 'dart:async';
import 'package:async_tools/async_tools.dart';
import 'package:bloc/bloc.dart';
import 'package:fast_immutable_collections/fast_immutable_collections.dart';
// Mixin that automatically keeps two blocs/cubits in sync with each other
@ -21,6 +22,9 @@ abstract mixin class StateFollower<S extends Object, K, V> {
_subscription = stream.listen(_updateFollow);
}
void followBloc<B extends BlocBase<S>>(B bloc) =>
follow(initialInputState: bloc.state, stream: bloc.stream);
Future<void> close() async {
await _subscription.cancel();
}

View File

@ -13,7 +13,7 @@ dependencies:
equatable: ^2.0.5
fast_immutable_collections: ^10.1.1
freezed_annotation: ^2.4.1
meta: ^1.10.0
meta: ^1.11.0
mutex:
path: ../mutex

View File

@ -8,5 +8,5 @@ environment:
dev_dependencies:
lint_hard: ^4.0.0
pana: ^0.21.45
pana: ^0.22.2
test: ^1.25.2

View File

@ -385,6 +385,6 @@ class DHTRecord {
void _addRemoteValueChange(VeilidUpdateValueChange update) {
_addValueChange(
local: false, data: update.valueData.data, subkeys: update.subkeys);
local: false, data: update.value.data, subkeys: update.subkeys);
}
}

View File

@ -5,18 +5,18 @@ packages:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051
sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7"
url: "https://pub.dev"
source: hosted
version: "64.0.0"
version: "67.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893"
sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d"
url: "https://pub.dev"
source: hosted
version: "6.2.0"
version: "6.4.1"
args:
dependency: transitive
description:
@ -131,10 +131,10 @@ packages:
dependency: transitive
description:
name: change_case
sha256: f4e08feaa845e75e4f5ad2b0e15f24813d7ea6c27e7b78252f0c17f752cf1157
sha256: "47c48c36f95f20c6d0ba03efabceff261d05026cca322cc2c4c01c343371b5bb"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
version: "2.0.1"
characters:
dependency: transitive
description:
@ -227,10 +227,10 @@ packages:
dependency: transitive
description:
name: ffi
sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878"
sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
version: "2.1.2"
file:
dependency: transitive
description:
@ -239,14 +239,6 @@ packages:
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:
@ -397,18 +389,18 @@ packages:
dependency: transitive
description:
name: material_color_utilities
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.dev"
source: hosted
version: "0.5.0"
version: "0.8.0"
meta:
dependency: "direct main"
description:
name: meta
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
url: "https://pub.dev"
source: hosted
version: "1.10.0"
version: "1.11.0"
mime:
dependency: transitive
description:
@ -657,10 +649,10 @@ packages:
dependency: transitive
description:
name: system_info2
sha256: af2f948e3f31a3367a049932a8ad59faf0063ecf836a020d975b9f41566d8bc9
sha256: "65206bbef475217008b5827374767550a5420ce70a04d2d7e94d1d2253f3efc9"
url: "https://pub.dev"
source: hosted
version: "3.0.2"
version: "4.0.0"
system_info_plus:
dependency: transitive
description:
@ -736,10 +728,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: a2662fb1f114f4296cf3f5a50786a2d888268d7776cf681aa17d660ffa23b246
sha256: e7d5ecd604e499358c5fe35ee828c0298a320d54455e791e9dcf73486bc8d9f0
url: "https://pub.dev"
source: hosted
version: "14.0.0"
version: "14.1.0"
watcher:
dependency: transitive
description:
@ -752,18 +744,18 @@ packages:
dependency: transitive
description:
name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
sha256: "1d9158c616048c38f712a6646e317a3426da10e884447626167240d45209cbad"
url: "https://pub.dev"
source: hosted
version: "0.3.0"
version: "0.5.0"
web_socket_channel:
dependency: transitive
description:
name: web_socket_channel
sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b
sha256: "1d8e795e2a8b3730c41b8a98a2dff2e0fb57ae6f0764a1c46ec5915387d257b2"
url: "https://pub.dev"
source: hosted
version: "2.4.0"
version: "2.4.4"
webkit_inspection_protocol:
dependency: transitive
description:
@ -797,5 +789,5 @@ packages:
source: hosted
version: "3.1.2"
sdks:
dart: ">=3.2.0 <4.0.0"
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.10.6"

View File

@ -17,7 +17,7 @@ dependencies:
freezed_annotation: ^2.4.1
json_annotation: ^4.8.1
loggy: ^2.0.3
meta: ^1.10.0
meta: ^1.11.0
mutex:
path: ../mutex

View File

@ -5,18 +5,18 @@ packages:
dependency: transitive
description:
name: _fe_analyzer_shared
sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051
sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7"
url: "https://pub.dev"
source: hosted
version: "64.0.0"
version: "67.0.0"
analyzer:
dependency: transitive
description:
name: analyzer
sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893"
sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d"
url: "https://pub.dev"
source: hosted
version: "6.2.0"
version: "6.4.1"
animated_theme_switcher:
dependency: "direct main"
description:
@ -347,10 +347,10 @@ packages:
dependency: transitive
description:
name: cross_file
sha256: fedaadfa3a6996f75211d835aaeb8fede285dae94262485698afd832371b9a5e
sha256: "55d7b444feb71301ef6b8838dbc1ae02e63dd48c8773f3810ff53bb1e2945b32"
url: "https://pub.dev"
source: hosted
version: "0.3.3+8"
version: "0.3.4+1"
crypto:
dependency: transitive
description:
@ -411,10 +411,10 @@ packages:
dependency: transitive
description:
name: ffi
sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878"
sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21"
url: "https://pub.dev"
source: hosted
version: "2.1.0"
version: "2.1.2"
file:
dependency: transitive
description:
@ -674,10 +674,10 @@ packages:
dependency: transitive
description:
name: http
sha256: a2bbf9d017fcced29139daa8ed2bba4ece450ab222871df93ca9eec6f80c34ba
sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
version: "1.2.1"
http_multi_server:
dependency: transitive
description:
@ -802,18 +802,18 @@ packages:
dependency: transitive
description:
name: material_color_utilities
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.dev"
source: hosted
version: "0.5.0"
version: "0.8.0"
meta:
dependency: "direct main"
description:
name: meta
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
url: "https://pub.dev"
source: hosted
version: "1.10.0"
version: "1.11.0"
mime:
dependency: transitive
description:
@ -881,10 +881,10 @@ packages:
dependency: "direct main"
description:
name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev"
source: hosted
version: "1.8.3"
version: "1.9.0"
path_parsing:
dependency: transitive
description:
@ -973,14 +973,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.1.4"
platform_info:
dependency: transitive
description:
name: platform_info
sha256: "012e73712166cf0b56d3eb95c0d33491f56b428c169eca385f036448474147e4"
url: "https://pub.dev"
source: hosted
version: "3.2.0"
plugin_platform_interface:
dependency: transitive
description:
@ -1193,10 +1185,10 @@ packages:
dependency: transitive
description:
name: shared_preferences_web
sha256: "7b15ffb9387ea3e237bb7a66b8a23d2147663d391cafc5c8f37b2e7b4bde5d21"
sha256: "9aee1089b36bd2aafe06582b7d7817fd317ef05fc30e6ba14bff247d0933042a"
url: "https://pub.dev"
source: hosted
version: "2.2.2"
version: "2.3.0"
shared_preferences_windows:
dependency: transitive
description:
@ -1430,10 +1422,10 @@ packages:
dependency: transitive
description:
name: url_launcher_ios
sha256: "75bb6fe3f60070407704282a2d295630cab232991eb52542b18347a8a941df03"
sha256: "9149d493b075ed740901f3ee844a38a00b33116c7c5c10d7fb27df8987fb51d5"
url: "https://pub.dev"
source: hosted
version: "6.2.4"
version: "6.2.5"
url_launcher_linux:
dependency: transitive
description:
@ -1462,10 +1454,10 @@ packages:
dependency: transitive
description:
name: url_launcher_web
sha256: fff0932192afeedf63cdd50ecbb1bc825d31aed259f02bb8dba0f3b729a5e88b
sha256: "3692a459204a33e04bc94f5fb91158faf4f2c8903281ddd82915adecdb1a901d"
url: "https://pub.dev"
source: hosted
version: "2.2.3"
version: "2.3.0"
url_launcher_windows:
dependency: transitive
description:
@ -1548,18 +1540,18 @@ packages:
dependency: transitive
description:
name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
sha256: "1d9158c616048c38f712a6646e317a3426da10e884447626167240d45209cbad"
url: "https://pub.dev"
source: hosted
version: "0.3.0"
version: "0.5.0"
web_socket_channel:
dependency: transitive
description:
name: web_socket_channel
sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b
sha256: "1d8e795e2a8b3730c41b8a98a2dff2e0fb57ae6f0764a1c46ec5915387d257b2"
url: "https://pub.dev"
source: hosted
version: "2.4.0"
version: "2.4.4"
win32:
dependency: transitive
description:
@ -1596,10 +1588,10 @@ packages:
dependency: "direct main"
description:
name: xterm
sha256: "6a02b15d03152b8186e12790902ff28c8a932fc441e89fa7255a7491661a8e69"
sha256: "168dfedca77cba33fdb6f52e2cd001e9fde216e398e89335c19b524bb22da3a2"
url: "https://pub.dev"
source: hosted
version: "3.5.0"
version: "4.0.0"
yaml:
dependency: transitive
description:
@ -1608,6 +1600,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "3.1.2"
zmodem:
dependency: transitive
description:
name: zmodem
sha256: "3b7e5b29f3a7d8aee472029b05165a68438eff2f3f7766edf13daba1e297adbf"
url: "https://pub.dev"
source: hosted
version: "0.0.6"
zxing2:
dependency: "direct main"
description:
@ -1625,5 +1625,5 @@ packages:
source: hosted
version: "1.1.2"
sdks:
dart: ">=3.2.3 <4.0.0"
flutter: ">=3.16.6"
dart: ">=3.3.0 <4.0.0"
flutter: ">=3.19.0"

View File

@ -52,13 +52,13 @@ dependencies:
intl: ^0.18.1
json_annotation: ^4.8.1
loggy: ^2.0.3
meta: ^1.10.0
meta: ^1.11.0
mobile_scanner: ^4.0.0
motion_toast: ^2.8.0
mutex:
path: packages/mutex
pasteboard: ^0.2.0
path: ^1.8.3
path: ^1.9.0
path_provider: ^2.1.2
pinput: ^4.0.0
preload_page_view: ^0.2.0
@ -84,7 +84,7 @@ dependencies:
veilid_support:
path: packages/veilid_support
window_manager: ^0.3.8
xterm: ^3.5.0
xterm: ^4.0.0
zxing2: ^0.2.3
dev_dependencies: