Enable ALL THE LINTS

Well, all the easy ones, anyway.

For some reason `// ignore:` isn't working for me so I've disabled
lints that need that. Also disabled those that require a ton of work
(which I'm doing, but not in this PR, to keep it reviewable).

This adds:
- avoid_init_to_null
- library_names
- package_api_docs
- package_names
- package_prefixed_library_names
- prefer_is_not_empty
- sort_constructors_first
- sort_unnamed_constructors_first
- unnecessary_getters_setters
This commit is contained in:
Ian Hickson
2016-03-10 23:15:31 -08:00
parent 7544514484
commit 1b9cd52081
41 changed files with 271 additions and 264 deletions

View File

@@ -26,6 +26,7 @@ typedef dynamic EvaluatorFunction();
/// Drives a Flutter Application running in another process.
class FlutterDriver {
FlutterDriver.connectedTo(this._serviceClient, this._appIsolate);
static const String _kFlutterExtensionMethod = 'ext.flutter_driver';
static const Duration _kDefaultTimeout = const Duration(seconds: 5);
@@ -140,8 +141,6 @@ class FlutterDriver {
return driver;
}
FlutterDriver.connectedTo(this._serviceClient, this._appIsolate);
/// Client connected to the Dart VM running the Flutter application
final VMServiceClient _serviceClient;
/// The main isolate hosting the Flutter application

View File

@@ -124,27 +124,27 @@ class ByValueKey extends SearchSpecification {
/// Command to read the text from a given element.
class GetText extends CommandWithTarget {
/// [targetRef] identifies an element that contains a piece of text.
GetText(ObjectRef targetRef) : super(targetRef);
final String kind = 'get_text';
static GetText deserialize(Map<String, String> json) {
return new GetText(new ObjectRef(json['targetRef']));
}
/// [targetRef] identifies an element that contains a piece of text.
GetText(ObjectRef targetRef) : super(targetRef);
Map<String, String> serialize() => super.serialize();
}
class GetTextResult extends Result {
static GetTextResult fromJson(Map<String, dynamic> json) {
return new GetTextResult(json['text']);
}
GetTextResult(this.text);
final String text;
static GetTextResult fromJson(Map<String, dynamic> json) {
return new GetTextResult(json['text']);
}
Map<String, dynamic> toJson() => {
'text': text,
};

View File

@@ -16,7 +16,7 @@ abstract class Command {
/// An object sent from a Flutter application back to the Flutter Driver in
/// response to a command.
abstract class Result {
abstract class Result { // ignore: one_member_abstracts
/// Serializes this message to a JSON map.
Map<String, dynamic> toJson();
}

View File

@@ -24,9 +24,9 @@ Future<dynamic> retry(Action action, Duration timeout,
assert(pauseBetweenRetries != null);
Stopwatch sw = stopwatchFactory()..start();
dynamic result = null;
dynamic lastError = null;
dynamic lastStackTrace = null;
dynamic result;
dynamic lastError;
dynamic lastStackTrace;
bool success = false;
while(!success && sw.elapsed < timeout) {