File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -18,9 +18,13 @@ class GFAccordion extends StatefulWidget {
1818 this .contentChild,
1919 this .titleborder = const Border (),
2020 this .contentBorder = const Border (),
21- this .margin})
21+ this .margin,
22+ this .showAccordion})
2223 : super (key: key);
2324
25+ /// controls if the accordion should be collapsed or not making it possible to be controlled from outside
26+ final bool showAccordion;
27+
2428 /// child of type [Widget] is alternative to title key. title will get priority over titleChild
2529 final Widget titleChild;
2630
@@ -75,10 +79,11 @@ class _GFAccordionState extends State<GFAccordion>
7579 AnimationController animationController;
7680 AnimationController controller;
7781 Animation <Offset > offset;
78- bool showAccordion = false ;
82+ bool showAccordion;
7983
8084 @override
8185 void initState () {
86+ showAccordion = widget.showAccordion;
8287 animationController = AnimationController (
8388 duration: const Duration (seconds: 2 ),
8489 vsync: this ,
You can’t perform that action at this time.
0 commit comments