kamus-kesehatan/lib/ui/widgets/my_button.dart

39 lines
865 B
Dart
Raw Normal View History

2024-02-04 12:57:23 +00:00
import 'package:flutter/material.dart';
import '../../app/themes/app_colors.dart';
class MyButton extends StatelessWidget {
const MyButton({
Key? key,
required this.text,
this.theBackgroundColor = mainColor,
this.textColor = backgroundColor,
this.onPressed,
}) : super(key: key);
final String text;
final VoidCallback? onPressed;
final Color theBackgroundColor;
final Color textColor;
@override
Widget build(BuildContext context) {
return ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: theBackgroundColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
),
),
onPressed: onPressed,
child: Text(
text,
style: TextStyle(
color: textColor,
fontSize: 18,
),
),
);
}
}