getButtonStyle method

ButtonStyle getButtonStyle(
  1. Color c1,
  2. Color c2
)

Implementation

ButtonStyle getButtonStyle(Color c1, Color c2) {
  return ButtonStyle(backgroundColor:
  MaterialStateProperty.resolveWith<Color?>((Set<MaterialState> states) {
    if (states.contains(MaterialState.pressed)) return c2;
    return c1;
  }));
}