From 525380bddd5805e30a4d023e3b89228d370ab2b6 Mon Sep 17 00:00:00 2001 From: Salvatore Giordano Date: Tue, 31 May 2022 10:45:03 +0200 Subject: [PATCH] fix(ui): fix file download --- .../app/src/main/kotlin/com/example/example/Application.kt | 4 ++-- packages/stream_chat_flutter/lib/src/utils.dart | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/stream_chat_flutter/example/android/app/src/main/kotlin/com/example/example/Application.kt b/packages/stream_chat_flutter/example/android/app/src/main/kotlin/com/example/example/Application.kt index f1bd7610..97b327c1 100644 --- a/packages/stream_chat_flutter/example/android/app/src/main/kotlin/com/example/example/Application.kt +++ b/packages/stream_chat_flutter/example/android/app/src/main/kotlin/com/example/example/Application.kt @@ -10,8 +10,8 @@ class Application : FlutterApplication(), PluginRegistrantCallback { super.onCreate() } - override fun registerWith(registry: PluginRegistry?) { - PathProviderPlugin.registerWith(registry?.registrarFor( + override fun registerWith(registry: PluginRegistry) { + PathProviderPlugin.registerWith(registry.registrarFor( "io.flutter.plugins.pathprovider.PathProviderPlugin")) } } \ No newline at end of file diff --git a/packages/stream_chat_flutter/lib/src/utils.dart b/packages/stream_chat_flutter/lib/src/utils.dart index 86357803..04800e98 100644 --- a/packages/stream_chat_flutter/lib/src/utils.dart +++ b/packages/stream_chat_flutter/lib/src/utils.dart @@ -9,7 +9,10 @@ import 'package:url_launcher/url_launcher.dart'; /// Launch URL Future launchURL(BuildContext context, String url) async { try { - await launchUrl(Uri.parse(url).withScheme); + await launchUrl( + Uri.parse(url).withScheme, + mode: LaunchMode.externalApplication, + ); } catch (e) { ScaffoldMessenger.of(context).showSnackBar( SnackBar(content: Text(context.translations.launchUrlError)),