简体   繁体   English

Flutter for Web:Android Chrome 底部的文本被截断

[英]Flutter for Web: text cut off at bottom on Android Chrome

I am building a Web app through Flutter and when I tried to check my web app with Android simulator's browser, bottom part of the text cuts off.我正在通过 Flutter 构建一个 Web 应用程序,当我尝试使用 Android 模拟器的浏览器检查我的 Web 应用程序时,文本的底部被切断了。 This can be related to lineSpacingMultiplier or LinearLayouts.这可能与 lineSpacingMultiplier 或 LinearLayouts 相关。 But I'm not sure how to fix this with Flutter for Web.但是我不确定如何使用 Flutter for Web 解决这个问题。 I don't have any physical Android device.我没有任何物理 Android 设备。 Any help is appreciated!任何帮助表示赞赏!

import 'package:flutter/material.dart';

class TestScreen extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      body: Center(
          child: Text(
        'good',
        style: TextStyle(
          fontSize: 24.0,
        ),
      )),
    );
  }
}

在此处输入图片说明

add: height: 1.5 fix my problem.添加:高度:1.5 解决我的问题。

Text(
                    widget.item.name + '\n' ?? '',
                    overflow: TextOverflow.ellipsis,
                    textAlign: TextAlign.start,
                    style: TextStyle(
                      color: MColors.primaryDarkBlue,
                      fontSize: titleFontSize,
                      fontWeight: FontWeight.normal,
                      height: 1.5,
                    ),
                    maxLines: 2,
                  )

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM