defaultStyleOf method

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

Implementation

@override
ButtonStyle defaultStyleOf(BuildContext context) {
  assert(debugCheckHasFluentTheme(context));
  final theme = FluentTheme.of(context);
  final isIconSmall = SmallIconButton.of(context) != null ||
      iconButtonMode == IconButtonMode.tiny;
  final isSmall = iconButtonMode != null
      ? iconButtonMode != IconButtonMode.large
      : SmallIconButton.of(context) != null;
  return ButtonStyle(
    iconSize: ButtonState.all(isIconSmall ? 11.0 : null),
    padding: ButtonState.all(
        isSmall ? kDefaultButtonPadding : const EdgeInsets.all(8.0)),
    backgroundColor: ButtonState.resolveWith((states) {
      if (states.isDisabled) {
        return ButtonThemeData.buttonColor(context, states);
      } else {
        return ButtonThemeData.uncheckedInputColor(
          theme,
          states,
          transparentWhenNone: true,
        );
      }
    }),
    foregroundColor: ButtonState.resolveWith((states) {
      if (states.isDisabled) return theme.resources.textFillColorDisabled;
      return null;
    }),
    shape: ButtonState.all(RoundedRectangleBorder(
      borderRadius: BorderRadius.circular(4.0),
    )),
  );
}