Skip to content

Commit 6fd98f5

Browse files
authored
Migrate to PopScope from WillPopScope (#125)
2 parents bd2b5b6 + d06daa7 commit 6fd98f5

19 files changed

+248
-177
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 2.0.0
2+
3+
- Support Flutter 3.16
4+
- `onWillPop` is deleted, and `canPop`/`onPopInvoked` is added instead
5+
- Migrate to PopScope from WillPopScope
6+
- https://docs.flutter.dev/release/breaking-changes/android-predictive-back
7+
18
## 1.10.1
29

310
- Fix TextStyle of showConfirmationDialog/showModalActionSheet (#124)

example/android/app/src/main/AndroidManifest.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
<application
33
android:label="example"
44
android:name="${applicationName}"
5-
android:icon="@mipmap/ic_launcher">
5+
android:icon="@mipmap/ic_launcher"
6+
android:enableOnBackInvokedCallback="true">
67
<activity
78
android:name=".MainActivity"
89
android:exported="true"
@@ -16,12 +17,12 @@
1617
while the Flutter UI initializes. After that, this theme continues
1718
to determine the Window background behind the Flutter UI. -->
1819
<meta-data
19-
android:name="io.flutter.embedding.android.NormalTheme"
20-
android:resource="@style/NormalTheme"
21-
/>
20+
android:name="io.flutter.embedding.android.NormalTheme"
21+
android:resource="@style/NormalTheme"
22+
/>
2223
<intent-filter>
23-
<action android:name="android.intent.action.MAIN"/>
24-
<category android:name="android.intent.category.LAUNCHER"/>
24+
<action android:name="android.intent.action.MAIN" />
25+
<category android:name="android.intent.category.LAUNCHER" />
2526
</intent-filter>
2627
</activity>
2728
<!-- Don't delete the meta-data below.

example/lib/pages/alert_page.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ class AlertPage extends StatelessWidget {
3434
},
3535
),
3636
ListTile(
37-
title: const Text('OK Dialog (onWillPop: false)'),
37+
title: const Text('OK Dialog (canPop: false)'),
3838
onTap: () async {
3939
final result = await showOkAlertDialog(
4040
context: context,
4141
title: 'Title',
4242
message: 'This is message.',
43-
onWillPop: () => Future.value(false),
43+
canPop: false,
4444
);
4545
assert(result == OkCancelResult.ok);
4646
logger.info(result);

example/macos/Flutter/GeneratedPluginRegistrant.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
import FlutterMacOS
66
import Foundation
77

8+
import appkit_ui_element_colors
89
import dynamic_color
910
import file_selector_macos
1011
import macos_ui
1112
import macos_window_utils
1213
import url_launcher_macos
1314

1415
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
16+
AppkitUiElementColorsPlugin.register(with: registry.registrar(forPlugin: "AppkitUiElementColorsPlugin"))
1517
DynamicColorPlugin.register(with: registry.registrar(forPlugin: "DynamicColorPlugin"))
1618
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
1719
MacOSUiPlugin.register(with: registry.registrar(forPlugin: "MacOSUiPlugin"))

0 commit comments

Comments
 (0)