How to scroll page in flutter

后端 未结 9 1227
情话喂你
情话喂你 2021-01-30 20:05

My code for a page is like this. i need to scroll part below appbar.

@override
  Widget build(BuildContext context) {
    return new Scaffold(
      appBar: new          


        
9条回答
  •  长发绾君心
    2021-01-30 20:14

    Look to this, may be help you.

    class ScrollView extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return new LayoutBuilder(
          builder:
              (BuildContext context, BoxConstraints viewportConstraints) {
            return SingleChildScrollView(
              scrollDirection: Axis.vertical,
              child: ConstrainedBox(
                constraints: BoxConstraints(minHeight: viewportConstraints.maxHeight),
                child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Text("Hello world!!"),
                      //You can add another children
                ]),
              ),
            );
          },
        );
      }
    }
    

提交回复
热议问题