Search code examples
flutterimageflutter-layoutsetposition

How do I align my image to the bottom of my page in flutter?


I'm trying to set the last image on the bottom of the page. I tried the sized box between this one and the previous image but it changes depending on the device and sometimes it overflows some pixels.

Here is the code:

import 'package:flutter/material.dart';

// ignore: use_key_in_widget_constructors
class LoginPage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Container(
      color: Colors.amber,
      child: Column(
        children: <Widget>[
          Image.asset("imagens/btop.png"),
          SizedBox(
            width: 200,
            height: 200,
            child: Image.asset("imagens/logo.png"),
          ),
          // ignore: prefer_const_constructors
          SizedBox(
            height: 40,
          ),
          Image.asset("imagens/bbot.png")
        ],
      ),
    ));
  }
} 

Solution

  • Just use below Widget before your Image widget.

    Spacer()