import 'package:flutter/material.dart';

class SecurityConfirmButton extends StatelessWidget {
  final String text;
  final String disableText;
  final bool enabled;
  final VoidCallback onClick;

  const SecurityConfirmButton({
    Key key,
    this.text,
    this.disableText,
    this.enabled = true,
    this.onClick,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      child: Container(
        width: double.infinity,
        height: 48,
        margin: EdgeInsets.only(left: 12.5, right: 12.5, top: 4, bottom: 4),
        decoration: BoxDecoration(
          color: enabled ? Color(0xffff4242) : Color(0xffd8d8d8),
          borderRadius: BorderRadius.circular(24),
        ),
        child: Center(
          child: Text(
            (enabled ? text : (disableText ?? text)) ?? '',
            style: TextStyle(
              fontSize: 13,
              color: Colors.white,
            ),
          ),
        ),
      ),
      onTap: () {
        if (enabled && onClick != null) {
          onClick();
        }
      },
    );
  }
}
