camino
camino

Reputation: 10584

how to make text or richtext scrollable in 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?

Upvotes: 4

Views: 7091

Answers (1)

Raouf Rahiche
Raouf Rahiche

Reputation: 31356

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),),),
),);
 }
}

Upvotes: 7

Related Questions