flutter - 在 Flutter 中使用扩展和灵活的小部件时移除额外空间
问题描述
在一个页面中包含两个部分。第二个是可滚动部分。页面顶部的第一个,不可滚动。但该部分包含一个 Textformfield。所以当 Keyboard 出现时,如果 Page Height 很短,它会显示“A RenderFlex 在底部溢出了 62 个像素”。所以第一部分用灵活的小部件包装。现在一个额外的空间出现在页面的底部。我怎样才能删除这个。?
Widget build(BuildContext context) {
return Scaffold(resizeToAvoidBottomInset: true,extendBodyBehindAppBar: false,extendBody: false,
appBar:AppBar(title: Text('AppBar'),backgroundColor: Colors.orange,elevation: 0.0,),
body:SafeArea( child:Column(children: [
//ClipRect(child:
Flexible(child:
Container(color:Colors.yellow,child: ListView(shrinkWrap:true,children: [
Center(child:Text('Do not Scroll this section',style: TextStyle(color: Colors.red),)),
Column(children: [ Row(children: [
Flexible(flex:1,fit:FlexFit.tight,child:Container(child:Text('name')),),Flexible(flex:1,fit:FlexFit.tight,child:Container(height:66,child:TextFormField(decoration:InputDecoration()))),]),])
]))),
Expanded(child: ListView.builder(itemCount:450,scrollDirection:Axis.vertical,shrinkWrap:true,controller:scrollcontroller, itemBuilder: (_, index){return Column(children:[Text('Scrollable')]);}))
]),));}
解决方案
推荐阅读
- android - 在没有序列化程序的对象上使用 JSON.stringify 需要标记为实验性
- python - 是否可以在 python 控制台中自动跳转到帮助函数输出的开头?
- python - 将字典变量传递给自定义模块
- c# - 获取多个相同类型的正在运行的 COM 对象
- svn - svn 忽略文件不适用于 svn add
- android - 使用 FusedLocation 停止位置更新
- c# - GetType("UnityEngine.Debug").GetMethod("Log", new Type[] { typeof(string) }); 在即时模式面板中生成错误,而不是在代码中
- javascript - 如何避免在生成大量 html 元素时冻结浏览器
- java - 如何使用 jpa ElementCollection 提取
- python - 如何将我的自定义张量流层嵌入到 keras 模型中