xxxxxxxxxx
ElevatedButton(
onPressed: () {
// Logic to be executed when the button is pressed
},
style: ButtonStyle(
// Set the fixed size of the button
fixedSize: MaterialStateProperty.all(Size(200, 50)),
// Alternatively, set the minimum size of the button
// minimumSize: MaterialStateProperty.all(Size(200, 50)),
),
child: Text('ElevatedButton'),
)
xxxxxxxxxx
ElevatedButton(
style: ElevatedButton.styleFrom(
minimumSize: const Size(200, 50),
maximumSize: const Size(200, 50),
),
onPressed: () {},
child: Text('ElevatedButton')),
xxxxxxxxxx
SizedBox(
width: 200, // Replace with your desired width
child: ElevatedButton(
onPressed: () {
// Add the button's onPressed event handler
print('Button pressed!');
},
child: Text('My Button'),
),
)
xxxxxxxxxx
SizedBox(
height: 50, // specify the desired height here
child: ElevatedButton(
onPressed: () {
// button logic goes here
},
child: Text('Button'),
),
)