gpt4 book ai didi

flutter - 在 Flutter 中,如何通过 checklisttile 使单个选项卡击键成为选项卡?

转载 作者:行者123 更新时间:2023-12-05 04:33:27 24 4
gpt4 key购买 nike

目前,我必须按 Tab 键两次(两次 Tab 键击)才能“通过 Tab 键浏览”复选框 (checklisttile)。

我只想强制执行一次 Tab 键击以在复选框中进行 Tab 操作,就像在文本表单域中进行 Tab 操作一样。你如何做到这一点?我试过用焦点小部件包装 checklisttile,并将焦点节点也插入到 checklisttile 中。

tabbing

CheckboxListTile(
contentPadding: EdgeInsets.zero,
title: new RichText(
text: new TextSpan(children: <InlineSpan>[
TextSpan(
text: 'I understand and agree to the ',
style: TextStyle(color: Colors.black87)),
TextSpan(
recognizer: TapGestureRecognizer()
..onTap = () {
Slideout(
context: context,
title: widget.slideOutTitle != null
? widget.slideOutTitle
: "Terms and Conditions",
child: ListView(
shrinkWrap: true,
children: [
Padding(
padding: const EdgeInsets.fromLTRB(30, 20, 30, 0),
child: Column(children: [
widget.dialogTextWidget,
SizedBox(height: 20),
ButtonWidget(
labelText: "Agree",
onPress: () {
setState(() {
consentCheckedValue = true;
_isDisabled = false;
});
Navigator.pop(context);
}),
]),
)
],
));
},
text: 'Terms and Conditions.',
style: TextStyle(
color: Theme.of(context).primaryColor, fontWeight: FontWeight.bold)),
])),
value: consentCheckedValue,
onChanged: (newValue) {
setState(() {
consentCheckedValue = newValue!;
_isDisabled = !newValue;
});
},
controlAffinity: ListTileControlAffinity.leading,
)

最佳答案

您可以在 CheckboxListTile 中使用自定义 focusNode,并启用 skipTraversal:

CheckboxListTile(
...,
focusNode: FocusNode(skipTraversal: true),
);

关于flutter - 在 Flutter 中,如何通过 checklisttile 使单个选项卡击键成为选项卡?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71416586/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com