You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.7 KiB
Dart
54 lines
1.7 KiB
Dart
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);
|
|
}
|
|
}
|