Skip to content

Commit 90b992f

Browse files
committed
process #253
1 parent 5181a6d commit 90b992f

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* Add AdjustBuilder
1010
* Fix [#229](https://github.com/fluttercandies/flutter_smart_dialog/issues/229), [#235](https://github.com/fluttercandies/flutter_smart_dialog/issues/235)
1111
* Fix [#248](https://github.com/fluttercandies/flutter_smart_dialog/issues/248)
12+
* Fix [#253](https://github.com/fluttercandies/flutter_smart_dialog/issues/253)
1213

1314
* # [4.9.7+x]
1415
* optimize bindWidget, when bindWidget is not null, bindPage will be automatically set to false.

example/lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ class SmartDialogPage extends StatelessWidget {
111111
SmartDialog.showAttach(
112112
targetContext: context,
113113
alignment: Alignment.bottomCenter,
114-
animationType: SmartAnimationType.scale,
114+
animationType: SmartAnimationType.centerScale_otherSlide,
115115
builder: (_) {
116116
return Container(height: 50, width: 30, color: Colors.red);
117117
},

lib/src/widget/helper/attach_widget.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ class _AttachWidgetState extends State<AttachWidget>
136136
_originChild = widget.originChild;
137137
_postFrameOpacity = 0;
138138

139-
if (widget.targetContext != null) {
140-
final renderBox = widget.targetContext!.findRenderObject() as RenderBox;
139+
final renderBox = widget.targetContext?.findRenderObject() as RenderBox?;
140+
if (renderBox != null) {
141141
targetOffset = renderBox.localToGlobal(Offset.zero);
142142
targetSize = renderBox.size;
143143
}

lib/src/widget/helper/toast_helper.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ class _ToastHelperState extends State<ToastHelper> with WidgetsBindingObserver {
3232
ViewUtils.addSafeUse(() {
3333
if (!mounted) return;
3434

35-
final renderBox = _childContext!.findRenderObject() as RenderBox;
36-
selfOffset = renderBox.localToGlobal(Offset.zero);
37-
selfSize = renderBox.size;
35+
final renderBox = _childContext?.findRenderObject() as RenderBox?;
36+
if (renderBox != null) {
37+
selfOffset = renderBox.localToGlobal(Offset.zero);
38+
selfSize = renderBox.size;
39+
}
3840
_dealKeyboard();
3941
});
4042
super.initState();

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: 4.9.8+6
6+
version: 4.9.8+7
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)