build method

  1. @override
Widget build(
  1. BuildContext context
)
override

//////////// ////////////

Implementation

// II.C - Build Method
///////////////
@override
Widget build(BuildContext context) {
  return OutlinedButton(
    onPressed: isLoading ? null : onPressed,
    style: OutlinedButton.styleFrom(
      padding: EdgeInsets.symmetric(vertical: RALISpacing.sm),
      minimumSize: Size(double.infinity, 0),
      shape: RoundedRectangleBorder(
        borderRadius: BorderRadius.circular(RALISpacing.radiusSm),
      ),
    ),
    child: isLoading
        ? const SizedBox(
            height: 24,
            width: 24,
            child: CircularProgressIndicator(strokeWidth: 2),
          )
        : Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              // Google 'G' logo implemented with Container instead of external image
              Container(
                height: 24,
                width: 24,
                decoration: const BoxDecoration(
                  color: Colors.white,
                  shape: BoxShape.circle,
                ),
                child: Center(
                  child: CustomPaint(
                    size: const Size(18, 18),
                    painter: GoogleLogoPainter(),
                  ),
                ),
              ),
              SizedBox(width: RALISpacing.sm),
              Text(
                text,
                style: RALITypography.bodyMedium,
              ),
            ],
          ),
  );
}