defaultStyleOf method

ButtonStyle defaultStyleOf(
  1. BuildContext context
)

Default StateTextButton style

Implementation

ButtonStyle defaultStyleOf(BuildContext context) {
  final ThemeData theme = Theme.of(context);
  final ColorScheme colorScheme = theme.colorScheme;

  final EdgeInsetsGeometry scaledPadding = ButtonStyleButton.scaledPadding(
    const EdgeInsets.symmetric(horizontal: 16),
    const EdgeInsets.symmetric(horizontal: 8),
    const EdgeInsets.symmetric(horizontal: 4),
    MediaQuery.maybeOf(context)?.textScaleFactor ?? 1,
  );

  return styleFrom(
    primary: colorScheme.primary,
    onSurface: colorScheme.onSurface,
    fail: colorScheme.primary,
    success: colorScheme.primary,
    shadowColor: theme.shadowColor,
    elevation: 2,
    textStyle: theme.textTheme.button,
    padding: scaledPadding,
    minimumSize: const Size(64, 36),
    maximumSize: Size.infinite,
    side: null,
    shape: const RoundedRectangleBorder(
        borderRadius: BorderRadius.all(Radius.circular(4))),
    enabledMouseCursor: SystemMouseCursors.click,
    disabledMouseCursor: SystemMouseCursors.forbidden,
    visualDensity: theme.visualDensity,
    tapTargetSize: theme.materialTapTargetSize,
    animationDuration: kThemeChangeDuration,
    enableFeedback: true,
    alignment: Alignment.center,
    splashFactory: InkRipple.splashFactory,
  );
}