我有AlertDilaog和TextField和DropDownButton。
问题:
一旦启动对话框并单击textfield,警报对话框就会向上移动,textfield中的标签动画就会发生。但是在发生这个的时候,我看到了jank,和我做了分析,我仍然在试图理解为什么会发生这种情况。
这是截图

下面是分析文件:https://filebin.net/7wulbm9j88m6jjt3
能帮助我理解这个VsyncProcessCallback是什么,以及所选部分(括号)中发生的事情吗?
我只是想找出Jank的根本原因并移除它。
提前谢谢你。
TextField代码:
Widget _addProtocolTextField(BuildContext context) {
return Container(
height: 7.h,
width: 70.w,
child: TextField(
controller: _protocolNameController,
style: TextStyle(
color: Theme.of(context).textColor,
fontSize: 13.sp,
),
textAlign: TextAlign.left,
maxLines: 1,
decoration: InputDecoration(
labelText: Strings.protocol_name_lable,
labelStyle: TextStyle(color: ColorConstants.primaryColor),
enabledBorder: _getBorder(),
disabledBorder: _getBorder(),
focusedBorder: _getBorder(),
border: _getBorder(),
),
),
);
}
OutlineInputBorder _getBorder() {
return OutlineInputBorder(
borderSide: BorderSide(color: ColorConstants.primaryColor),
);
}发布于 2021-07-30 07:44:51
由于这些代码不足以提供真正的解决方案,因此您可以参考以下技巧:
不使用函数制作Widget,更喜欢制作一个单独的无状态或有状态的小部件,因为requirement
https://stackoverflow.com/questions/68585134
复制相似问题