Closed stephane-archer closed 1 year ago
@baumths you are welcome, I didn't know ExpandIcon was part of Flutter. If we can't customize ExpandIcon then I would be glad if we could replace it with another class of your own or that the user defines.
As the flutter framework already provides such a widget, I would recommend you to file an issue there so they add more customization options to the ExpandIcon
widget instead.
In the meantime, I've put together an example using the AnimatedRotation widget, which you can copy and tweak to look as desired:
class MyExpandIcon extends StatefulWidget {
const MyExpandIcon({super.key});
@override
State<MyExpandIcon> createState() => MyExpandIconState();
}
class MyExpandIconState extends State<MyExpandIcon> {
bool isExpanded = false;
@override
Widget build(BuildContext context) {
return IconButton(
onPressed: () => setState(() => isExpanded = !isExpanded),
icon: AnimatedRotation(
turns: isExpanded ? 0.5 : 0,
duration: kThemeAnimationDuration,
child: const Icon(Icons.chevron_right),
),
);
}
}
Hey @stephane-archer , thank you for using the package!
The
ExpandIcon
widget is part of the flutter flamework.Ref: https://api.flutter.dev/flutter/material/ExpandIcon-class.html