@@ -56,6 +56,7 @@ class GFAlert extends StatefulWidget {
5656
5757 ///type of [Widget] used for the buttons ie, OK, Cancel for the action in [GFAlert]
5858 final Widget bottombar;
59+
5960 @override
6061 _GFAlertState createState () => _GFAlertState ();
6162}
@@ -83,66 +84,58 @@ class _GFAlertState extends State<GFAlert> with TickerProviderStateMixin {
8384
8485 @override
8586 Widget build (BuildContext context) {
86- return Stack (
87- children: < Widget > [
88- Container (
89- height: MediaQuery .of (context).size.height,
90- ),
91- FadeTransition (
92- opacity: animation,
93- child: Column (
94- children: < Widget > [
95- Container (
96- width: widget.type == GFAlertType .fullWidth
97- ? MediaQuery .of (context).size.width
98- : widget.width,
99- constraints: BoxConstraints (minHeight: 50.0 ),
100- margin: widget.type == GFAlertType .fullWidth
101- ? EdgeInsets .only (left: 0 , right: 0 )
102- : EdgeInsets .only (left: 20 , right: 20 ),
103- padding: EdgeInsets .all (15 ),
104- decoration: BoxDecoration (
105- borderRadius: widget.type == GFAlertType .basic
106- ? BorderRadius .circular (3.0 )
107- : widget.type == GFAlertType .rounded
108- ? BorderRadius .circular (10.0 )
109- : BorderRadius .zero,
110- color: widget.backgroundColor != null
111- ? GFColors .getGFColor (widget.backgroundColor)
112- : GFColors .getGFColor (GFColor .white),
113- boxShadow: [
114- BoxShadow (
115- color: Colors .black.withOpacity (0.40 ),
116- blurRadius: 3.0 )
117- ]),
118- child: Column (
119- crossAxisAlignment: CrossAxisAlignment .start,
120- children: < Widget > [
121- widget.title != null
122- ? Text (widget.title, style: widget.titleTextStyle)
123- : (widget.child ?? Container ()),
124- SizedBox (
125- height: 10 ,
126- ),
127- Align (
128- alignment: widget.alignment != null
129- ? widget.alignment
130- : Alignment .topLeft,
131- child: widget.content != null
132- ? Text (widget.content, style: widget.textStyle)
133- : (widget.contentChild ?? Container ()),
134- ),
135- SizedBox (
136- height: 10 ,
137- ),
138- widget.bottombar != null ? widget.bottombar : Container (),
139- ],
87+ return FadeTransition (
88+ opacity: animation,
89+ child: Column (
90+ children: < Widget > [
91+ Container (
92+ width: widget.type == GFAlertType .fullWidth
93+ ? MediaQuery .of (context).size.width
94+ : widget.width,
95+ constraints: BoxConstraints (minHeight: 50.0 ),
96+ margin: widget.type == GFAlertType .fullWidth
97+ ? EdgeInsets .only (left: 0 , right: 0 )
98+ : EdgeInsets .only (left: 20 , right: 20 ),
99+ padding: EdgeInsets .all (15 ),
100+ decoration: BoxDecoration (
101+ borderRadius: widget.type == GFAlertType .basic
102+ ? BorderRadius .circular (3.0 )
103+ : widget.type == GFAlertType .rounded
104+ ? BorderRadius .circular (10.0 )
105+ : BorderRadius .zero,
106+ color: widget.backgroundColor != null
107+ ? GFColors .getGFColor (widget.backgroundColor)
108+ : GFColors .getGFColor (GFColor .white),
109+ boxShadow: [
110+ BoxShadow (
111+ color: Colors .black.withOpacity (0.40 ), blurRadius: 3.0 )
112+ ]),
113+ child: Column (
114+ crossAxisAlignment: CrossAxisAlignment .start,
115+ children: < Widget > [
116+ widget.title != null
117+ ? Text (widget.title, style: widget.titleTextStyle)
118+ : (widget.child ?? Container ()),
119+ SizedBox (
120+ height: 10 ,
121+ ),
122+ Align (
123+ alignment: widget.alignment != null
124+ ? widget.alignment
125+ : Alignment .topLeft,
126+ child: widget.content != null
127+ ? Text (widget.content, style: widget.textStyle)
128+ : (widget.contentChild ?? Container ()),
129+ ),
130+ SizedBox (
131+ height: 10 ,
140132 ),
141- ),
142- ],
133+ widget.bottombar != null ? widget.bottombar : Container (),
134+ ],
135+ ),
143136 ),
144- ) ,
145- ] ,
137+ ] ,
138+ ) ,
146139 );
147140 }
148141}
0 commit comments