Toolbar can show downward

pull/1384/head
Kelrap 1 year ago committed by ggurdin
parent 87255ecdc0
commit 291dcfc192
No known key found for this signature in database
GPG Key ID: A01CB41737CBB478

@ -59,8 +59,12 @@ class ToolbarDisplayController {
}
void showToolbar(BuildContext context, {MessageMode? mode}) {
// Close keyboard, if open
FocusManager.instance.primaryFocus?.unfocus();
// Don't show toolbar if keyboard open
if (controller.inputFocus.hasFocus) {
FocusManager.instance.primaryFocus?.unfocus();
return;
}
bool toolbarUp = true;
if (highlighted) return;
if (controller.selectMode) {
@ -86,13 +90,12 @@ class ToolbarDisplayController {
if (targetOffset.dy < 320) {
final spaceBeneath = MediaQuery.of(context).size.height -
(targetOffset.dy + transformTargetSize.height);
// If toolbar is open, opening toolbar beneath without scrolling can cause issues
// if (spaceBeneath >= 320) {
// toolbarUp = false;
// }
if (spaceBeneath >= 320) {
toolbarUp = false;
}
// See if it's possible to scroll up to make space
if (controller.scrollController.offset - targetOffset.dy + 320 >=
else if (controller.scrollController.offset - targetOffset.dy + 320 >=
controller.scrollController.position.minScrollExtent &&
controller.scrollController.offset - targetOffset.dy + 320 <=
controller.scrollController.position.maxScrollExtent) {

Loading…
Cancel
Save