You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// There's no ancestor KeyboardScaffoldSafeArea, but there might be an ancestor
1098
+
// KeyboardScaffoldSafeAreaScope, whose insets we should use.
1099
+
final inheritedGeometry = _ancestorSafeAreaScope?.geometry;
1100
+
1101
+
// Either use the ancestor geometry, or use our own.
1102
+
final keyboardSafeArea = inheritedGeometry ??KeyboardScaffoldSafeAreaScope.of(safeAreaContext).geometry;
1103
+
1104
+
// Get the current keyboard safe area bottom insets, and then adjust that
1105
+
// value based on our global bottom y-value. When this widget appears at
1106
+
// the very bottom of the screen, this adjustment will be zero (no change),
1107
+
// but when this widget sits somewhere above the bottom of the screen, we
1108
+
// need to account for that extra space between us and the keyboard that's
1109
+
// coming up from the bottom of the screen.
1110
+
var bottomInsets = keyboardSafeArea.bottomInsets;
1111
+
if (_myBoxKey.currentContext !=null&& _myBoxKey.currentContext!.findRenderObject() !=null) {
1112
+
final myBox = _myBoxKey.currentContext!.findRenderObject() asRenderBox;
1113
+
final myGlobalBottom = myBox.localToGlobal(Offset(0, myBox.size.height)).dy;
1114
+
if (myGlobalBottom.isNaN) {
1115
+
// We've found in a client app that under some unknown circumstances we get NaN
1116
+
// from localToGlobal(). We're not sure why. In that case, log a warning and return zero.
1117
+
keyboardPanelLog.warning(
1118
+
"KeyboardScaffoldSafeArea (${widget.debugLabel}) - Tried to measure our global bottom offset on the screen but received NaN from localToGlobal(). If you're able to consistently reproduce this problem, please report it to Super Editor with the repro steps.",
1119
+
);
1120
+
return0;
1121
+
}
1122
+
if (myGlobalBottom.isNegative) {
1123
+
// We haven't seen negative values here, but if we ever did receive one then our
1124
+
// Padding widget would blow up. Return zero to be base.
1125
+
keyboardPanelLog.warning(
1126
+
"KeyboardScaffoldSafeArea (${widget.debugLabel}) - Tried to measure our global bottom offset on the screen but received a negative y-value from localToGlobal(). If you're able to consistently reproduce this problem, please report it to Super Editor with the repro steps.",
1127
+
);
1128
+
return0;
1129
+
}
1130
+
1131
+
final spaceBelowMe =MediaQuery.sizeOf(safeAreaContext).height - myGlobalBottom;
1132
+
1133
+
// The bottom insets are measured from the bottom of the screen. But we might not
1134
+
// be sitting at the bottom of the screen. There might be some space beneath us.
1135
+
// In that case, we don't need to push as far up. Remove the space below us from
0 commit comments