scroll screen on keyboard popup

pull/41/head^2
li3317 4 years ago
parent bc03670a61
commit 471c1cb7ee
  1. 9
      lib/widgets/editor.dart

@ -889,15 +889,10 @@ class RenderEditor extends RenderEditableContainerBox
kMargin +
offsetInViewport;
final caretBottom = endpoints.single.point.dy + kMargin + offsetInViewport;
double dy;
if (caretTop < scrollOffset) {
dy = caretTop;
} else if (caretBottom > scrollOffset + viewportHeight) {
double dy = caretTop;
if (caretBottom > scrollOffset + viewportHeight) {
dy = caretBottom - viewportHeight;
}
if (dy == null) {
return null;
}
return math.max(dy, 0.0);
}
}

Loading…
Cancel
Save