asColoredButton method

Widget asColoredButton({
  1. Color backgroundColor = Colors.blue,
  2. EdgeInsets padding = const EdgeInsets.all(12),
})

Adds padding and a background color to create a button-like look.

Implementation

Widget asColoredButton({Color backgroundColor = Colors.blue, EdgeInsets padding = const EdgeInsets.all(12)}) {
  return Container(
    padding: padding,
    decoration: BoxDecoration(
      color: backgroundColor,
      borderRadius: BorderRadius.circular(8),
    ),
    child: this,
  );
}