import 'package:flutter/material.dart'; import 'package:test_sa/extensions/context_extension.dart'; import 'package:test_sa/extensions/text_extensions.dart'; import 'package:test_sa/extensions/widget_extensions.dart'; import 'package:test_sa/models/enums/translation_keys.dart'; class AppFilledButton extends StatelessWidget { final VoidCallback onPressed; final TranslationKeys label; final bool maxWidth; final Color buttonColor; final Color textColor; const AppFilledButton({ @required this.onPressed, @required this.label, this.maxWidth = false, this.buttonColor, this.textColor, Key key, }) : super(key: key); @override Widget build(BuildContext context) { // return SizedBox( // width: maxWidth ? double.infinity : null, // child: Padding( // padding: const EdgeInsets.symmetric( // horizontal: 16, // vertical: 20, // ), // child: ElevatedButton( // style: ElevatedButton.styleFrom( // padding: const EdgeInsets.symmetric(vertical: 16), // shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), // ), // onPressed: onPressed, // child: Text(context.translate(label)), // ), // ), // ); return Container( height: 56, width: maxWidth ? double.infinity : null, alignment: Alignment.center, decoration: BoxDecoration( borderRadius: BorderRadius.circular(10), color: buttonColor ?? Theme.of(context).primaryColor, ), child: context.translate(label).heading6.custom(color: textColor)) .onPress(onPressed); } }