fix(ui): fix file download

This commit is contained in:
Salvatore Giordano
2022-05-31 10:45:03 +02:00
parent 8633ee28dc
commit 525380bddd
2 changed files with 6 additions and 3 deletions
@@ -10,8 +10,8 @@ class Application : FlutterApplication(), PluginRegistrantCallback {
super.onCreate() super.onCreate()
} }
override fun registerWith(registry: PluginRegistry?) { override fun registerWith(registry: PluginRegistry) {
PathProviderPlugin.registerWith(registry?.registrarFor( PathProviderPlugin.registerWith(registry.registrarFor(
"io.flutter.plugins.pathprovider.PathProviderPlugin")) "io.flutter.plugins.pathprovider.PathProviderPlugin"))
} }
} }
@@ -9,7 +9,10 @@ import 'package:url_launcher/url_launcher.dart';
/// Launch URL /// Launch URL
Future<void> launchURL(BuildContext context, String url) async { Future<void> launchURL(BuildContext context, String url) async {
try { try {
await launchUrl(Uri.parse(url).withScheme); await launchUrl(
Uri.parse(url).withScheme,
mode: LaunchMode.externalApplication,
);
} catch (e) { } catch (e) {
ScaffoldMessenger.of(context).showSnackBar( ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(context.translations.launchUrlError)), SnackBar(content: Text(context.translations.launchUrlError)),