ElevatedButton Style in Flutter

Here is a Flutter ElevatedButton with custom styling, including width, height, color, and border radius:

ElevatedButton(
  onPressed: () {
    // Your action here
  },
  style: ElevatedButton.styleFrom(
    backgroundColor: Colors.blue, // Button color
    minimumSize: Size(200, 50), // Width & Height
    shape: RoundedRectangleBorder(
      borderRadius: BorderRadius.circular(20), // Border radius
    ),
    elevation: 5, // Shadow elevation
  ),
  child: Text(
    'Click Me',
    style: TextStyle(color: Colors.white), // Text color
  ),
)

This ElevatedButton has a width of 200, height of 50, blue color, rounded corners (BorderRadius of 20), and white text with a shadow elevation of 5.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

Send us mail