button method

Widget button(
  1. String title, {
  2. String? value,
})

Implementation

Widget button(String title, {String? value}) {
  return TextButton(
    onPressed: () {
      controller.addText(value ?? title);
    },
    child: Text(title),
    style: ButtonStyle(
      backgroundColor: MaterialStateProperty.resolveWith((states) {
        if (states.contains(MaterialState.pressed)) {
          return Colors.blue;
        }
        return Color(0xFFFFFFFF);
      }),
      foregroundColor: MaterialStateProperty.resolveWith((states) {
        if (states.contains(MaterialState.pressed)) {
          return Colors.white;
        }
        return Color(0xFF363636);
      }),
    ),
  );
}