flutter elevated button colour code example
Example 1: elevated button flutter color
ElevatedButton(
style: ButtonStyle(
backgroundColor: MaterialStateProperty.resolveWith(
(Set states) {
if (states.contains(MaterialState.pressed))
return Colors.green;
return null; // Use the component's default.
},
),
),
)
Example 2: flutter elevated button
ElevatedButton(
onPressed: () {},
child: Text('Submit'),
);