diff --git a/lib/src/hardware/hardware.dart b/lib/src/hardware/hardware.dart index 21e4b93..129a729 100644 --- a/lib/src/hardware/hardware.dart +++ b/lib/src/hardware/hardware.dart @@ -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}';