Apply Flutter best practices [Non-Breaking] (#2)
* Add flutter_lints package * Use key in widget constructors lint: use_key_in_widget_constructors * Unnecessary new keyword lint: unnecessary_new * Prefer const with constant constructors * Exclude protobuf files from analyzer * Private field could be final * Annotate overridden members * Use initializing formals when possible * Don't access members with `this` unless avoiding shadowing * Prefer is! operator * Use isEmpty instead of length * Use collection literals when possible * Revert comment changes * Cleaner null testing * Misc fixes * Avoid using `forEach` with a function literal * Prefer `final` over `var` where applicable * Enforce stricter type-checking * Ignore VS Code files * Flutter format * Prefer using lowerCamelCase for constant names * flutter format -l 100 * Disable `avoid_print` for examples * Slight improvements to example Should solve lint error: no_logic_in_create_state
This commit is contained in:
@@ -7,7 +7,7 @@ import 'track_publication.dart';
|
||||
/// Represents a track publication from a RemoteParticipant. Provides methods to
|
||||
/// control if we should subscribe to the track, and its quality (for video).
|
||||
class RemoteTrackPublication extends TrackPublication {
|
||||
RemoteParticipant _participant;
|
||||
final RemoteParticipant _participant;
|
||||
bool _unsubscribed = false;
|
||||
bool _disabled = false;
|
||||
VideoQuality _videoQuality = VideoQuality.HIGH;
|
||||
@@ -26,6 +26,7 @@ class RemoteTrackPublication extends TrackPublication {
|
||||
_sendUpdateTrackSettings();
|
||||
}
|
||||
|
||||
@override
|
||||
bool get subscribed {
|
||||
if (_unsubscribed) {
|
||||
return false;
|
||||
@@ -41,6 +42,7 @@ class RemoteTrackPublication extends TrackPublication {
|
||||
|
||||
/// for internal use
|
||||
/// {@nodoc}
|
||||
@override
|
||||
set muted(bool val) {
|
||||
if (val == muted) {
|
||||
return;
|
||||
@@ -59,13 +61,12 @@ class RemoteTrackPublication extends TrackPublication {
|
||||
_participant.muteChanged();
|
||||
}
|
||||
|
||||
RemoteTrackPublication(TrackInfo info, this._participant, [Track? track])
|
||||
: super.fromInfo(info) {
|
||||
RemoteTrackPublication(TrackInfo info, this._participant, [Track? track]) : super.fromInfo(info) {
|
||||
this.track = track;
|
||||
}
|
||||
|
||||
_sendUpdateTrackSettings() {
|
||||
var settings = new UpdateTrackSettings(
|
||||
void _sendUpdateTrackSettings() {
|
||||
final settings = UpdateTrackSettings(
|
||||
trackSids: [sid],
|
||||
disabled: _disabled,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user