shapeBorder static method

ShapeBorder shapeBorder(
  1. BuildContext context,
  2. Set<ButtonStates> states
)

Implementation

static ShapeBorder shapeBorder(
    BuildContext context, Set<ButtonStates> states) {
  final theme = FluentTheme.of(context);
  if (states.isPressing || states.isDisabled) {
    return RoundedRectangleBorder(
      side: BorderSide(
        color: theme.resources.controlStrokeColorDefault,
      ),
      borderRadius: BorderRadius.circular(4.0),
    );
  } else {
    return RoundedRectangleGradientBorder(
      borderRadius: BorderRadius.circular(4.0),
      gradient: LinearGradient(
        begin: const Alignment(0, 0),
        end: const Alignment(0.0, 3),
        colors: [
          theme.resources.controlStrokeColorSecondary,
          theme.resources.controlStrokeColorDefault,
        ],
        stops: const [0.3, 1.0],
      ),
    );
  }
}