cargo66/lib/presentation/widgets/button.dart

38 lines
888 B
Dart
Raw Normal View History

2024-07-23 04:27:35 +00:00
import 'package:flutter/material.dart';
import '../../core/core.dart';
class AppButton extends StatelessWidget {
final VoidCallback onPressed;
final String text;
final Color textColor;
final Color btnColor;
const AppButton({
super.key,
required this.onPressed,
required this.text,
this.textColor = Colors.white,
this.btnColor = AppColors.primary,
});
@override
Widget build(BuildContext context) {
return ElevatedButton(
onPressed: onPressed,
style: ElevatedButton.styleFrom(
foregroundColor: textColor,
backgroundColor: btnColor,
padding: const EdgeInsets.symmetric(horizontal: 50, vertical: 15),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
),
child: Text(
text,
style: const TextStyle(fontSize: 16),
),
);
}
}