Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make text or richtext scrollable in flutter?

Tags:

flutter

It seems text/richtext only support one page, if the content exceed the screen, you can't scroll up/down. Is there an easy way to enable it? Or I have to use the Scrolling Widgets?

like image 310
camino Avatar asked Oct 19 '25 09:10

camino


1 Answers

Flutter provide a lot of Scrolling Widgets documentation

Example :SingleChildScrollView

enter image description here

class mytext extends StatelessWidget {
var randomtext="....";
@override
Widget build(BuildContext context) {
return new Container(child: new Scaffold(
  appBar: new AppBar(),
  body: new SingleChildScrollView(child: 
    new Text(randomtext,style: new TextStyle(fontSize: 30.0),),),
),);
 }
}
like image 65
Raouf Rahiche Avatar answered Oct 21 '25 23:10

Raouf Rahiche



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!