Connection quality (#27)
* update protos * signal event * implemented * format * implement example * protocol 5 * icon size
This commit is contained in:
@@ -125,6 +125,7 @@ class _ParticipantWidgetState extends State<ParticipantWidget> {
|
||||
title: widget.participant.identity,
|
||||
audioAvailable: firstAudioPub?.muted == false &&
|
||||
firstAudioPub?.subscribed == true,
|
||||
connectionQuality: widget.participant.connectionQuality,
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:livekit_client/livekit_client.dart';
|
||||
|
||||
class ParticipantInfoWidget extends StatelessWidget {
|
||||
//
|
||||
final String? title;
|
||||
final bool audioAvailable;
|
||||
final ConnectionQuality connectionQuality;
|
||||
|
||||
const ParticipantInfoWidget({
|
||||
this.title,
|
||||
this.audioAvailable = true,
|
||||
this.connectionQuality = ConnectionQuality.unknown,
|
||||
Key? key,
|
||||
}) : super(key: key);
|
||||
|
||||
@@ -38,6 +41,21 @@ class ParticipantInfoWidget extends StatelessWidget {
|
||||
size: 16,
|
||||
),
|
||||
),
|
||||
if (connectionQuality != ConnectionQuality.unknown)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 5),
|
||||
child: Icon(
|
||||
connectionQuality == ConnectionQuality.poor
|
||||
? EvaIcons.wifiOffOutline
|
||||
: EvaIcons.wifi,
|
||||
color: {
|
||||
ConnectionQuality.excellent: Colors.green,
|
||||
ConnectionQuality.good: Colors.orange,
|
||||
ConnectionQuality.poor: Colors.red,
|
||||
}[connectionQuality],
|
||||
size: 16,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user