@@ -4,7 +4,6 @@ import 'package:getflutter/getflutter.dart';
44import 'package:getflutter/types/gf_alert_type.dart' ;
55
66class GFAlert extends StatefulWidget {
7-
87 /// Alert has to be wrap inside the body like [GFFloatingWidget] . See [GFFloatingWidget]
98 GFAlert (
109 {Key key,
@@ -57,6 +56,7 @@ class GFAlert extends StatefulWidget {
5756
5857 ///type of [Widget] used for the buttons ie, OK, Cancel for the action in [GFAlert]
5958 final Widget bottombar;
59+
6060 @override
6161 _GFAlertState createState () => _GFAlertState ();
6262}
@@ -84,61 +84,58 @@ class _GFAlertState extends State<GFAlert> with TickerProviderStateMixin {
8484
8585 @override
8686 Widget build (BuildContext context) {
87- return
88- FadeTransition (
89- opacity: animation,
90- child: Column (
91- children: < Widget > [
92- Container (
93- width: widget.type == GFAlertType .fullWidth
94- ? MediaQuery .of (context).size.width
95- : widget.width,
96- constraints: BoxConstraints (minHeight: 50.0 ),
97- margin: widget.type == GFAlertType .fullWidth
98- ? EdgeInsets .only (left: 0 , right: 0 )
99- : EdgeInsets .only (left: 20 , right: 20 ),
100- padding: EdgeInsets .all (15 ),
101- decoration: BoxDecoration (
102- borderRadius: widget.type == GFAlertType .basic
103- ? BorderRadius .circular (3.0 )
104- : widget.type == GFAlertType .rounded
105- ? BorderRadius .circular (10.0 )
106- : BorderRadius .zero,
107- color: widget.backgroundColor != null
108- ? GFColors .getGFColor (widget.backgroundColor)
109- : GFColors .getGFColor (GFColor .white),
110- boxShadow: [
111- BoxShadow (
112- color: Colors .black.withOpacity (0.40 ),
113- blurRadius: 3.0 )
114- ]),
115- child: Column (
116- crossAxisAlignment: CrossAxisAlignment .start,
117- children: < Widget > [
118- widget.title != null
119- ? Text (widget.title, style: widget.titleTextStyle)
120- : (widget.child ?? Container ()),
121- SizedBox (
122- height: 10 ,
123- ),
124- Align (
125- alignment: widget.alignment != null
126- ? widget.alignment
127- : Alignment .topLeft,
128- child: widget.content != null
129- ? Text (widget.content, style: widget.textStyle)
130- : (widget.contentChild ?? Container ()),
131- ),
132- SizedBox (
133- height: 10 ,
134- ),
135- widget.bottombar != null ? widget.bottombar : Container (),
136- ],
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 ()),
137129 ),
138- ),
139- ],
130+ SizedBox (
131+ height: 10 ,
132+ ),
133+ widget.bottombar != null ? widget.bottombar : Container (),
134+ ],
135+ ),
140136 ),
141- );
142-
137+ ],
138+ ),
139+ );
143140 }
144141}
0 commit comments