Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
490622b4
Commit
490622b4
authored
Jun 24, 2016
by
Chinmay Garde
Committed by
GitHub
Jun 24, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a wrapper for accessing the URL launcher service. (#4688)
parent
e41527a8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
+45
-0
services.dart
packages/flutter/lib/services.dart
+1
-0
url_launcher.dart
packages/flutter/lib/src/services/url_launcher.dart
+44
-0
No files found.
packages/flutter/lib/services.dart
View file @
490622b4
...
@@ -30,3 +30,4 @@ export 'src/services/path_provider.dart';
...
@@ -30,3 +30,4 @@ export 'src/services/path_provider.dart';
export
'src/services/shell.dart'
;
export
'src/services/shell.dart'
;
export
'src/services/system_chrome.dart'
;
export
'src/services/system_chrome.dart'
;
export
'src/services/system_sound.dart'
;
export
'src/services/system_sound.dart'
;
export
'src/services/url_launcher.dart'
;
packages/flutter/lib/src/services/url_launcher.dart
0 → 100644
View file @
490622b4
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import
'dart:async'
;
import
'package:sky_services/flutter/platform/url_launcher.mojom.dart'
as
mojom
;
import
'shell.dart'
;
mojom
.
UrlLauncherProxy
_initUrlLauncherProxy
(
)
{
return
shell
.
connectToApplicationService
(
mojom
.
UrlLauncher
.
serviceName
,
mojom
.
UrlLauncher
.
connectToService
);
}
final
mojom
.
UrlLauncherProxy
_connectedUrlLauncherService
=
_initUrlLauncherProxy
();
/// Allows applications to delegate responsbility of handling certain URLs to
/// the underlying platform.
class
UrlLauncher
{
UrlLauncher
.
_
();
/// Parse the specified URL string and delegate handling of the same to the
/// underlying platform.
///
/// Arguments:
///
/// * [urlString]: The URL string to be parsed by the underlying platform and
/// before it attempts to launch the same.
///
/// Return Value:
///
/// boolean indicating if the intent to handle the URL was successfully
/// conveyed to the to underlying platform and the platform could
/// successfully handle the same. The platform is responsible for URL
/// parsing.
static
Future
<
bool
>
launch
(
String
urlString
)
{
Completer
<
bool
>
completer
=
new
Completer
<
bool
>();
_connectedUrlLauncherService
.
launch
(
urlString
,
(
bool
success
)
{
completer
.
complete
(
success
);
});
return
completer
.
future
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment