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(
    padding: ButtonState.all(kDefaultButtonPadding),
    shape: ButtonState.all(RoundedRectangleBorder(
      borderRadius: BorderRadius.circular(2.0),
      side: BorderSide(color: theme.inactiveColor),
    )),
    foregroundColor: ButtonState.all(theme.inactiveColor),
    backgroundColor: ButtonState.resolveWith((states) {
      if (states.isDisabled) {
        return theme.resources.controlFillColorDisabled.withOpacity(0.30);
      } else if (states.isPressing) {
        return theme.inactiveColor.withOpacity(0.25);
      } else if (states.isHovering) {
        return theme.inactiveColor.withOpacity(0.10);
      } else {
        return Colors.transparent;
      }
    }),
    textStyle: ButtonState.all(const TextStyle(
      fontSize: 13.0,
      fontWeight: FontWeight.w600,
      letterSpacing: 0.5,
    )),
  );
}