import 'package:flutter/material.dart'; import 'package:ocbo_esign_mobile/widgets/text_widget.dart'; class ButtonWidget extends StatelessWidget { final String text; final VoidCallback? onPressed; final double? width; final bool disabled; const ButtonWidget({super.key, required this.text, this.onPressed, this.width, required this.disabled}); @override Widget build(BuildContext context) { return ElevatedButton( style: ElevatedButton.styleFrom( foregroundColor: const Color.fromRGBO(250, 250, 250, 1), // text color backgroundColor: disabled ? const Color.fromARGB(112, 13, 109, 253) : const Color(0xff0d6efd), elevation: disabled ? 0 : 4, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8), // rounded corners ), minimumSize: Size( width ?? (MediaQuery.of(context).size.width <= 768 ? MediaQuery.of(context).size.width - 96 : 320), 44, ), padding: const EdgeInsets.symmetric(vertical: 10, horizontal: 16), ), onPressed: onPressed, child: TextWidget(text: text, size: 16), ); } }