flutter for web: text cut off at bottom

浪尽此生 提交于 2020-01-16 08:45:08

问题


With web flutter my text is cut at the bottom when I display text I tried to put padding but it doesn't work.

this problem this product everywhere even on the TextField

    new Container(
      width: menuRightWidthDesktop,
      height: getSize == 0 ? heightHeaderDesktop : getSize == 1 ? heightHeaderTablette : heightHeaderMobile,
      color: Colors.red,
      child: new Row(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: <Widget>[
          new GestureDetector(
            child: new Container(
              color: Colors.indigoAccent,
              child: new Text("Surfeur >"),
            ),
            onTap: () {},
          ),
          new GestureDetector(
            child: new Text("Photographe >", ),
            onTap: () {},
          ),
        ],
      ),
    ),

回答1:


There is a new pull request https://github.com/flutter/engine/pull/13929
experimental implementation of text measurement that's based on Canvas2d

You can use the following command

flutter run -d web-server --release --dart-define=FLUTTER_WEB_USE_EXPERIMENTAL_CANVAS_TEXT=true


来源:https://stackoverflow.com/questions/59672179/flutter-for-web-text-cut-off-at-bottom

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!