34 lines
852 B
Dart
34 lines
852 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class MyButton extends StatelessWidget {
|
|
final void Function() onTap;
|
|
final String buttonText;
|
|
|
|
const MyButton({super.key, required this.onTap, required this.buttonText});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return GestureDetector(
|
|
onTap: onTap,
|
|
child: Container(
|
|
padding: const EdgeInsets.all(25),
|
|
margin: const EdgeInsets.symmetric(horizontal: 25),
|
|
decoration: BoxDecoration(
|
|
color: Colors.blueAccent,
|
|
borderRadius: BorderRadius.circular(10),
|
|
),
|
|
child: Center(
|
|
child: Text(
|
|
buttonText,
|
|
style: const TextStyle(
|
|
fontWeight: FontWeight.bold,
|
|
fontSize: 20,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|