1

I tried to create a golden test with specific text to validate, but when the screen contains a RichText the component is not correctly rendered. Is there any way to render this?

Image with Text and RichText on the same screen - RichText is illegible

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,
                                    )),
                            ],
                            ),
                        ),
                      ],
                    ),
                  ),
                ),
              )),
    ],
  ),
);

Thanks in advance

0 Answers0