0

我试图创建一个带有特定文本的黄金测试来验证,但是当屏幕包含 RichText 时,组件没有正确呈现。有没有办法渲染这个?

同一屏幕上带有 Text 和 RichText 的图像 - RichText 难以辨认

Scaffold(
  backgroundColor: CBColors.bgDarkColor,
  body: Column(
    children: <Widget>[
      Observer(
          builder: (_) => CBHeader(
                title: 'Minha Tela',
                subtitle: 'Aqui é um texto normal',
                isBgDarkColor: true,
                child: Center(
                  child: SingleChildScrollView(
                    child: Column(
                      mainAxisAlignment: MainAxisAlignment.center,
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: <Widget>[
                        RichText(
                            textAlign: TextAlign.center,
                            text: TextSpan(
                            text: 'Digite a senha de 4 dígitos',
                            style: TextStyle(
                                height: 2,
                                wordSpacing: 2,
                                fontWeight: FontWeight.bold,
                                fontSize: 20,
                                color: Colors.white,
                            ),
                            children: <TextSpan>[
                                TextSpan(
                                    text: 'para processeguir',
                                    style: TextStyle(
                                    fontWeight: FontWeight.normal,
                                    fontSize: 14,
                                    )),
                            ],
                            ),
                        ),
                      ],
                    ),
                  ),
                ),
              )),
    ],
  ),
);

提前致谢

4

0 回答 0