1
 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,
          ),
        ],
      ),
    );
  }
}
Viren V Varasadiya
  • 25,492
  • 9
  • 45
  • 61
suhane78
  • 11
  • 1

1 Answers1

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