【发布时间】:2020-10-15 16:57:52
【问题描述】:
我已在其父级为 SingleChildScrollView 的 Column 中实现 TextFormField。 但不知何故,当我单击 TextFormField 时,它无法自动滚动。
有关更多详细信息,我正在添加视频 URL。 Video
代码如下:
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,
),
],
)
)
],
),
),
);
}
详情请看视频:
【问题讨论】:
-
可以给截图吗
-
@YasharthDubey 我添加了视频。请看一看。
-
请看我的回答并告诉我它是否有效将所有文本字段放入容器中,然后将动画放入我认为会有所帮助的地方。
-
@YasharthDubey 不工作。
-
你必须稍微修改一下,制作一个自定义动画并将该动画放到你所有的文本字段中
标签: android flutter user-interface dart