8000 Add label getter to DataChannel Interface (#585) · tmthecoder/flutter-webrtc@6e25b75 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6e25b75

Browse files
rlshumatRyan Shumate
and
Ryan Shumate
authored
Add label getter to DataChannel Interface (flutter-webrtc#585)
Co-authored-by: Ryan Shumate <Ryan.Shumate@garmin.com>
1 parent cbff1e7 commit 6e25b75

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

lib/src/interface/rtc_data_channel.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ abstract class RTCDataChannel {
7575
/// Get current state.
7676
RTCDataChannelState? get state;
7777

78+
/// Get channel label
79+
String? get label;
80+
7881
/// Stream of state change events. Emits the new state on change.
7982
/// Closes when the [RTCDataChannel] is closed.
8083
late Stream<RTCDataChannelState> stateChangeStream;

lib/src/native/rtc_data_channel_impl.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ class RTCDataChannelNative extends RTCDataChannel {
3333
RTCDataChannelState? get state => _state;
3434

3535
/// Get label.
36-
String get label => _label;
36+
@override
37+
String? get label => _label;
3738

3839
final _stateChangeController =
3940
StreamController<RTCDataChannelState>.broadcast(sync: true);

lib/src/web/rtc_data_channel_impl.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ class RTCDataChannelWeb extends RTCDataChannel {
3232
@override
3333
RTCDataChannelState get state => _state;
3434

35< 5BE5 code class="diff-text syntax-highlighted-line addition">+
@override
36+
String? get label => _jsDc.label;
37+
3538
final _stateChangeController =
3639
StreamController<RTCDataChannelState>.broadcast(sync: true);
3740
final _messageController =

0 commit comments

Comments
 (0)
0