Make MediaDevice data class (#174)

This commit is contained in:
Jaspreet Singh
2022-09-16 10:05:28 +04:00
committed by GitHub
parent a01c9be162
commit ce722f55bb
+15 -1
View File
@@ -3,12 +3,26 @@ import 'dart:async';
import 'package:flutter_webrtc/flutter_webrtc.dart' as rtc;
class MediaDevice {
MediaDevice(this.deviceId, this.label, this.kind);
const MediaDevice(this.deviceId, this.label, this.kind);
final String deviceId;
final String label;
final String kind;
@override
bool operator ==(covariant MediaDevice other) {
if (identical(this, other)) return true;
return other.deviceId == deviceId &&
other.kind == kind &&
other.label == label;
}
@override
int get hashCode {
return deviceId.hashCode ^ kind.hashCode ^ label.hashCode;
}
@override
String toString() {
return 'MediaDevice{deviceId: $deviceId, label: $label, kind: $kind}';