42 lines
971 B
Dart
42 lines
971 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:lba/res/colors.dart';
|
|
|
|
class Button extends StatefulWidget {
|
|
final String text;
|
|
final VoidCallback onPressed;
|
|
final Color color;
|
|
|
|
const Button({
|
|
super.key,
|
|
required this.text,
|
|
required this.onPressed,
|
|
required this.color,
|
|
});
|
|
|
|
@override
|
|
State<Button> createState() => _ButtonState();
|
|
}
|
|
|
|
class _ButtonState extends State<Button> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ElevatedButton(
|
|
style: ElevatedButton.styleFrom(
|
|
backgroundColor: widget.color,
|
|
minimumSize: const Size(double.infinity, 48),
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(32),
|
|
),
|
|
),
|
|
onPressed: widget.onPressed,
|
|
child: Text(
|
|
widget.text,
|
|
style: TextStyle(
|
|
color: AppColors.surface,
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
} |