import 'package:flutter/material.dart'; import 'package:test_sa/extensions/context_extension.dart'; import 'package:test_sa/extensions/int_extensions.dart'; import 'package:test_sa/extensions/string_extensions.dart'; import 'package:test_sa/models/enums/translation_keys.dart'; class AppFilledButton extends StatelessWidget { final VoidCallback onPressed; final TranslationKeys label; final bool maxWidth; const AppFilledButton({ @required this.onPressed, @required this.label, this.maxWidth = false, 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( elevation: 0, padding: EdgeInsets.symmetric(vertical: 16.toScreenHeight), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)), ), onPressed: onPressed, child: context.translate(label).toHeading6(context, color: Theme.of(context).floatingActionButtonTheme.foregroundColor), ), ), ); } }