1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Flutter] Flutter TextStyle TextDecoration.lineThought Error

Discussão em 'Mobile' iniciado por Stack, Outubro 17, 2024 às 12:13.

  1. Stack

    Stack Membro Participativo

    In flutter I got this widget

    Container(
    alignment: Alignment.centerLeft,
    child: RichText(
    maxLines: 1,
    textAlign: TextAlign.center,
    text: TextSpan(
    children: [
    TextSpan(
    text: "$price€ ", style: const TextStyle(fontSize: 22)),
    startingPrice != price
    ? TextSpan(
    text: "$startingPrice€",
    style: TextStyle(
    fontSize:19,
    decoration: TextDecoration.lineThrough,))
    : const TextSpan()
    ]),
    )),


    and the result I get is this one

    [​IMG]

    I tried different combinations of fontSizes and the line thought looks like it's moving up and down just a bit, but never in the center which is the desirable place.

    The same up and down movement is happening if I add a height property in the Container and increase/decrease it.

    Any thoughts?

    Continue reading...

Compartilhe esta Página