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:
@@ -11,44 +11,28 @@ import 'package:protobuf/protobuf.dart' as $pb;
|
||||
|
||||
class SignalTarget extends $pb.ProtobufEnum {
|
||||
static const SignalTarget PUBLISHER = SignalTarget._(
|
||||
0,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_enum_names')
|
||||
? ''
|
||||
: 'PUBLISHER');
|
||||
0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'PUBLISHER');
|
||||
static const SignalTarget SUBSCRIBER = SignalTarget._(
|
||||
1,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_enum_names')
|
||||
? ''
|
||||
: 'SUBSCRIBER');
|
||||
1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'SUBSCRIBER');
|
||||
|
||||
static const $core.List<SignalTarget> values = <SignalTarget>[
|
||||
PUBLISHER,
|
||||
SUBSCRIBER,
|
||||
];
|
||||
|
||||
static final $core.Map<$core.int, SignalTarget> _byValue =
|
||||
$pb.ProtobufEnum.initByValue(values);
|
||||
static final $core.Map<$core.int, SignalTarget> _byValue = $pb.ProtobufEnum.initByValue(values);
|
||||
static SignalTarget? valueOf($core.int value) => _byValue[value];
|
||||
|
||||
const SignalTarget._($core.int v, $core.String n) : super(v, n);
|
||||
}
|
||||
|
||||
class VideoQuality extends $pb.ProtobufEnum {
|
||||
static const VideoQuality LOW = VideoQuality._(
|
||||
0,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_enum_names')
|
||||
? ''
|
||||
: 'LOW');
|
||||
static const VideoQuality LOW =
|
||||
VideoQuality._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'LOW');
|
||||
static const VideoQuality MEDIUM = VideoQuality._(
|
||||
1,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_enum_names')
|
||||
? ''
|
||||
: 'MEDIUM');
|
||||
static const VideoQuality HIGH = VideoQuality._(
|
||||
2,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_enum_names')
|
||||
? ''
|
||||
: 'HIGH');
|
||||
1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'MEDIUM');
|
||||
static const VideoQuality HIGH =
|
||||
VideoQuality._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'HIGH');
|
||||
|
||||
static const $core.List<VideoQuality> values = <VideoQuality>[
|
||||
LOW,
|
||||
@@ -56,8 +40,7 @@ class VideoQuality extends $pb.ProtobufEnum {
|
||||
HIGH,
|
||||
];
|
||||
|
||||
static final $core.Map<$core.int, VideoQuality> _byValue =
|
||||
$pb.ProtobufEnum.initByValue(values);
|
||||
static final $core.Map<$core.int, VideoQuality> _byValue = $pb.ProtobufEnum.initByValue(values);
|
||||
static VideoQuality? valueOf($core.int value) => _byValue[value];
|
||||
|
||||
const VideoQuality._($core.int v, $core.String n) : super(v, n);
|
||||
@@ -65,15 +48,9 @@ class VideoQuality extends $pb.ProtobufEnum {
|
||||
|
||||
class DataPacket_Kind extends $pb.ProtobufEnum {
|
||||
static const DataPacket_Kind RELIABLE = DataPacket_Kind._(
|
||||
0,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_enum_names')
|
||||
? ''
|
||||
: 'RELIABLE');
|
||||
0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'RELIABLE');
|
||||
static const DataPacket_Kind LOSSY = DataPacket_Kind._(
|
||||
1,
|
||||
const $core.bool.fromEnvironment('protobuf.omit_enum_names')
|
||||
? ''
|
||||
: 'LOSSY');
|
||||
1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'LOSSY');
|
||||
|
||||
static const $core.List<DataPacket_Kind> values = <DataPacket_Kind>[
|
||||
RELIABLE,
|
||||
|
||||
Reference in New Issue
Block a user