android - 单击 TextFormField 时隐藏在键盘后面
问题描述
我已经在其父是 SingleChildScrollView 的列中实现了 TextFormField。但不知何故,当我单击 TextFormField 时,它无法自动滚动。
有关更多详细信息,我正在添加视频 URL。视频
这是代码:
Widget build(BuildContext context) {
// TODO: implement build
return Scaffold(
resizeToAvoidBottomPadding: false,
floatingActionButton: FloatingActionButton(
backgroundColor: AppTheme.colors.themeBlue,
child: Icon(Icons.arrow_forward),
onPressed: () {
},
),
body: Container(
color: AppTheme.colors.backgroundLight,
child: Column(
children: <Widget>[
AppBarWidget(
title: Constants.addClient,
),
ProfileImageWidget(),
Container(
height: 100,
width: screenSize.width,
child: ListView(
padding: EdgeInsets.all(AppSize.small),
children: <Widget>[
SizedBox(
height: 10,
),
ProfileTextFieldWidget(
labelTextStyle: AppTheme.textStyle.lightHeading
.copyWith(
fontSize: AppFontSize.s18,
color: AppTheme.colors.themeBlue),
labelText: Constants.clientName,
hintText: Constants.michaelNilson,
// cursorColor: AppTheme.colors.themeBlue,
),
SizedBox(
height: 10,
),
ProfileTextFieldWidget(
labelTextStyle: AppTheme.textStyle.lightHeading
.copyWith(
fontSize: AppFontSize.s18,
color: AppTheme.colors.themeBlue),
labelText: Constants.email,
hintText: Constants.email,
textInputAction: TextInputAction.done,
),
SizedBox(
height: 10,
),
ProfileTextFieldWidget(
labelTextStyle: AppTheme.textStyle.lightHeading
.copyWith(
fontSize: AppFontSize.s18,
color: AppTheme.colors.themeBlue),
labelText: Constants.mobile,
hintText: Constants.mobile,
textInputAction: TextInputAction.done,
),
SizedBox(
height: 10,
),
ProfileTextFieldWidget(
labelTextStyle: AppTheme.textStyle.lightHeading
.copyWith(
fontSize: AppFontSize.s18,
color: AppTheme.colors.themeBlue),
labelText: Constants.followUp,
hintText: Constants.followUp,
textInputAction: TextInputAction.done,
suffixIcon: IconButton(
icon: Icon(
Icons.keyboard_arrow_down,
color: Colors.black87,
),
),
),
SizedBox(
height: 10,
),
ProfileTextFieldWidget(
labelTextStyle: AppTheme.textStyle.lightHeading
.copyWith(
fontSize: AppFontSize.s18,
color: AppTheme.colors.themeBlue),
labelText: Constants.date,
suffixIcon: IconButton(
icon: Icon(
Icons.date_range,
size: 15,
color: Colors.black87,
),
),
hintText: Constants.date,
textInputAction: TextInputAction.done,
),
SizedBox(
height: 10,
),
ProfileTextFieldWidget(
labelTextStyle: AppTheme.textStyle.lightHeading
.copyWith(
fontSize: AppFontSize.s18,
color: AppTheme.colors.themeBlue),
suffixIcon: IconButton(
icon: Icon(
Icons.access_time,
size: AppSize.medium,
color: Colors.black87,
),
),
hintText: Constants.time,
labelText: Constants.time,
textInputAction: TextInputAction.done,
),
SizedBox(
height: AppSize.small,
),
ProfileTextFieldWidget(
labelTextStyle: AppTheme.textStyle.lightHeading
.copyWith(
fontSize: AppFontSize.s18,
color: AppTheme.colors.themeBlue),
labelText: Constants.notes,
hintText: Constants.notes,
textInputAction: TextInputAction.done,
),
SizedBox(
height: AppSize.small,
),
],
)
)
],
),
),
);
}
详情请看视频:
解决方案
立即删除resizeToAvoidBottomPadding: false,
已弃用的
并使用 resizeToAvoidBottomInset: true,
推荐阅读
- queue - Python 使用异步和队列
- azure-data-factory - Synapse 批量更新 - 管道在活动日志中显示从 ADF 迁移,但未显示在 SYNAPSE 中
- javascript - 如何通过将 if/else 块替换为 React 中的其他内容来降低 27 的复杂性
- reactjs - GAPI Calendar auth react => TypeError: Cannot read properties of undefined (reading 'load')
- sql - 查询以查找和连接 postgres 数据库中的所有表
- c# - 如何 DefultView Rowfilter 添加新
- reactjs - 获取错误“未知”类型的参数不能分配给“错误”类型的参数 | 无效的'
- javascript - 如何在服务中获取 req.user?
- reactjs - 在客户端显示图像(反应)来自 mongoDB(具有存储服务器端图像的文件夹的路径)
- css - 我怎样才能在这个网站上制作动画?