🐛 Bug fixes of duplication

This commit is contained in:
LittleSheep 2024-04-28 00:21:16 +08:00
parent 155f7c7999
commit 0483e99a4c

View File

@ -277,6 +277,14 @@ class _ChatCallState extends State<ChatCall> {
}
}
}
var checklistIdx = List<String>.empty(growable: true);
userMediaTracks = userMediaTracks.where((element) {
if(checklistIdx.contains(element.participant.sid)) return false;
checklistIdx.add(element.participant.sid);
return true;
}).toList();
setState(() {
_participantTracks = [...screenTracks, ...userMediaTracks];
});
@ -403,18 +411,25 @@ class _ChatCallState extends State<ChatCall> {
right: 0,
top: 0,
child: SizedBox(
height: 120,
height: 120 + 16,
child: ListView.builder(
scrollDirection: Axis.horizontal,
itemCount: math.max(0, _participantTracks.length - 1),
itemBuilder: (BuildContext context, int index) => SizedBox(
itemBuilder: (BuildContext context, int index) => Padding(
padding: const EdgeInsets.all(8.0),
child: ClipRRect(
borderRadius: const BorderRadius.all(Radius.circular(8)),
child: Container(
width: 120,
height: 120,
color: Theme.of(context).cardColor,
child: ParticipantWidget.widgetFor(_participantTracks[index + 1]),
),
),
),
),
),
),
],
);
},