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
33 stars 12 forks source link

Disable Slider Button #19

Open MohsinIkram-Auxilium opened 3 months ago

MohsinIkram-Auxilium commented 3 months ago

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

maeddin commented 3 months 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?