easytodo/lib/util/my_button.dart

27 lines
630 B
Dart
Raw Permalink Normal View History

2024-03-27 06:55:26 +00:00
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),
);
}
}