@@ -17,16 +17,14 @@ class GFAccordion extends StatefulWidget {
1717 this .contentPadding = const EdgeInsets .all (10 ),
1818 this .contentChild,
1919 this .titleBorder = const Border (),
20- this .contentborder = const Border (),
20+ this .contentBorder = const Border (),
2121 this .margin,
2222 this .showAccordion = false ,
2323 this .onToggleCollapsed,
2424 this .titleBorderRadius = const BorderRadius .all (Radius .circular (0 )),
2525 this .contentBorderRadius = const BorderRadius .all (Radius .circular (0 ))})
2626 : super (key: key);
2727
28- final Function (bool ) onToggleCollapsed;
29-
3028 /// controls if the accordion should be collapsed or not making it possible to be controlled from outside
3129 final bool showAccordion;
3230
@@ -45,10 +43,10 @@ class GFAccordion extends StatefulWidget {
4543 /// type of [Color] or [GFColors] which is used to change the background color of the [GFAccordion] title when it is expanded
4644 final Color expandedTitleBackgroundColor;
4745
48- ///collapsedIcon of type [Widget] which is used to show when the [GFAccordion] is collapsed
46+ /// collapsedIcon of type [Widget] which is used to show when the [GFAccordion] is collapsed
4947 final Widget collapsedIcon;
5048
51- ///expandedIcon of type[Widget] which is used when the [GFAccordion] is expanded
49+ /// expandedIcon of type[Widget] which is used when the [GFAccordion] is expanded
5250 final Widget expandedIcon;
5351
5452 /// text of type [String] is alternative to child. text will get priority over titleChild
@@ -57,30 +55,33 @@ class GFAccordion extends StatefulWidget {
5755 /// textStyle of type [textStyle] will be applicable to text only and not for the child
5856 final TextStyle textStyle;
5957
60- ///titlePadding of type [EdgeInsets] which is used to set the padding of the [GFAccordion] title
58+ /// titlePadding of type [EdgeInsets] which is used to set the padding of the [GFAccordion] title
6159 final EdgeInsets titlePadding;
6260
63- ///descriptionPadding of type [EdgeInsets] which is used to set the padding of the [GFAccordion] description
61+ /// descriptionPadding of type [EdgeInsets] which is used to set the padding of the [GFAccordion] description
6462 final EdgeInsets contentPadding;
6563
6664 /// type of [Color] or [GFColors] which is used to change the background color of the [GFAccordion] description
6765 final Color contentBackgroundColor;
6866
69- ///margin of type [EdgeInsets] which is used to set the margin of the [GFAccordion]
67+ /// margin of type [EdgeInsets] which is used to set the margin of the [GFAccordion]
7068 final EdgeInsets margin;
7169
72- ///titleBorderColor of type [Color] or [GFColors] which is used to change the border color of title
70+ /// titleBorderColor of type [Color] or [GFColors] which is used to change the border color of title
7371 final Border titleBorder;
7472
75- ///contentBorderColor of type [Color] or [GFColors] which is used to change the border color of content
76- final Border contentborder ;
73+ /// contentBorderColor of type [Color] or [GFColors] which is used to change the border color of content
74+ final Border contentBorder ;
7775
78- ///titleBorderRadius of type [Radius] which is used to change the border radius of title
76+ /// titleBorderRadius of type [Radius] which is used to change the border radius of title
7977 final BorderRadius titleBorderRadius;
8078
81- ///contentBorderRadius of type [Radius] which is used to change the border radius of content
79+ /// contentBorderRadius of type [Radius] which is used to change the border radius of content
8280 final BorderRadius contentBorderRadius;
8381
82+ /// function called when the content body collapsed
83+ final Function (bool ) onToggleCollapsed;
84+
8485 @override
8586 _GFAccordionState createState () => _GFAccordionState ();
8687}
@@ -95,14 +96,10 @@ class _GFAccordionState extends State<GFAccordion>
9596 @override
9697 void initState () {
9798 showAccordion = widget.showAccordion;
98- animationController = AnimationController (
99- duration: const Duration (seconds: 2 ),
100- vsync: this ,
101- );
99+ animationController =
100+ AnimationController (duration: const Duration (seconds: 2 ), vsync: this );
102101 controller = AnimationController (
103- vsync: this ,
104- duration: const Duration (milliseconds: 300 ),
105- );
102+ duration: const Duration (milliseconds: 300 ), vsync: this );
106103 offset = Tween (
107104 begin: const Offset (0 , - 0.06 ),
108105 end: Offset .zero,
@@ -156,7 +153,7 @@ class _GFAccordionState extends State<GFAccordion>
156153 ? Container (
157154 decoration: BoxDecoration (
158155 borderRadius: widget.contentBorderRadius,
159- border: widget.contentborder ,
156+ border: widget.contentBorder ,
160157 color: widget.contentBackgroundColor ?? Colors .white70,
161158 ),
162159 width: MediaQuery .of (context).size.width,
0 commit comments