Use ExcludeFocus widget when IndexedStack child is not selected for better tab traversal with keyboard / screen reader.
This commit is contained in:
parent
1bfecc0ba7
commit
b527acba1c
@ -39,7 +39,9 @@ class LazyIndexedStackState extends State<LazyIndexedStack> {
|
|||||||
// Mark current index as active
|
// Mark current index as active
|
||||||
_activated[widget.index] = true;
|
_activated[widget.index] = true;
|
||||||
final children = List.generate(_activated.length, (i) {
|
final children = List.generate(_activated.length, (i) {
|
||||||
return _activated[i] ? widget.children[i] : const SizedBox.shrink();
|
Widget child = _activated[i] ? widget.children[i] : const SizedBox.shrink();
|
||||||
|
bool isSelected = widget.index == i;
|
||||||
|
return ExcludeFocus(excluding: !isSelected, child: child);
|
||||||
});
|
});
|
||||||
return IndexedStack(
|
return IndexedStack(
|
||||||
alignment: widget.alignment,
|
alignment: widget.alignment,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user