how to make text or richtext scrollable in flutter?

前端 未结 1 1142
一个人的身影
一个人的身影 2021-01-03 17:48

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

相关标签:
1条回答
  • 2021-01-03 18:20

    Flutter provide a lot of Scrolling Widgets documentation

    Example :SingleChildScrollView

    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),),),
    ),);
     }
    }
    
    0 讨论(0)
提交回复
热议问题