【问题标题】:How do I allign my image to the bootom of my page in flutter?如何在颤动中将图像与页面底部对齐?
【发布时间】:2022-10-07 00:01:26
【问题描述】:

所以我有这个代码,我想在页面底部设置最后一个图像,我尝试了这个和上一个之间的大小框,但它会根据设备而改变它溢出一些像素这里是代码

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\")
        ],
      ),
    ));
  }
} 

    标签: flutter image flutter-layout set position


    【解决方案1】:

    只需在您的图像小部件之前使用下面的小部件。

    Spacer()
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-11-26
      • 1970-01-01
      • 2016-05-27
      • 1970-01-01
      • 1970-01-01
      • 2021-10-20
      • 1970-01-01
      相关资源
      最近更新 更多