减少列小部件中特定子项之间的空间

问题描述 投票:0回答:1

之间的空间是什么以及如何删除/减少它?

Center(
  child: Column(
    crossAxisAlignment: CrossAxisAlignment.center,
    mainAxisAlignment: MainAxisAlignment.center,
    children: [
      SvgPicture.asset(
        'assets/weather/cloudy-night.svg',
        width: 300,
      ),
      Text(
        'Temperature',
        style: GoogleFonts.inter(
          fontSize: 75,
          fontWeight: FontWeight.bold,
          color: Colors.white,
        ),
      ),
      Text(
        'Datetime',
        style: GoogleFonts.inter(
          fontSize: 30,
          color: Colors.white,
        ),
      ),
    ],
  ),
)
flutter flutter-layout flutter-web
1个回答
1
投票

当文本尺寸较大时,也会占用额外的垂直空间,因此通过以下方式添加文本高度:

Text(
    'Temperature',
    style: GoogleFonts.inter(
        fontSize: 75,
        fontWeight: FontWeight.bold,
        color: Colors.white,
        height: 1,
    ),
),
© www.soinside.com 2019 - 2024. All rights reserved.