Skip to content

Commit a7a36a9

Browse files
committed
process #291
1 parent b1dcf96 commit a7a36a9

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# [5.0.1]
2+
* Fix [#291](https://github.com/fluttercandies/flutter_smart_dialog/issues/291): `showAttach`/`bindWidget` now hides when pushing custom page routes (non-`PopupRoute`) and reappears after popping back, matching `MaterialPageRoute` behavior
3+
14
# [5.0.0]
25
* Breaking change: Align `onBack` interception behavior for dialog/attach. When `onBack` returns `true`, the back event is always intercepted. Fix [#284](https://github.com/fluttercandies/flutter_smart_dialog/issues/284)
36
* Fix [#282](https://github.com/fluttercandies/flutter_smart_dialog/issues/282): avoid calling `OverlayEntry.markNeedsBuild` after the entry is disposed during rapid toast updates

lib/src/helper/monitor_widget_helper.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ class MonitorWidgetHelper {
5353
}
5454

5555
void _calculate(BuildContext context, DialogInfo item) {
56+
final curRoute = RouteRecord.curRoute;
57+
if (item.bindWidget != null &&
58+
curRoute != item.route &&
59+
curRoute is! PopupRoute) {
60+
item.dialog.hide();
61+
return;
62+
}
63+
5664
var renderObject = _safeRenderBox(context);
5765
if (renderObject == null) {
5866
item.dialog.hide();

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description:
33
An elegant Flutter Dialog solution,
44
Easily implement Toast, Loading and custom Dialog,
55
Make the use of the dialog easier!
6-
version: 5.0.0
6+
version: 5.0.1
77
homepage: https://github.com/fluttercandies/flutter_smart_dialog
88
# flutter pub publish --server=https://pub.dartlang.org
99
# flutter build web --release --base-href="/flutter_smart_dialog/web/"

0 commit comments

Comments
 (0)