Created
March 21, 2023 20:03
-
-
Save LokieVikky/faebcb48bcc2fff1084c429fe0f98e7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(const RichTextWithEliipsis()); | |
} | |
class RichTextWithEliipsis extends StatelessWidget { | |
const RichTextWithEliipsis({Key? key}) : super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: Scaffold( | |
body: Column( | |
children: [ | |
Expanded( | |
child: RichText( | |
overflow: TextOverflow.ellipsis, | |
text: const TextSpan( | |
children: [ | |
TextSpan( | |
text: | |
'Consider this as a very long text.Consider this as a very long text.Consider this as a very long text.Consider this as a very long text.Consider this as a very long text.Consider this as a very long text.Consider this as a very long text.Consider this as a very long text.', | |
style: TextStyle(fontSize: 14)), | |
], | |
), | |
), | |
), | |
], | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment