splashbyte / action_slider

A Flutter slider to confirm actions and provide feedback on the success of these after subsequent loading.
BSD 3-Clause "New" or "Revised" License
32 stars 12 forks source link

Disable Slider Button #19

Open MohsinIkram-Auxilium opened 1 month ago

MohsinIkram-Auxilium commented 1 month ago

How can we disable ActionSlider.custom button just like we can do in the Elevated Button?

maeddin commented 1 month ago

This is currently not supported, but you can simply wrap an IgnorePointer and Opacity around it to achieve the same effect:

IgnorePointer(
    ignoring: !active,
    child: AnimatedOpactiy(
        duration: const Duration(milliseconds: 250),
        opacity: active ? 1.0 : 0.5,
        child: ActionSlider.custom(...),
    ),
)

@MohsinIkram-Auxilium Does this solve your use case?