flutter text one line code example

Example 1: text overflow ellipsis flutter

Text(
    "Introduction to Very very very long text",
    maxLines: 1,
    overflow: TextOverflow.ellipsis,
    softWrap: false,
    style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold),
),

Example 2: text line through flutter

Text('\$8.99', style: TextStyle(decoration: TextDecoration.lineThrough))

Example 3: text overflow in new line in flutter

Row(
     children: [
                Flexible(
                  child: Text('Add long text here',
                  maxLines: 1,
                  softWrap: false,
                  overflow: TextOverflow.fade,
                  ),
                ),
              ],
            )

Example 4: text in column flutter overflow ellipsis not working

return Expanded(
    child: Container(
    	child: Column(
    		children: [
    			Text("Your text here...",
    				overflow: TextOverflow.ellipsis
                )
        	]
        )
    )
);

Tags:

Misc Example