Skip to content

Commit 0b0a41b

Browse files
committed
refactor: using url_launcher instead of html lib
1 parent edeec50 commit 0b0a41b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

flutter_highlight/example/lib/main.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import 'dart:html' as html;
21
import 'package:flutter/material.dart';
32
import 'package:flutter_highlight/flutter_highlight.dart';
43
import 'package:flutter_highlight/theme_map.dart';
4+
import 'package:url_launcher/url_launcher.dart';
55
import 'example_map.dart';
66

77
void main() => runApp(MyApp());
@@ -87,7 +87,7 @@ class _MyHomePageState extends State<MyHomePage> {
8787
icon: const Icon(Icons.code),
8888
tooltip: 'Source Code',
8989
onPressed: () {
90-
html.window.open('https://github.com/pd4d10/highlight', '');
90+
launch('https://github.com/pd4d10/highlight');
9191
},
9292
)
9393
],

flutter_highlight/example/pubspec.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ environment:
1919
dependencies:
2020
flutter:
2121
sdk: flutter
22+
url_launcher: ^5.1.4
23+
url_launcher_web:
24+
git:
25+
url: git://github.com/flutter/plugins.git
26+
path: packages/url_launcher/url_launcher_web
2227
flutter_highlight:
2328
path: ../
2429

0 commit comments

Comments
 (0)