Skip to content

Commit

Permalink
fix: launch url on web
Browse files Browse the repository at this point in the history
  • Loading branch information
emanuel-braz committed Apr 12, 2024
1 parent d45463d commit 412e33b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 72 deletions.
8 changes: 3 additions & 5 deletions lib/presentation/home/home_view/mobile_view.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -64,9 +65,6 @@ class ListTileWidget extends StatelessWidget {
}

Future<void> launch(String url, {bool isNewTab = true}) async {
await launchUrl(
Uri.parse(url),
webOnlyWindowName: isNewTab ? '_blank' : '_self',
);
js.context.callMethod('open', [url, isNewTab ? '_blank' : '_self']);
}
}
68 changes: 2 additions & 66 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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"
1 change: 0 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 412e33b

Please sign in to comment.