In order to apply height and width to a Button Widget in flutter:
If you want to set the height and width of a button in Flutter, you can use the SizedBox widget. The SizedBox widget allows you to set a specific size for a widget. Here, we will learn how to use the SizedBox widget to set the height and width of a button in Flutter.
SizedBox(
width: 250,
height: 50,
child: OutlinedButton(
onPressed: () {
print("hello world");
},
child: const Text("English", style: ThemeText.btnA),
),
),
The above code creates a button that is 250px wide and 50px tall. When the button is pressed, it will print "hello world" to the console.
0 Comments