Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
"Android Fill Viewport" style of content for Flutter, where even when the keyboard appears the content flows behind.
class SomeWidgetState extends State<SomeWidget> {
Widget build(BuildContext context) {
return new Scaffold(body: new LayoutBuilder(builder: _buildContent));
Widget _buildContent(BuildContext context, BoxConstraints constraints) {
if (constraints.hasBoundedHeight) {
constraints = constraints.copyWith(maxHeight: constraints.maxHeight +
return new SingleChildScrollView(
child: new ConstrainedBox(
constraints: constraints,
child: new Column(
children: <Widget>[
/* ... */

This comment has been minimized.

Copy link

@mousaa mousaa commented May 23, 2018

How do you prevent this from causing an overflow error when you change your device orientation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment