Skip to content

Instantly share code, notes, and snippets.

@webianks
Created August 22, 2019 06:50
Show Gist options
  • Save webianks/d71da659a2da6e9c63c777bbe1b81e2c to your computer and use it in GitHub Desktop.
Save webianks/d71da659a2da6e9c63c777bbe1b81e2c to your computer and use it in GitHub Desktop.
showOverlay(BuildContext context) {
if (overlayEntry != null) return;
OverlayState overlayState = Overlay.of(context);
overlayEntry = OverlayEntry(builder: (context) {
return Positioned(
bottom: MediaQuery.of(context).viewInsets.bottom,
right: 0.0,
left: 0.0,
child: InputDoneView());
});
overlayState.insert(overlayEntry);
}
removeOverlay() {
if (overlayEntry != null) {
overlayEntry.remove();
overlayEntry = null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment