Skip to content

Upgrading url_launcher 5 to 6

Breaking5.7.10 → 6.3.3Breaking4Platform14Deprecated1New5Changed11Fixed10Other41

BreakingUpgrade verdict

4 breaking changes and 14 platform requirement changes.

  • Instead of separate flags for Safari and web view, there is now one launch mode setting that works the same way on Android and iOS.
  • Web view settings are now grouped in one configuration object, and JavaScript and DOM storage are turned on by default instead of off.
  • The new functions take a structured web address object instead of a plain text string, which avoids problems with malformed addresses.
  • The package now uses Dart's null safety, so code using it must also be null safe.
Top 5 of 19 that need code or config changes

Dart SDK requirement changed in 6.3.3: >=2.1.0 <3.0.0 → ^3.11.0.

Flutter requirement changed in 6.3.3: >=1.12.13+hotfix.5 <2.0.0 → >=3.41.0.

Adds url_launcher_android ^6.3.0, url_launcher_ios ^6.2.4.

Moves url_launcher_linux ^0.0.1 → ^3.1.0, url_launcher_macos ^0.0.1 → ^3.1.0, url_launcher_platform_interface ^1.0.9 → ^2.3.0, url_launcher_web ^0.1.5 → ^2.2.0, url_launcher_windows ^0.0.1 → ^3.1.0. Your build may pick other versions.

Breaking4
The new APIs replace forceSafariVC and forceWebView with LaunchMode, making the API platform-neutral and standardizing default behavior between Android and iOS.
forceSafariVCforceWebViewLaunchMode
Web view configuration options move into a new WebViewConfiguration object, and JavaScript and DOM storage now default to enabled rather than disabled.
WebViewConfiguration
The new APIs replace the String URL argument with a Uri to prevent issues with invalid URL strings.
UriString
Migrates the package to null safety.
Platform14
Updates minimum supported SDK version to Flutter 3.41/Dart 3.11.
Updates minimum supported SDK version to Flutter 3.27 and Dart 3.6.
Updates minimum supported SDK version to Flutter 3.19/Dart 3.3.
Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.
Updates the minimum iOS implementation version to include a privacy manifest.
Updates the support matrix in the README to indicate that iOS 11 is no longer supported.
Clients on Flutter versions that still support iOS 11 can keep using the package with iOS 11 but will not receive further iOS implementation updates.
Updates minimum supported SDK version to Flutter 3.13.
Updates minimum supported SDK version to Flutter 3.7/Dart 2.19.
Updates minimum supported SDK version to Flutter 3.10/Dart 3.0.
Updates minimum Flutter version to 3.3.
Updates minimum Flutter version to 3.0.
Updates the minimum Flutter version to 2.10.
Updates minimum Flutter SDK to 2.5 and iOS deployment target to 9.0.
Deprecated1
Deprecates closeWebView in favor of closeInAppWebView to clarify that it is specific to the in-app web view launch option.
closeWebViewcloseInAppWebView