Widget build(BuildContext context) {
return Center(
child: Column(
children: <Widget>[
Expanded(
child: Image.asset('images/ball$go.png'),
),
FloatingActionButton(
onPressed: () {
setState(() {
go = Random().nextInt(5) + 1;
});
},
child: Text('Ask'),
backgroundColor: Colors.blue.shade300,
foregroundColor: Colors.black,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(16.0),
),
),
elevation: 20.0,
),
],
),
);
}
}
Asked
Active
Viewed 56 times
1

Viren V Varasadiya
- 25,492
- 9
- 45
- 61

suhane78
- 11
- 1
-
1does this answer your question ?https://stackoverflow.com/a/51546279/7924072 – Viren V Varasadiya May 22 '20 at 03:02
-
Try this `mainAxisAlignment: MainAxisAlignment.center` in the `Column`..not sure if it works..just give it a try.. – srikanth7785 May 22 '20 at 12:11
1 Answers
0
Wrap with Align Widget
Align(
alignment: Alignment.center,
child: FloatingActionButton(
onPressed: () {
setState(() {
});
},
child: Text('Ask'),
backgroundColor: Colors.blue.shade300,
foregroundColor: Colors.black,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(16.0),
),
),
elevation: 20.0,
),
),

Jitesh Mohite
- 31,138
- 12
- 157
- 147