@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
22import 'package:getflutter/colors/gf_color.dart' ;
33
44class GFAccordion extends StatefulWidget {
5-
65 const GFAccordion (
76 {Key key,
87 this .child,
@@ -13,11 +12,11 @@ class GFAccordion extends StatefulWidget {
1312 this .title,
1413 this .textStyle = const TextStyle (color: Colors .black, fontSize: 16 ),
1514 this .titlePadding,
16- this .descriptionPadding ,
17- this .descriptionbackgroundColor ,
15+ this .contentbackgroundColor ,
16+ this .contentPadding ,
1817 this .contentChild,
19- this .titleborderColor,
20- this .contentBorderColor,
18+ this .titleborderColor,
19+ this .contentBorderColor,
2120 this .margin})
2221 : super (key: key);
2322
@@ -49,16 +48,18 @@ class GFAccordion extends StatefulWidget {
4948 final EdgeInsets titlePadding;
5049
5150 ///descriptionPadding of type [EdgeInsets] which is used to set the padding of the [GFAccordion] description
52- final EdgeInsets descriptionPadding ;
51+ final EdgeInsets contentPadding ;
5352
5453 /// type of [Color] or [GFColor] which is used to change the background color of the [GFAccordion] description
55- final dynamic descriptionbackgroundColor ;
54+ final dynamic contentbackgroundColor ;
5655
5756 ///margin of type [EdgeInsets] which is used to set the margin of the [GFAccordion]
5857 final EdgeInsets margin;
5958
59+ ///titleborderColor of type [Color] or [GFColor] which is used to change the border color of title
6060 final dynamic titleborderColor;
6161
62+ ///contentBorderColor of type [Color] or [GFColor] which is used to change the border color of content
6263 final dynamic contentBorderColor;
6364
6465 @override
@@ -91,11 +92,6 @@ class _GFAccordionState extends State<GFAccordion>
9192 @override
9293 Widget build (BuildContext context) {
9394 return Container (
94- // decoration: BoxDecoration(
95- // border: Border.all(
96- // color:widget.borderColor !=null ? widget.borderColor: Colors.white
97- // ),
98- // ),
9995 margin: widget.margin != null ? widget.margin : EdgeInsets .all (10 ),
10096 child: Column (
10197 crossAxisAlignment: CrossAxisAlignment .start,
@@ -117,17 +113,18 @@ class _GFAccordionState extends State<GFAccordion>
117113 },
118114 child: Container (
119115 decoration: BoxDecoration (
120- border: widget.titleborderColor == null ? widget.titleborderColor: Border (
121- top: BorderSide (color: Colors .black38),
122- left: BorderSide (color: Colors .black38),
123- right: BorderSide (color: Colors .black38),
124- bottom: BorderSide (color: Colors .black38)
125- ),
126- color: showAccordion? widget.titlebackgroundColor != null
127- ? widget.titlebackgroundColor
128- : Color (0xFFE0E0E0 ): widget.titlebackgroundColor
129- ),
130-
116+ border: widget.titleborderColor == null
117+ ? widget.titleborderColor
118+ : Border (
119+ top: BorderSide (color: Colors .black38),
120+ left: BorderSide (color: Colors .black38),
121+ right: BorderSide (color: Colors .black38),
122+ bottom: BorderSide (color: Colors .black38)),
123+ color: showAccordion
124+ ? widget.titlebackgroundColor != null
125+ ? widget.titlebackgroundColor
126+ : Color (0xFFE0E0E0 )
127+ : widget.titlebackgroundColor),
131128 padding: widget.titlePadding != null
132129 ? widget.titlePadding
133130 : EdgeInsets .all (10 ),
@@ -146,20 +143,20 @@ class _GFAccordionState extends State<GFAccordion>
146143 ),
147144 showAccordion
148145 ? Container (
149- decoration: BoxDecoration (
150- border: widget.contentBorderColor == null ? widget.contentBorderColor: Border (
151- bottom: BorderSide (color: Colors .black38),
152- left: BorderSide (color: Colors .black38),
153- right: BorderSide (color: Colors .black38)
154- ),
155- color: widget.descriptionbackgroundColor != null
156- ? widget.descriptionbackgroundColor
157- : Colors .white70,
158- ),
146+ decoration: BoxDecoration (
147+ border: widget.contentBorderColor == null
148+ ? widget.contentBorderColor
149+ : Border (
150+ bottom: BorderSide (color: Colors .black38),
151+ left: BorderSide (color: Colors .black38),
152+ right: BorderSide (color: Colors .black38)),
153+ color: widget.contentbackgroundColor != null
154+ ? widget.contentbackgroundColor
155+ : Colors .white70,
156+ ),
159157 width: MediaQuery .of (context).size.width,
160-
161- padding: widget.descriptionPadding != null
162- ? widget.descriptionPadding
158+ padding: widget.contentPadding != null
159+ ? widget.contentPadding
163160 : EdgeInsets .all (10 ),
164161 child: SlideTransition (
165162 position: offset,
0 commit comments