forked from flutter/plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[url_launcher] Switch to new launchUrl interface (flutter#5985)
- Loading branch information
1 parent
dfa9324
commit aba0e1e
Showing
9 changed files
with
98 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
packages/url_launcher/url_launcher/lib/src/type_conversion.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright 2013 The Flutter 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 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart'; | ||
|
||
import 'types.dart'; | ||
|
||
/// Converts an (app-facing) [WebViewConfiguration] to a (platform interface) | ||
/// [InAppWebViewConfiguration]. | ||
InAppWebViewConfiguration convertConfiguration(WebViewConfiguration config) { | ||
return InAppWebViewConfiguration( | ||
enableJavaScript: config.enableJavaScript, | ||
enableDomStorage: config.enableDomStorage, | ||
headers: config.headers, | ||
); | ||
} | ||
|
||
/// Converts an (app-facing) [LaunchMode] to a (platform interface) | ||
/// [PreferredLaunchMode]. | ||
PreferredLaunchMode convertLaunchMode(LaunchMode mode) { | ||
switch (mode) { | ||
case LaunchMode.platformDefault: | ||
return PreferredLaunchMode.platformDefault; | ||
case LaunchMode.inAppWebView: | ||
return PreferredLaunchMode.inAppWebView; | ||
case LaunchMode.externalApplication: | ||
return PreferredLaunchMode.externalApplication; | ||
case LaunchMode.externalNonBrowserApplication: | ||
return PreferredLaunchMode.externalNonBrowserApplication; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.