Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Text ellipsis not working when icon beside it in flutter

recently I am moving on the Flutter , I am making one list but stuck with Overflow error even ellipsis is there.

My requirement is Icon must be stick with text so I cant use expanded.

enter image description hereenter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Wrap Text widget with Expanded or Flexible because over only works when it’s parent has Expanded or Flexible .

or try this.

Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      children: [
        Expanded(
          child: Row(
            children: const [
              Flexible(
                child: Text(
                  ///your text here
                  'Yearly',
                  style: TextStyle(overflow: TextOverflow.ellipsis),
                ),
              ),
              SizedBox(width: 10),
              Icon(Icons.timer),
            ],
          ),
        ),
        const SizedBox(width: 10),
        Text('2', style: FontStyleUtility.blackInter18W600)
      ],
    )
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading