defaultStyleOf method

  1. @override
ButtonStyle defaultStyleOf(
  1. BuildContext context
)
override

Implementation

@override
ButtonStyle defaultStyleOf(BuildContext context) {
  assert(debugCheckHasFluentTheme(context));
  final theme = FluentTheme.of(context);
  return ButtonStyle(
    cursor: theme.inputMouseCursor,
    zFactor: ButtonState.resolveWith((states) {
      if (states.isPressing) return kDefaultButtonZFactor;
    }),
    padding: ButtonState.all(const EdgeInsets.symmetric(
      horizontal: 12.0,
      vertical: 8.0,
    )),
    shape: ButtonState.all(RoundedRectangleBorder(
      borderRadius: BorderRadius.circular(2.0),
    )),
    backgroundColor: ButtonState.resolveWith((states) {
      return ButtonThemeData.buttonColor(theme.brightness, states);
    }),
    foregroundColor: ButtonState.resolveWith((states) {
      if (states.isDisabled) return theme.disabledColor;
      return ButtonThemeData.buttonColor(theme.brightness, states)
          .basedOnLuminance();
    }),
  );
}