GotJimmy / accordion

Other
47 stars 44 forks source link

Make flip rotation counter customisable parameter #45

Closed anatoliisudor closed 1 year ago

anatoliisudor commented 1 year ago

First of all, thanks for such an excellent library. Customizing flippable behavior for the accordion section right icon with a basic boolean flag is possible. And you are using RotatedBox for the right icon component, which supports not only flip by setting _flipQuarterTurns to 2 but also rotation to 90 degrees by providing 1.

  /// getter to flip the widget vertically (Icon by default)
  /// on the right of this section header to visually indicate
  /// if this section is open or closed
  get _flipQuarterTurns =>
      flipRightIconIfOpen?.value == true ? (_isOpen ? 2 : 0) : 0;

It would be nice to have a possibility to set this value in options. What do you think? Here are the images describing what it can look like if we rotate the right icon by 90 degrees:

GotJimmy commented 1 year ago

Thanks. While it's true that you flipRightIconIfOpen only supports open or closed, you could use the rightIcon parameter to send in your own widget and turn and customize it whichever way you like.