When traversing from one focus group to the next (with tab on keyboard) I expect the focus to move to the first field in the next group, but it seems to focus on nothing - and then another tab moves into that group.
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: SizedBox(
width: double.infinity,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
for (var i = 0; i < 2; i++)
FocusableActionDetector(
onFocusChange: (focused) {
if (!focused) {
print('Have left focus group');
}
},
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
for (var i = 0; i < 3; i++)
SizedBox(
width: 150,
child: TextField(),
),
],
),
),
],
),
),
),
);
}
}
I expect that after the last field in the first group a press of Tab should move focus immediately to the first item in the next focus group.
I have tried all manner of FocusNode, FocusScope, FocusScope.of(context).___, however I am finding the focus management in Flutter a bit confusing.
Aucun commentaire:
Enregistrer un commentaire