Home > Software engineering >  Flutter - Wrap text with overflow.elipsis, it won't work like the way i want
Flutter - Wrap text with overflow.elipsis, it won't work like the way i want

Time:07-22

this is my code for the text section for that elipsis

         Padding(
              padding: const EdgeInsets.fromLTRB(8, 0, 8, 0),
              child: Row(
                children: [
                  Flexible(
                    flex: 10,
                    child: Container(
                      padding: const EdgeInsets.only(right: 13.0),
                      child: const Text(
                        '\$ 900.000.000',
                        maxLines: 1,
                        overflow: TextOverflow.ellipsis,
                        style: TextStyle(
                          fontSize: 18,
                          color: Colors.red,
                          fontWeight: FontWeight.bold,
                        ),
                      ),
                    ),
                  ),
                  const Flexible(
                    flex: 3,
                    child: Icon(
                      Icons.favorite_border_outlined,
                    ),
                  ),
                ],
              ),
            ),

i'm trying to create an line that will show price that look like below this.

$ 2.000.00....

but turn out its comeout like this

enter image description here

and i already tried to use this reference and it's still wont work preview

CodePudding user response:

Padding(
              padding: const EdgeInsets.fromLTRB(8, 0, 8, 0),
              child: Row(
                children: [
                  Expanded(
                    child: Container(
                      padding: const EdgeInsets.only(right: 13.0),
                      child: const Text(
                        '\$ 900.000.000',
                        maxLines: 1,
                        overflow: TextOverflow.ellipsis,
                        style: TextStyle(
                          fontSize: 18,
                          color: Colors.red,
                          fontWeight: FontWeight.bold,
                        ),
                      ),
                    ),
                  ),
                
                   Icon(
                      Icons.favorite_border_outlined,
                    ),
                 
                ],
              ),
            ),
  • Related