You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the material library, we can customize the way a widget looks at every state: disabled, pressing, hovering and focused. That's possible because of MaterialStateProperty<T>. We should have one as well.
Proposal
Create MacosStateProperty<T>, a class that will handle how widgets should look like at every state.
Here's a little example of how it should look like:
PrimaryButton(
cursor:MacosStateProperty.all(MouseCursor.defer), // Sets a value for all the states
color:MacosStateProperty.resolveWith((Set<MacosState> states) {
// sets a value of every stateif (states.contains(MacosState.disabled)) returnMacosTheme.of(context).disabledColor;
// pressing// hovering// focusedreturn defaultColor;
}),
...
),
The text was updated successfully, but these errors were encountered:
I realized this is useless. Widgets such as PushButton, BackButton and IconButton handle their colors internally (for pressing/hovering). The other inputs (checkbox, radio button, switch) doesn't change the color on mouse hover/press.
Use case
On the material library, we can customize the way a widget looks at every state: disabled, pressing, hovering and focused. That's possible because of
MaterialStateProperty<T>
. We should have one as well.Proposal
Create
MacosStateProperty<T>
, a class that will handle how widgets should look like at every state.Here's a little example of how it should look like:
The text was updated successfully, but these errors were encountered: