-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
flutter/plugins
#5310Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectp: url_launcherPlugin to launch external applicationsPlugin to launch external applicationspackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.
Description
The url_launcher API has been added to piecemeal over time, and at this point is kind of a mess. Major issues:
- People pass invalid URLs since it takes a
Stringrather than aUri; what happens to them is highly platform-specific. - There are separate iOS-specific and Android-specific options for whether to use an in-app web view or launch the browser:
- It's likely that people will want the same behavior most of the time, making them awkward to use.
- The default behavior for the two is different, and in fact the iOS flag has three modes, not two, since it has special handling of null, making it extremely confusing.
- This doesn't scale to other platforms (all desktop platforms could have in-app pop-up windows or overlay views, for instance)
- There's handling of iOS overlay brightness, which when it was added had to be done in the native plugin implementation code, but has since moved entirely into Dart, so doesn't need to be in the plugin at all since someone could easily write that wrapper themselves.
I think it's time to do a breaking change to the plugin that completely overhauls the API. My current proposal is https://github.com/stuartmorgan/plugins/blob/url-launcher-uri/packages/url_launcher/url_launcher/lib/url_launcher.dart, but I'll gather feedback and potentially iterated before moving forward. (Once I've settled on an API I'll do a change to the platform interface and the implementations first, so it's not shoehorning the new API into the old platform interface API.)
ljmatan, adrianjagielak, dxvid-pts, xvrh, TahaTesser and 1 more
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectp: url_launcherPlugin to launch external applicationsPlugin to launch external applicationspackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.