easytodo/lib/util/my_button.dart
2024-03-27 12:25:26 +05:30

27 lines
630 B
Dart

import 'package:flutter/material.dart';
// ignore: must_be_immutable
class MyButton extends StatelessWidget {
final String text;
VoidCallback onPressed;
MyButton({
super.key,
required this.text,
required this.onPressed,
});
@override
Widget build(BuildContext context) {
return MaterialButton(
onPressed: onPressed,
color: Colors.deepPurple,
textColor: Colors.white,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(5))),
highlightElevation: 20,
padding: const EdgeInsets.all(20),
child: Text(text),
);
}
}