Skip to content

Instantly share code, notes, and snippets.

@LokieVikky
Created March 21, 2023 20:03
Show Gist options
  • Save LokieVikky/faebcb48bcc2fff1084c429fe0f98e7e to your computer and use it in GitHub Desktop.
Save LokieVikky/faebcb48bcc2fff1084c429fe0f98e7e to your computer and use it in GitHub Desktop.
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