m3eDialogActionScope function
Applies the dialog action tokens to text buttons in child.
color drives the label and hover layer; overlay maps states to it.
Implementation
Widget m3eDialogActionScope({
required Color color,
required TextStyle textStyle,
required Color? Function(Color color, Set<WidgetState> states) overlay,
required Widget child,
}) {
return M3EButtonDecorationScope(
styles: const <M3EButtonStyle>{M3EButtonStyle.text},
decoration: M3EButtonDecoration(
foregroundColor: WidgetStateProperty.resolveWith(
(Set<WidgetState> states) =>
states.contains(WidgetState.disabled) ? null : color,
),
overlayColor: WidgetStateProperty.resolveWith(
(Set<WidgetState> states) => overlay(color, states),
),
textStyle: textStyle,
),
child: child,
);
}