键盘在颤动中向上推堆栈中的一些元素

问题描述

我有一个 DraggableScrollableSheet,里面有一个 Stack 小部件,其中包含 2 个小部件。问题是当我打开 softKeyboard 时,第二个小部件(位于底部)位于键盘上方并挡住了一些视线。

这是我的工作表代码:(按下按钮即可调用此工作表。)

Future bottompullup(BuildContext context) {
  return showModalBottomSheet(
      shape: RoundedRectangleBorder(
          borderRadius: BorderRadius.only(
        topLeft: Radius.circular(30),topRight: Radius.circular(30),)),backgroundColor: Colors.white,context: context,isScrollControlled: true,builder: (_) {
        return DraggableScrollableSheet(
            initialChildSize: 0.73,maxChildSize: 0.93,expand: false,builder: (_,controller) {
              return Container(
                decoration: Boxdecoration(
                    borderRadius: BorderRadius.only(
                  topLeft: Radius.circular(13),topRight: Radius.circular(13),child: Stack(
                  children: [
                    Padding(
                      padding: const EdgeInsets.symmetric(horizontal: 20),child: ListView(
                        controller: controller,keyboarddismissBehavior:
                            ScrollViewKeyboarddismissBehavior.onDrag,children: [
                          TextField(
                            decoration: Inputdecoration(
                              hintText: 'Enter here',),SizedBox(height: 50),for (int i = 0; i < 8; i++)
                            Column(
                              children: [
                                Text('Text$i'),SizedBox(height: 20),],)
                        ],Positioned(
                      bottom: 0,child: BlurryContainer(
                        height: 100,bgColor: Colors.white,width: MediaQuery.of(context).size.width,child: Column(
                          children: [
                            Container(
                                margin: EdgeInsets.fromLTRB(16,48,0),child: Row(
                                  children: [
                                    Flutterlogo(
                                      size: 33,Column(
                                      children: [
                                        Text('Some text'),Text("Some other text"),)
                                  ],);
            });
      });
}

现在,我知道有很多这样的问题,我尝试了所有解决方案,例如在 resizetoAvoidBottomInset = false添加 Scaffold 等,但都没有奏效。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)