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

Remove UrlLauncher class #6

Merged
merged 3 commits into from
Apr 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
);
}