Answers for "scrollview to scaffold flutter"

6

how to make a column scrollable in flutter

return new Container(
  child: new SingleChildScrollView(
    child: new Column(
      children: <Widget>[
        _showChild1(),
        _showChild2(),
        ...
        _showChildN()
      ]
    )
  )
);
Posted by: Guest on September-22-2020
1

viewportConstraints

Widget build(BuildContext context) {
  return LayoutBuilder(
    builder: (BuildContext context, BoxConstraints viewportConstraints) {
      return SingleChildScrollView(
        child: ConstrainedBox(
          constraints: BoxConstraints(
            minHeight: viewportConstraints.maxHeight,
          ),
          child: Column(
            mainAxisSize: MainAxisSize.min,
            mainAxisAlignment: MainAxisAlignment.spaceAround,
            children: <Widget>[
              Container(
                // A fixed-height child.
                color: const Color(0xff808000), // Yellow
                height: 120.0,
              ),
              Container(
                // Another fixed-height child.
                color: const Color(0xff008000), // Green
                height: 600.0,
              ),
            ],
          ),
        ),
      );
    },
  );
}
Posted by: Guest on October-20-2020

Code answers related to "scrollview to scaffold flutter"

Browse Popular Code Answers by Language