Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Remove UrlLauncher class (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
szakarias authored Apr 24, 2017
1 parent a5325fe commit e3f9fdd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/url-launcher/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class MyHomePage extends StatefulWidget {

class _MyHomePageState extends State<MyHomePage> {
void _launchUrl() {
UrlLauncher.launch("https://flutter.io");
launch('https://flutter.io');
}

@override
Expand All @@ -54,4 +54,4 @@ class _MyHomePageState extends State<MyHomePage> {
),
);
}
}
}
15 changes: 7 additions & 8 deletions packages/url-launcher/lib/url_launcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ import 'dart:async';

import 'package:flutter/services.dart';

class UrlLauncher {
static const MethodChannel _channel =
const MethodChannel('plugins.flutter.io/URLLauncher');

/// Parse the specified URL string and delegate handling of the same to the
/// underlying platform.
static Future<Null> launch(String urlString) =>
_channel.invokeMethod('UrlLauncher.launch', urlString);
/// Parse the specified URL string and delegate handling of the same to the
/// underlying platform.
Future<Null> launch(String urlString) {
return const MethodChannel('plugins.flutter.io/URLLauncher').invokeMethod(
'UrlLauncher.launch',
urlString,
);
}

0 comments on commit e3f9fdd

Please sign in to comment.