I want to achieve a layout that looks like this.
It works fine until I do focus on the input.
I wonder how to do this in a proper way... Here is what I already tried so far:
- Wrapping form inside
SingleChildScrollView
(Spacer
widget causing error). - Using
CustomScrollView
, (Spacer
widget causing error). - Wrapping
CustomScrollView
orSingleChildScrollView
insideSizedBox
limited by device's height (causing some element only partially visible on smaller devices). - Following the answer from this question (doesn't work).
Any clue? Here is my code:
class CreateFieldReportPage extends GetView<CreateFieldReportController> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: GestureDetector(
onTap: controller.focusScope.unfocus,
child: SafeArea(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 30),
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
PageHeader(
helper: 'fieldReport.create.helper'.tr,
title: 'fieldReport.create'.tr,
),
Spacer(),
FieldReportForm(),
PageNavigator(
onPressedPrimaryButton: () {
Get.toNamed(Routes.EVENT_CREATE_ADD_USER);
},
),
],
),
),
),
),
);
}
}