Skip to content

Commit

Permalink
Migrate to PopScope from WillPopScope (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
mono0926 authored Nov 17, 2023
2 parents bd2b5b6 + d06daa7 commit 6fd98f5
Show file tree
Hide file tree
Showing 19 changed files with 248 additions and 177 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 2.0.0

- Support Flutter 3.16
- `onWillPop` is deleted, and `canPop`/`onPopInvoked` is added instead
- Migrate to PopScope from WillPopScope
- https://docs.flutter.dev/release/breaking-changes/android-predictive-back

## 1.10.1

- Fix TextStyle of showConfirmationDialog/showModalActionSheet (#124)
Expand Down
13 changes: 7 additions & 6 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<application
android:label="example"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
android:icon="@mipmap/ic_launcher"
android:enableOnBackInvokedCallback="true">
<activity
android:name=".MainActivity"
android:exported="true"
Expand All @@ -16,12 +17,12 @@
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
Expand Down
4 changes: 2 additions & 2 deletions example/lib/pages/alert_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ class AlertPage extends StatelessWidget {
},
),
ListTile(
title: const Text('OK Dialog (onWillPop: false)'),
title: const Text('OK Dialog (canPop: false)'),
onTap: () async {
final result = await showOkAlertDialog(
context: context,
title: 'Title',
message: 'This is message.',
onWillPop: () => Future.value(false),
canPop: false,
);
assert(result == OkCancelResult.ok);
logger.info(result);
Expand Down
2 changes: 2 additions & 0 deletions example/macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
import FlutterMacOS
import Foundation

import appkit_ui_element_colors
import dynamic_color
import file_selector_macos
import macos_ui
import macos_window_utils
import url_launcher_macos

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AppkitUiElementColorsPlugin.register(with: registry.registrar(forPlugin: "AppkitUiElementColorsPlugin"))
DynamicColorPlugin.register(with: registry.registrar(forPlugin: "DynamicColorPlugin"))
FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
MacOSUiPlugin.register(with: registry.registrar(forPlugin: "MacOSUiPlugin"))
Expand Down
Loading

0 comments on commit 6fd98f5

Please sign in to comment.