Skip to content

Commit 6afd589

Browse files
committed
alert issue fixed
1 parent 24f4c60 commit 6afd589

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

lib/components/alert/gf_alert.dart

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,24 @@ class GFAlert extends StatefulWidget {
6161
}
6262

6363
class _GFAlertState extends State<GFAlert> with TickerProviderStateMixin {
64+
String title;
65+
String content;
66+
Widget child;
67+
Widget contentChild;
68+
Widget bottombar;
69+
70+
6471
AnimationController animationController;
6572
Animation<double> animation;
6673

6774
@override
6875
void initState() {
76+
content= widget.content;
77+
title = widget.title;
78+
child=widget.child;
79+
contentChild=widget.contentChild;
80+
bottombar=widget.bottombar;
81+
6982
animationController = AnimationController(
7083
duration: const Duration(milliseconds: 300),
7184
vsync: this,
@@ -84,6 +97,18 @@ class _GFAlertState extends State<GFAlert> with TickerProviderStateMixin {
8497
super.dispose();
8598
}
8699

100+
101+
102+
@override
103+
void didUpdateWidget(GFAlert oldWidget){
104+
content= widget.content;
105+
title = widget.title;
106+
child=widget.child;
107+
contentChild=widget.contentChild;
108+
bottombar=widget.bottombar;
109+
super.didUpdateWidget(oldWidget);
110+
}
111+
87112
@override
88113
Widget build(BuildContext context) => FadeTransition(
89114
opacity: animation,

lib/components/floating_widget/gf_floating_widget.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@ class GFFloatingWidget extends StatefulWidget {
3737
}
3838

3939
class _GFFloatingWidgetState extends State<GFFloatingWidget> {
40+
41+
Widget child;
42+
43+
@override
44+
void initState() {
45+
child=widget.child;
46+
super.initState();
47+
}
48+
49+
@override
50+
void didUpdateWidget(GFFloatingWidget oldWidget){
51+
child=widget.child;
52+
super.didUpdateWidget(oldWidget);
53+
}
4054
@override
4155
Widget build(BuildContext context) => Stack(
4256
alignment: Alignment.center,

0 commit comments

Comments
 (0)