conceptadev/mix

Add ability to set PressableBox to disabled

Closed this issue · 1 comments

Use case

Currently we're unable to set the PressableBox to disabled. Diving into the code for PressableBox we see Pressable has a disabled flag which isn't set (false by default)

Proposal

Add an isEnabled flag to PressableBox which defaults to true:

PressableBox(
  isEnabled: false,
  child: ...,
);

(I chose isEnabled here because I find it better not to use the negation. But could be isDisabled or disabled or whatever)

Alternatively the box could be set to disabled if onPressed is null.

Keep up the good work 🥳

Hello @JakesMD, thanks for your contribution! We appreciate it 😁.
We have developed a solution for your suggestion, please feel free to see it and make comments.