primaryButton method

  1. @override
Widget primaryButton({
  1. required String label,
  2. required VoidCallback? onPressed,
  3. bool loading = false,
})
override

The main "Verify" button.

Implementation

@override
Widget primaryButton({
  required String label,
  required VoidCallback? onPressed,
  bool loading = false,
}) {
  final c = theme.buttonColor;
  return SizedBox(
    height: buttonHeight,
    width: double.infinity,
    child: DecoratedBox(
      decoration: BoxDecoration(
        gradient: LinearGradient(
          begin: Alignment.topCenter,
          end: Alignment.bottomCenter,
          stops: const [0, 0.5, 0.5, 1],
          colors: [_lighten(c, 0.18), _lighten(c, 0.06), c, _darken(c, 0.1)],
        ),
        borderRadius: BorderRadius.circular(buttonRadius),
        border: Border.all(color: _darken(c, 0.25)),
        boxShadow: [
          BoxShadow(
            color: Colors.black.withValues(alpha: 0.35),
            blurRadius: 6,
            offset: const Offset(0, 3),
          ),
          BoxShadow(
            color: Colors.white.withValues(alpha: 0.35),
            blurRadius: 0,
            offset: const Offset(0, 1),
          ),
        ],
      ),
      child: buttonInk(
        onPressed: loading ? null : onPressed,
        radius: buttonRadius,
        child: DefaultTextStyle.merge(
          style: TextStyle(
            shadows: [
              Shadow(
                color: Colors.black.withValues(alpha: 0.4),
                offset: const Offset(0, -1),
              ),
            ],
          ),
          child: buttonLabel(label, loading, theme.buttonTextColor),
        ),
      ),
    ),
  );
}