[url_launcher] docs: note about encoding URIs (#2172)
Add a note about encoding URLs passed to the url_launcher in the packages README.
diff --git a/packages/url_launcher/url_launcher/CHANGELOG.md b/packages/url_launcher/url_launcher/CHANGELOG.md
index 2855ead..6b1327a 100644
--- a/packages/url_launcher/url_launcher/CHANGELOG.md
+++ b/packages/url_launcher/url_launcher/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 5.4.11
+
+* Add documentation in README suggesting how to properly encode urls with special characters.
+
## 5.4.10
* Post-v2 Android embedding cleanups.
@@ -68,7 +72,7 @@
## 5.2.3
-Android: Use android.arch.lifecycle instead of androidx.lifecycle:lifecycle in `build.gradle` to support apps that has not been migrated to AndroidX.
+* Android: Use android.arch.lifecycle instead of androidx.lifecycle:lifecycle in `build.gradle` to support apps that has not been migrated to AndroidX.
## 5.2.2
diff --git a/packages/url_launcher/url_launcher/README.md b/packages/url_launcher/url_launcher/README.md
index 2dcc635..53c7fe9 100644
--- a/packages/url_launcher/url_launcher/README.md
+++ b/packages/url_launcher/url_launcher/README.md
@@ -53,6 +53,27 @@
More details can be found here for [iOS](https://developer.apple.com/library/content/featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html) and [Android](https://developer.android.com/guide/components/intents-common.html)
+### Encoding URLs
+
+URLs must be properly encoded, especially when including spaces or other special characters. This can be done using the [`Uri` class](https://api.dart.dev/stable/2.7.1/dart-core/Uri-class.html):
+```dart
+import 'dart:core';
+import 'package:url_launcher/url_launcher.dart';
+
+final Uri _emailLaunchUri = Uri(
+ scheme: 'mailto',
+ path: 'smith@example.com',
+ queryParameters: {
+ 'subject': 'Example Subject & Symbols are allowed!'
+ }
+);
+
+// ...
+
+// mailto:smith@example.com?subject=Example+Subject+%26+Symbols+are+allowed%21
+launch(_emailLaunchUri.toString());
+```
+
## Handling missing URL receivers
A particular mobile device may not be able to receive all supported URL schemes.
diff --git a/packages/url_launcher/url_launcher/pubspec.yaml b/packages/url_launcher/url_launcher/pubspec.yaml
index 156d608..08ac3f9 100644
--- a/packages/url_launcher/url_launcher/pubspec.yaml
+++ b/packages/url_launcher/url_launcher/pubspec.yaml
@@ -2,7 +2,7 @@
description: Flutter plugin for launching a URL on Android and iOS. Supports
web, phone, SMS, and email schemes.
homepage: https://github.com/flutter/plugins/tree/master/packages/url_launcher/url_launcher
-version: 5.4.10
+version: 5.4.11
flutter:
plugin: