TextBaseline's alphabetic and ideographic enums do not work in Flutter

前端 未结 3 1077
囚心锁ツ
囚心锁ツ 2021-01-13 09:34

I thought I understand how these enums work based on this post. When I tried it using the following code, it does not seem to work.

Row(
  mainAxisAlignment:         


        
3条回答
  •  孤城傲影
    2021-01-13 10:08

    I dont no complatly your problem but i thing your problem solve by this parameter

    mainAxisSize: MainAxisSize.min,
    

    so we have:

    Row(
      mainAxisAlignment: MainAxisAlignment.center,
      crossAxisAlignment: CrossAxisAlignment.baseline,
      mainAxisSize: MainAxisSize.min,
      textBaseline: TextBaseline.ideographic,
      children: [
        Text(
          'abcdefg',
          style: TextStyle(
              fontSize: 50.0, fontWeight: FontWeight.w900),
        ),
        Text(
          'hi',
          style: TextStyle(fontSize: 15.0),
        ),
      ],
    ),
    

提交回复
热议问题