diff --git a/lib/shared/input_dialogs.dart b/lib/shared/input_dialogs.dart index bb0982529..6b3eb061e 100644 --- a/lib/shared/input_dialogs.dart +++ b/lib/shared/input_dialogs.dart @@ -178,7 +178,12 @@ Widget buildCommunitySuggestionWidget(payload, {void Function(CommunityView)? on } /// Shows a dialog which allows typing/search for an instance -void showInstanceInputDialog(BuildContext context, {required String title, required void Function(Instance) onInstanceSelected, Iterable? emptySuggestions}) async { +void showInstanceInputDialog( + BuildContext context, { + required String title, + required void Function(InstanceWithFederationState) onInstanceSelected, + Iterable? emptySuggestions, +}) async { Account? account = await fetchActiveProfileAccount(); GetFederatedInstancesResponse getFederatedInstancesResponse = await LemmyClient.instance.lemmyApiV3.run( @@ -187,12 +192,12 @@ void showInstanceInputDialog(BuildContext context, {required String title, requi ), ); - Future onSubmitted({Instance? payload, String? value}) async { + Future onSubmitted({InstanceWithFederationState? payload, String? value}) async { if (payload != null) { onInstanceSelected(payload); Navigator.of(context).pop(); } else if (value != null) { - final Instance? instance = getFederatedInstancesResponse.federatedInstances?.linked.firstWhereOrNull((Instance instance) => instance.domain == value); + final InstanceWithFederationState? instance = getFederatedInstancesResponse.federatedInstances?.linked.firstWhereOrNull((InstanceWithFederationState instance) => instance.domain == value); if (instance != null) { onInstanceSelected(instance); @@ -206,7 +211,7 @@ void showInstanceInputDialog(BuildContext context, {required String title, requi } if (context.mounted) { - showInputDialog( + showInputDialog( context: context, title: title, inputLabel: AppLocalizations.of(context)!.instance, @@ -217,12 +222,12 @@ void showInstanceInputDialog(BuildContext context, {required String title, requi } } -Future> getInstanceSuggestions(String query, Iterable? emptySuggestions) async { +Future> getInstanceSuggestions(String query, Iterable? emptySuggestions) async { if (query.isEmpty) { return const Iterable.empty(); } - Iterable filteredInstances = emptySuggestions?.where((Instance instance) => instance.domain.contains(query)) ?? const Iterable.empty(); + Iterable filteredInstances = emptySuggestions?.where((InstanceWithFederationState instance) => instance.domain.contains(query)) ?? const Iterable.empty(); return filteredInstances; } diff --git a/pubspec.lock b/pubspec.lock index 2f946503e..c7be6f2d0 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -862,12 +862,28 @@ packages: url: "https://pub.dev" source: hosted version: "4.8.1" + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "7e108028e3d258667d079986da8c0bc32da4cb57431c2af03b1dc1038621a9dc" + url: "https://pub.dev" + source: hosted + version: "9.0.13" + leak_tracker_testing: + dependency: transitive + description: + name: leak_tracker_testing + sha256: b06739349ec2477e943055aea30172c5c7000225f79dad4702e2ec0eda79a6ff + url: "https://pub.dev" + source: hosted + version: "1.0.5" lemmy_api_client: dependency: "direct main" description: path: "." - ref: "67c33a2ddc08f8d99aabfce81bab1fde107bd0a7" - resolved-ref: "67c33a2ddc08f8d99aabfce81bab1fde107bd0a7" + ref: "11893cac21d13e424f188420cbbdbf9164c28498" + resolved-ref: "11893cac21d13e424f188420cbbdbf9164c28498" url: "https://github.com/thunder-app/lemmy_api_client.git" source: git version: "0.21.0" @@ -933,18 +949,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: transitive 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: @@ -1576,6 +1592,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.0.2" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + url: "https://pub.dev" + source: hosted + version: "13.0.0" watcher: dependency: transitive description: @@ -1588,10 +1612,10 @@ packages: dependency: transitive description: name: web - sha256: "14f1f70c51119012600c5f1f60ca68efda5a9b6077748163c6af2893ec5df8fc" + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.2.1-beta" + version: "0.3.0" web_socket_channel: dependency: transitive description: @@ -1673,5 +1697,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.2.0-157.0.dev <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=3.13.0" diff --git a/pubspec.yaml b/pubspec.yaml index 38935eba7..4be72ea6b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -29,7 +29,7 @@ dependencies: lemmy_api_client: git: url: https://github.com/thunder-app/lemmy_api_client.git - ref: 67c33a2ddc08f8d99aabfce81bab1fde107bd0a7 + ref: 11893cac21d13e424f188420cbbdbf9164c28498 link_preview_generator: git: url: https://github.com/thunder-app/link_preview_generator.git