Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/url_launcher/url_launcher_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
## 6.3.21

* Updates minimum supported SDK version to Flutter 3.35.
* Removes obsolete code related to supporting SDK <24.

## 6.3.20

* Restore SDK 21-23 support, as the previous change was intended
to require Flutter 3.35, but didn't.

## 6.3.19

* **Retracted** due to not including the Flutter min SDK change.
* Updates minimum supported SDK version to Flutter 3.35.
* Removes obsolete code related to supporting SDK <24.
Comment on lines 14 to 15

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

According to the repository's CHANGELOG style guide, when a version is retracted, the content should be replaced with a single bullet point explaining the retraction. The original change notes for the retracted version should be removed.1

Style Guide References

Footnotes

  1. For a version that is retracted, the version header should be kept, but the content should be replaced with a single bullet point: * **Retracted** for (reason).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love that it added a footnote to try to make this hallucination sound more convincing.


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ android {
compileSdk = flutter.compileSdkVersion

defaultConfig {
minSdkVersion 21
minSdkVersion 24
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import android.os.Bundle;
import android.os.Message;
import android.provider.Browser;
Expand All @@ -20,7 +19,6 @@
import android.webkit.WebViewClient;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.annotation.VisibleForTesting;
import androidx.core.content.ContextCompat;
import java.util.Collections;
Expand Down Expand Up @@ -49,7 +47,6 @@ public void onReceive(Context context, Intent intent) {

private final WebViewClient webViewClient =
new WebViewClient() {
@RequiresApi(Build.VERSION_CODES.N)
@Override
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
view.loadUrl(request.getUrl().toString());
Expand All @@ -75,17 +72,6 @@ public boolean shouldOverrideUrlLoading(
webview.loadUrl(request.getUrl().toString());
return true;
}

/*
* This method is deprecated in API 24. Still overridden to support
* earlier Android versions.
*/
@SuppressWarnings("deprecation")
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
webview.loadUrl(url);
return true;
}
};

final WebView newWebView = new WebView(webview.getContext());
Expand Down
77 changes: 34 additions & 43 deletions packages/url_launcher/url_launcher_android/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -166,76 +166,67 @@ class _MyHomePageState extends State<MyHomePage> {
),
),
ElevatedButton(
onPressed:
_hasCallSupport
? () => setState(() {
_launched = _makePhoneCall(_phone);
})
: null,
child:
_hasCallSupport
? const Text('Make phone call')
: const Text('Calling not supported'),
onPressed: _hasCallSupport
? () => setState(() {
_launched = _makePhoneCall(_phone);
})
: null,
child: _hasCallSupport
? const Text('Make phone call')
: const Text('Calling not supported'),
),
const Padding(
padding: EdgeInsets.all(16.0),
child: Text(toLaunch),
),
ElevatedButton(
onPressed:
_hasCustomTabSupport
? () => setState(() {
_launched = _launchInBrowser(toLaunch);
})
: null,
onPressed: _hasCustomTabSupport
? () => setState(() {
_launched = _launchInBrowser(toLaunch);
})
: null,
child: const Text('Launch in browser'),
),
const Padding(padding: EdgeInsets.all(16.0)),
ElevatedButton(
onPressed:
() => setState(() {
_launched = _launchInCustomTab(toLaunch);
}),
onPressed: () => setState(() {
_launched = _launchInCustomTab(toLaunch);
}),
child: const Text('Launch in Android Custom Tab'),
),
const Padding(padding: EdgeInsets.all(16.0)),
ElevatedButton(
onPressed:
() => setState(() {
_launched = _launchInWebView(toLaunch);
}),
onPressed: () => setState(() {
_launched = _launchInWebView(toLaunch);
}),
child: const Text('Launch in web view'),
),
ElevatedButton(
onPressed:
() => setState(() {
_launched = _launchInWebViewWithCustomHeaders(toLaunch);
}),
onPressed: () => setState(() {
_launched = _launchInWebViewWithCustomHeaders(toLaunch);
}),
child: const Text('Launch in web view (Custom headers)'),
),
ElevatedButton(
onPressed:
() => setState(() {
_launched = _launchInWebViewWithoutJavaScript(toLaunch);
}),
onPressed: () => setState(() {
_launched = _launchInWebViewWithoutJavaScript(toLaunch);
}),
child: const Text('Launch in web view (JavaScript OFF)'),
),
ElevatedButton(
onPressed:
() => setState(() {
_launched = _launchInWebViewWithoutDomStorage(toLaunch);
}),
onPressed: () => setState(() {
_launched = _launchInWebViewWithoutDomStorage(toLaunch);
}),
child: const Text('Launch in web view (DOM storage OFF)'),
),
const Padding(padding: EdgeInsets.all(16.0)),
ElevatedButton(
onPressed:
() => setState(() {
_launched = _launchInWebView(toLaunch);
Timer(const Duration(seconds: 5), () {
launcher.closeWebView();
});
}),
onPressed: () => setState(() {
_launched = _launchInWebView(toLaunch);
Timer(const Duration(seconds: 5), () {
launcher.closeWebView();
});
}),
child: const Text('Launch in web view + close after 5 seconds'),
),
const Padding(padding: EdgeInsets.all(16.0)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ description: Demonstrates how to use the url_launcher plugin.
publish_to: none

environment:
sdk: ^3.7.0
flutter: ">=3.29.0"
sdk: ^3.9.0
flutter: ">=3.35.0"

dependencies:
flutter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@ class UrlLauncherApi {
BinaryMessenger? binaryMessenger,
String messageChannelSuffix = '',
}) : pigeonVar_binaryMessenger = binaryMessenger,
pigeonVar_messageChannelSuffix =
messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty
? '.$messageChannelSuffix'
: '';
final BinaryMessenger? pigeonVar_binaryMessenger;

static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,9 @@ class UrlLauncherAndroid extends UrlLauncherPlatform {
return launchUrl(
url,
LaunchOptions(
mode:
useWebView
? PreferredLaunchMode.inAppWebView
: PreferredLaunchMode.externalApplication,
mode: useWebView
? PreferredLaunchMode.inAppWebView
: PreferredLaunchMode.externalApplication,
webViewConfiguration: InAppWebViewConfiguration(
enableDomStorage: enableDomStorage,
enableJavaScript: enableJavaScript,
Expand Down
6 changes: 3 additions & 3 deletions packages/url_launcher/url_launcher_android/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: url_launcher_android
description: Android implementation of the url_launcher plugin.
repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_android
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22
version: 6.3.20
version: 6.3.21

environment:
sdk: ^3.7.0
flutter: ">=3.29.0"
sdk: ^3.9.0
flutter: ">=3.35.0"

flutter:
plugin:
Expand Down