Search code examples
flutterflutter-animation

Show/hide widget with drop-down drawer animation with Flutter


With flutter, is there a way to show or hide widget with this type of animation :

enter image description here

Thanks in advance, :)


Solution

  • You Can use the Expandable

    ExpandableNotifier(  // <-- Provides ExpandableController to its children
      child: Column(
        children: [
          Expandable(           // <-- Driven by ExpandableController from ExpandableNotifier
            collapsed: ExpandableButton(  // <-- Expands when tapped on the cover photo
              child: buildCoverPhoto(),
            ),
            expanded: Column(  
              children: [
                buildAllPhotos(),
                ExpandableButton(       // <-- Collapses when tapped on
                  child: Text("Back"),
                ),
              ]
            ),
          ),
        ],
      ),
    );