lannodev / we_slide

A backdrop animated widget
MIT License
75 stars 25 forks source link

Listen to panel status #2

Closed luislocio closed 3 years ago

luislocio commented 3 years ago

Is there a way to react to the panel status? I want to do something when the user open and closes the panel through.

I've seen others packages with methods like onClose and onOpen, but they are not as nice as your package.

luislocio commented 3 years ago

Hey, solved it using an ValueListenableBuilder. Sorry for bothering.

ValueListenableBuilder(
    valueListenable: widget.panelController,
    builder: (context, isOpen, child) {
        return IconButton(
            icon: isOpen ? Icon(Icons.arrow_drop_down) : Icon(Icons.arrow_drop_up),
            onPressed: () => _togglePannel(),
        );
    },
),