Skip to content

Instantly share code, notes, and snippets.

@denniske
Created August 22, 2019 13:06
Show Gist options
  • Save denniske/ae5a6e5e448a7a86fedcd6420279f5ff to your computer and use it in GitHub Desktop.
Save denniske/ae5a6e5e448a7a86fedcd6420279f5ff to your computer and use it in GitHub Desktop.
Flutter Modal bottom sheet will overlap keyboard
import 'package:flutter/material.dart';
class CustomPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(),
floatingActionButton: FloatingActionButton(
onPressed: () {
showModalBottomSheet(
context: context,
builder: (context) {
// Does not work
return Scaffold(
body:
Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
TextField(
decoration: InputDecoration(labelText: "1"),
),
TextField(
decoration: InputDecoration(labelText: "2"),
),
TextField(
decoration: InputDecoration(labelText: "3"),
)
],
)
);
},
);
},
),
);
}
}
void main() {
runApp(MaterialApp(home: CustomPage()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment