Gap between top of the action bar and page content
BenjiFarquhar opened this issue · 11 comments
Try to reproduce the issue on a minimum sample code, then paste the code here.
Not sure if this code is minimal enough. I think it is my code that is causing it actually. Maybe the Expanded is stretching it out:
return [
Expanded(
child: KeyboardActions(
tapOutsideBehavior: TapOutsideBehavior.opaqueDismiss,
config: KeyboardActionsConfig(
defaultDoneWidget: const VpKeyboardDoneButton(),
actions: [
KeyboardActionsItem(
focusNode: focusNodeName,
),
KeyboardActionsItem(
focusNode: focusNodeLocationName,
),
KeyboardActionsItem(
focusNode: focusNodeCompanyName,
),
KeyboardActionsItem(
focusNode: focusNodeDescription,
),
],
),
child: Column(mainAxisSize: MainAxisSize.min, children: [
nameTextField(context: context!, form: form),
locationNameTextField(context: context, form: form!),
companyNameTextField(context: context, form: form),
descriptionTextField(context: context, vm: vm),
])))
];
I am having trouble with that. But if this helps, it doesn't have the gap when I do disableScroll: true
. It is the area that scrolls which becomes empty.
I'm pretty sure it is this: #48 It seems like a bug with autoscroll.
If I have anything that takes up space below my KeyboardActions()
, it increases that gap. If I remove everything below it, then it is fixed. But I need to have a button below it.
It is a bug.
When you calculate the offset to "avoid" EG:
BottomAreaAvoider(
key: bottomAreaAvoiderKey,
areaToAvoid: _offset
It calculates the action bar height (45) + the device keyboard height:
double newOffset = _currentAction!.displayActionBar
? _kBarSize
: 0; // offset for the actions bar
newOffset += MediaQuery.of(context)
.viewInsets
.bottom; // + offset for the system keyboard
The KeyboardActions
widget then applies this offset, starting from the bottom of the KeyboardActions
widget, which means if the KeyboardActions
widget isn't at the bottom of the page, the offset will be too high - by the height of whatever is below it (The keyboard starts at the bottom of the view port, not the bottom of the KeyboardActions
widget). It needs to at the very least have an offset parameter to pass to the KeyboardActions
widget which is the distance from the bottom of the screen to the bottom of the KeyboardActions
widget.
Would you mind creating a PR to fix this issue? :D
@diegoveloper Sure, I will give it a go
@diegoveloper I have tried to push to my new branch "benjamin-farquhar/bug/172-fix-offset"; however, access is denied. Do you need to permit me?