fixed duplicate GlobalKeys

This commit is contained in:
Vadim 2023-03-23 23:34:08 +03:00
parent eb78b0b80b
commit 7d535e8c0c

View file

@ -23,11 +23,9 @@ class _EquipmentProfilesScreenState extends State<EquipmentProfilesScreen> {
@override
void initState() {
super.initState();
profileContainersKeys = List.filled(
EquipmentProfiles.of(context, listen: false).length,
GlobalKey<EquipmentProfileContainerState>(),
growable: true,
);
profileContainersKeys = EquipmentProfiles.of(context, listen: false)
.map((e) => GlobalKey<EquipmentProfileContainerState>(debugLabel: e.id))
.toList();
}
@override