Skip to content

Commit 0d70624

Browse files
authored
Merge branch 'main' into manual-roll-master-to-c246ecd
2 parents c49be3c + bb8c7b2 commit 0d70624

File tree

18 files changed

+173
-9
lines changed

18 files changed

+173
-9
lines changed

packages/pigeon/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 19.0.2
2+
3+
* [kotlin] Adds the `@JvmOverloads` to the `HostApi` setUp method. This prevents the calling Java code from having to provide an empty `String` as Kotlin provides it by default
4+
15
## 19.0.1
26

37
* [dart] Updates `PigeonInstanceMangerApi` to use the shared api channel code.

packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ interface ExampleHostApi {
118118
/** The codec used by ExampleHostApi. */
119119
val codec: MessageCodec<Any?> by lazy { ExampleHostApiCodec }
120120
/** Sets up an instance of `ExampleHostApi` to handle messages through the `binaryMessenger`. */
121+
@JvmOverloads
121122
fun setUp(
122123
binaryMessenger: BinaryMessenger,
123124
api: ExampleHostApi?,

packages/pigeon/lib/generator_tools.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import 'ast.dart';
1313
/// The current version of pigeon.
1414
///
1515
/// This must match the version in pubspec.yaml.
16-
const String pigeonVersion = '19.0.1';
16+
const String pigeonVersion = '19.0.2';
1717

1818
/// Prefix for all local variables in methods.
1919
///

packages/pigeon/lib/kotlin_generator.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@ class KotlinGenerator extends StructuredGenerator<KotlinOptions> {
430430
});
431431
indent.writeln(
432432
'/** Sets up an instance of `$apiName` to handle messages through the `binaryMessenger`. */');
433+
indent.writeln('@JvmOverloads');
433434
indent.write(
434435
'fun setUp(binaryMessenger: BinaryMessenger, api: $apiName?, messageChannelSuffix: String = "") ');
435436
indent.addScoped('{', '}', () {

packages/pigeon/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: pigeon
22
description: Code generator tool to make communication between Flutter and the host platform type-safe and easier.
33
repository: https://github.com/flutter/packages/tree/main/packages/pigeon
44
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+pigeon%22
5-
version: 19.0.1 # This must match the version in lib/generator_tools.dart
5+
version: 19.0.2 # This must match the version in lib/generator_tools.dart
66

77
environment:
88
sdk: ^3.2.0

packages/pigeon/test/kotlin_generator_test.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ void main() {
231231
final String code = sink.toString();
232232
expect(code, contains('interface Api'));
233233
expect(code, contains('fun doSomething(input: Input): Output'));
234+
expect(code, contains('''
235+
@JvmOverloads
236+
fun setUp(binaryMessenger: BinaryMessenger, api: Api?, messageChannelSuffix: String = "") {
237+
'''));
234238
expect(code, contains('channel.setMessageHandler'));
235239
expect(code, contains('''
236240
if (api != null) {

packages/url_launcher/url_launcher/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
## NEXT
1+
## 6.3.0
22

3+
* Adds `BrowserConfiguration` parameter, to configure in-app browser views, such as Android Custom Tabs or SFSafariViewController.
4+
* Adds `showTitle` to `BrowserConfiguration`, to allow showing webpage titles in in-app browser views.
35
* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2.
46

57
## 6.2.6

packages/url_launcher/url_launcher/example/lib/main.dart

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ class _MyHomePageState extends State<MyHomePage> {
7474
}
7575
}
7676

77+
Future<void> _launchInAppWithBrowserOptions(Uri url) async {
78+
if (!await launchUrl(
79+
url,
80+
mode: LaunchMode.inAppBrowserView,
81+
browserConfiguration: const BrowserConfiguration(showTitle: true),
82+
)) {
83+
throw Exception('Could not launch $url');
84+
}
85+
}
86+
7787
Future<void> _launchAsInAppWebViewWithCustomHeaders(Uri url) async {
7888
if (!await launchUrl(
7989
url,
@@ -220,6 +230,13 @@ class _MyHomePageState extends State<MyHomePage> {
220230
child: const Text('Launch in app + close after 5 seconds'),
221231
),
222232
const Padding(padding: EdgeInsets.all(16.0)),
233+
ElevatedButton(
234+
onPressed: () => setState(() {
235+
_launched = _launchInAppWithBrowserOptions(toLaunch);
236+
}),
237+
child: const Text('Launch in app with title displayed'),
238+
),
239+
const Padding(padding: EdgeInsets.all(16.0)),
223240
Link(
224241
uri: Uri.parse(
225242
'https://pub.dev/documentation/url_launcher/latest/link/link-library.html'),

packages/url_launcher/url_launcher/lib/src/type_conversion.dart

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,24 @@ import 'types.dart';
88

99
/// Converts an (app-facing) [WebViewConfiguration] to a (platform interface)
1010
/// [InAppWebViewConfiguration].
11-
InAppWebViewConfiguration convertConfiguration(WebViewConfiguration config) {
11+
InAppWebViewConfiguration convertWebViewConfiguration(
12+
WebViewConfiguration config) {
1213
return InAppWebViewConfiguration(
1314
enableJavaScript: config.enableJavaScript,
1415
enableDomStorage: config.enableDomStorage,
1516
headers: config.headers,
1617
);
1718
}
1819

20+
/// Converts an (app-facing) [BrowserConfiguration] to a (platform interface)
21+
/// [InAppBrowserConfiguration].
22+
InAppBrowserConfiguration convertBrowserConfiguration(
23+
BrowserConfiguration config) {
24+
return InAppBrowserConfiguration(
25+
showTitle: config.showTitle,
26+
);
27+
}
28+
1929
/// Converts an (app-facing) [LaunchMode] to a (platform interface)
2030
/// [PreferredLaunchMode].
2131
PreferredLaunchMode convertLaunchMode(LaunchMode mode) {

packages/url_launcher/url_launcher/lib/src/types.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,15 @@ class WebViewConfiguration {
5555
/// Not all browsers support this, so it is not guaranteed to be honored.
5656
final Map<String, String> headers;
5757
}
58+
59+
/// Additional configuration options for [LaunchMode.inAppBrowserView]
60+
@immutable
61+
class BrowserConfiguration {
62+
/// Creates a new InAppBrowserConfiguration with given settings.
63+
const BrowserConfiguration({this.showTitle = false});
64+
65+
/// Whether or not to show the webpage title.
66+
///
67+
/// May not be supported on all platforms.
68+
final bool showTitle;
69+
}

0 commit comments

Comments
 (0)