键盘隐藏颤振中的文本表单字段

问题描述 投票:0回答:1

嗨,团队,我在文本表单字段中遇到问题。我使用一台屏幕分辨率较低的 Android 设备,因此,如果我尝试输入任何内容,键盘会隐藏该文本表单字段,因此我有一个文本表单字段,因此我更改了脚手架中的代码并添加了 resizeToAvoidBottomInset:false 但之后我有一个视图摘要屏幕末端的按钮不在键盘上方

孩子:脚手架( resizeToAvoidBottomInset:假, 背景颜色:AppColors.grayscaleBackground, appBar: SimpleAppBarWithTitleAndLeadingButton( 标题: '', 领先图标:图标按钮( 填充:EdgeInsets.zero, 图标大小:50, 图标:const CustomSvg( 名称:AppIcons.close, 身高:50, 宽度:50, ), onPressed: () => getCancelAddNewModal(context), ), ), 正文:const EnterTagsForm(), ), );

EnterTagsForm 代码 ->

 return Column(
      children: [
        Padding(
          padding: const EdgeInsets.only(bottom: 24),
          child: Align(
            alignment: Alignment.centerLeft,
            child: Padding(
              padding: const EdgeInsets.symmetric(
                horizontal: 24,
              ),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      Text('Enter Tag',
                          style: isSmallDevice
                              ? TextStyleCatalog.title1_dark2
                              : TextStyleCatalog.title1_dark),
                      Text(
                        'Enter Tag ID on the YourTag',
                        style: isSmallDevice
                            ? TextStyleCatalog.body1_medium2
                            : TextStyleCatalog.body1_medium,
                        textAlign: TextAlign.start,
                      ),
                    ],
                  ),
                  Expanded(
                    child: Column(
                      children: [
                        Text(
                          'Tags Entered',
                          style: isSmallDevice
                              ? TextStyleCatalog.body1_medium2
                              : TextStyleCatalog.body1_dark,
                          overflow: TextOverflow.ellipsis,
                        ),
                        Text(
                          state.animalList.length.toString(),
                          style: TextStyleCatalog.title2_dark,
                        ),
                      ],
                    ),
                  ),
                ],
              ),
            ),
          ),
        ),
        Padding(
          padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 8),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              const Text(
                'EPC Prefix',
                style: TextStyleCatalog.title2_dark,
              ),
              DecoratedBox(
                decoration: BoxDecoration(
                  color: AppColors.greyscaleFields,
                  borderRadius: BorderRadius.circular(12),
                ),
                child: Padding(
                  padding: const EdgeInsets.all(16),
                  child: Text(
                    state.data!.getTagsAssetsAssign.first!.epcprefix,
                    style: TextStyleCatalog.body1_dark,
                  ),
                ),
              ),
            ],
          ),
        ),
        const Expanded(
          child: EnterTagDataList(),
        ),
        Builder(
          builder: (context) {
            if (state.selectedAttributes.isOneSpecificAttributeSelected()) {
              return BottomButton(
                disabled: false,
                label: 'View Summary',
                onPressed: () {
                  addNewAnimalsCubit
                      .updateCurrentScreen(CurrentScreen.createNewAnimals);
                },
              );
            }

需要帮助

flutter overflow android-softkeyboard
1个回答
0
投票

厌倦了将

Column
小部件(返回后)包装在
SingleChildScrollView
Widget 中并将
MediaQuery.of(context).viewInsets
赋予
padding
参数。

© www.soinside.com 2019 - 2024. All rights reserved.