Make MediaDevice data class (#174)
This commit is contained in:
@@ -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}';
|
||||
|
||||
Reference in New Issue
Block a user