Skip to content

Instantly share code, notes, and snippets.

@edsbrains
Created June 23, 2019 12:56
import 'package:flutter/material.dart';
class CustomButton extends StatelessWidget {
final VoidCallback onPressed;
final String buttonText;
final Color color;
final Color textColor;
final Color borderColor;
CustomButton(
{@required this.onPressed,
@required this.buttonText,
this.color,
this.textColor,
this.borderColor = Colors.transparent});
@override
Widget build(BuildContext context) {
return MaterialButton(
onPressed: onPressed,
shape: RoundedRectangleBorder(
side: BorderSide(color: borderColor),
borderRadius: BorderRadius.circular(12)),
color: color,
textColor: textColor,
padding: const EdgeInsets.all(14.0),
child: Text(buttonText),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment