From 412e33bdd3c42c8761299187874aa834065d3226 Mon Sep 17 00:00:00 2001 From: Emanuel Braz Date: Fri, 12 Apr 2024 13:19:38 -0300 Subject: [PATCH] fix: launch url on web --- .../home/home_view/mobile_view.dart | 8 +-- pubspec.lock | 68 +------------------ pubspec.yaml | 1 - 3 files changed, 5 insertions(+), 72 deletions(-) diff --git a/lib/presentation/home/home_view/mobile_view.dart b/lib/presentation/home/home_view/mobile_view.dart index 96c2238..9d1a713 100644 --- a/lib/presentation/home/home_view/mobile_view.dart +++ b/lib/presentation/home/home_view/mobile_view.dart @@ -1,5 +1,6 @@ +import 'dart:js' as js; + import 'package:flutter/material.dart'; -import 'package:url_launcher/url_launcher.dart'; import '../../../data/social_qr_code.dart'; import '../event_store.dart'; @@ -64,9 +65,6 @@ class ListTileWidget extends StatelessWidget { } Future launch(String url, {bool isNewTab = true}) async { - await launchUrl( - Uri.parse(url), - webOnlyWindowName: isNewTab ? '_blank' : '_self', - ); + js.context.callMethod('open', [url, isNewTab ? '_blank' : '_self']); } } diff --git a/pubspec.lock b/pubspec.lock index fb7c488..93f2280 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -317,70 +317,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.2" - url_launcher: - dependency: "direct main" - description: - name: url_launcher - sha256: "6ce1e04375be4eed30548f10a315826fd933c1e493206eab82eed01f438c8d2e" - url: "https://pub.dev" - source: hosted - version: "6.2.6" - url_launcher_android: - dependency: transitive - description: - name: url_launcher_android - sha256: d4ed0711849dd8e33eb2dd69c25db0d0d3fdc37e0a62e629fe32f57a22db2745 - url: "https://pub.dev" - source: hosted - version: "6.3.0" - url_launcher_ios: - dependency: transitive - description: - name: url_launcher_ios - sha256: "9149d493b075ed740901f3ee844a38a00b33116c7c5c10d7fb27df8987fb51d5" - url: "https://pub.dev" - source: hosted - version: "6.2.5" - url_launcher_linux: - dependency: transitive - description: - name: url_launcher_linux - sha256: ab360eb661f8879369acac07b6bb3ff09d9471155357da8443fd5d3cf7363811 - url: "https://pub.dev" - source: hosted - version: "3.1.1" - url_launcher_macos: - dependency: transitive - description: - name: url_launcher_macos - sha256: b7244901ea3cf489c5335bdacda07264a6e960b1c1b1a9f91e4bc371d9e68234 - url: "https://pub.dev" - source: hosted - version: "3.1.0" - url_launcher_platform_interface: - dependency: transitive - description: - name: url_launcher_platform_interface - sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" - url: "https://pub.dev" - source: hosted - version: "2.3.2" - url_launcher_web: - dependency: transitive - description: - name: url_launcher_web - sha256: fff0932192afeedf63cdd50ecbb1bc825d31aed259f02bb8dba0f3b729a5e88b - url: "https://pub.dev" - source: hosted - version: "2.2.3" - url_launcher_windows: - dependency: transitive - description: - name: url_launcher_windows - sha256: ecf9725510600aa2bb6d7ddabe16357691b6d2805f66216a97d1b881e21beff7 - url: "https://pub.dev" - source: hosted - version: "3.1.1" vector_math: dependency: transitive description: @@ -414,5 +350,5 @@ packages: source: hosted version: "1.0.3" sdks: - dart: ">=3.2.3 <4.0.0" - flutter: ">=3.16.6" + dart: ">=3.2.0-194.0.dev <4.0.0" + flutter: ">=3.7.0" diff --git a/pubspec.yaml b/pubspec.yaml index 61cba98..75bcf0a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,6 @@ dependencies: crypto: ^3.0.3 google_fonts: any file_picker: ^6.1.1 - url_launcher: ^6.2.6 dev_dependencies: flutter_test: