I am using so many ObservableMaps in the app and none of them are updating the UI since I upgraded to 2.2.3
Observer(
builder: (_) {
return SliverGrid(
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: crossAxisCount,
childAspectRatio: tileWidth / tileHeight,
crossAxisSpacing: 2,
mainAxisSpacing: 2,
),
delegate: SliverChildBuilderDelegate(
(context, index) {
final participant = videoRoomStore
.sortedParticipants.values
.elementAt(index);
return VisibilityDetector(
key: Key(participant.identity),
onVisibilityChanged: (info) {
final bool isVisible =
info.visibleFraction > 0;
final bool isCompletelyGone =
info.visibleFraction == 0;
final bool isSubscribed = videoRoomStore
.participantSubscriptions[
participant.identity] ??
false;
final bool shouldSubscribe =
!isSubscribed &&
isVisible &&
!participant.isLocalParticipant;
if (shouldSubscribe) {
videoRoomStore.subscribeToVideoTracks(
participant.participant
as RemoteParticipant,
);
videoRoomStore.visibleParticipants[
participant.identity] = true;
} else if (!participant
.isLocalParticipant &&
isCompletelyGone) {
videoRoomStore.unSubscribeToVideoTracks(
participant.participant
as RemoteParticipant,
);
videoRoomStore.visibleParticipants
.remove(
participant.identity,
);
}
},
child: ParticipantTile(
participant: participant,
),
);
},
childCount: videoRoomStore.isAppInForeground
? videoRoomStore.sortedParticipants.length
: 0,
),
);
},
),
I am using so many ObservableMaps in the app and none of them are updating the UI since I upgraded to 2.2.3
@observable ObservableMap<String, ParticipantExtended> sortedParticipants = ObservableMap<String, ParticipantExtended>();What change I need to make to keep it working as earlier it used to work?