move reference to engine to parent (Participant) class

This commit is contained in:
Hiroshi Horie
2021-12-03 00:17:03 +07:00
parent 08d9575ec5
commit e597e4f2fd
4 changed files with 31 additions and 27 deletions
+9 -3
View File
@@ -6,6 +6,7 @@ import '../extensions.dart';
import '../logger.dart';
import '../managers/event.dart';
import '../proto/livekit_models.pb.dart' as lk_models;
import '../rtc_engine.dart';
import '../support/disposable.dart';
import '../track/track.dart';
import '../publication/track_publication.dart';
@@ -24,6 +25,10 @@ import 'remote_participant.dart';
/// can not be instantiated directly.
abstract class Participant extends DisposableChangeNotifier
with EventsEmittable<ParticipantEvent> {
/// Reference to [RTCEngine]
@internal
final RTCEngine engine;
/// map of track sid => published track
abstract final Map<String, TrackPublication> trackPublications;
@@ -88,9 +93,10 @@ abstract class Participant extends DisposableChangeNotifier
@internal
bool get hasInfo => _participantInfo != null;
Participant(
this.sid,
this.identity, {
Participant({
required this.engine,
required this.sid,
required this.identity,
required this.roomEvents,
}) {
// Any event emitted will trigger ChangeNotifier