Enable and fix some lints
diff --git a/analysis_options.yaml b/analysis_options.yaml
index 2ef22c9..d043bbe 100644
--- a/analysis_options.yaml
+++ b/analysis_options.yaml
@@ -6,3 +6,6 @@
- directives_ordering
- empty_constructor_bodies
- empty_statements
+ - non_constant_identifier_names
+ - prefer_final_fields
+ - prefer_single_quotes
diff --git a/example/ga.dart b/example/ga.dart
index ad64249..3df1573 100644
--- a/example/ga.dart
+++ b/example/ga.dart
@@ -8,16 +8,16 @@
import 'package:usage/usage_io.dart';
main(List args) async {
- final String DEFAULT_UA = 'UA-55029513-1';
+ final String defaultUA = 'UA-55029513-1';
if (args.isEmpty) {
print('usage: dart ga <GA tracking ID>');
- print('pinging default UA value (${DEFAULT_UA})');
+ print('pinging default UA value (${defaultUA})');
} else {
print('pinging ${args.first}');
}
- String ua = args.isEmpty ? DEFAULT_UA : args.first;
+ String ua = args.isEmpty ? defaultUA : args.first;
Analytics ga = new AnalyticsIO(ua, 'ga_test', '3.0');
diff --git a/lib/src/usage_impl.dart b/lib/src/usage_impl.dart
index df529e3..a6b2e49 100644
--- a/lib/src/usage_impl.dart
+++ b/lib/src/usage_impl.dart
@@ -12,7 +12,7 @@
// &foo=bar
return map.keys.map((key) {
String value = '${map[key]}';
- return "${key}=${Uri.encodeComponent(value)}";
+ return '${key}=${Uri.encodeComponent(value)}';
}).join('&');
}
@@ -80,7 +80,7 @@
String _url;
- StreamController<Map<String, dynamic>> _sendController =
+ final StreamController<Map<String, dynamic>> _sendController =
new StreamController.broadcast(sync: true);
AnalyticsImpl(this.trackingId, this.properties, this.postHandler,
diff --git a/lib/src/usage_impl_io.dart b/lib/src/usage_impl_io.dart
index 6e82d41..f7df057 100644
--- a/lib/src/usage_impl_io.dart
+++ b/lib/src/usage_impl_io.dart
@@ -56,7 +56,7 @@
} else {
// Dart/1.8.0 (macos; macos; macos; en_US)
String os = Platform.operatingSystem;
- return "Dart/${getDartVersion()} (${os}; ${os}; ${os}; ${locale})";
+ return 'Dart/${getDartVersion()} (${os}; ${os}; ${os}; ${locale})';
}
}
diff --git a/lib/usage.dart b/lib/usage.dart
index e79701c..707d429 100644
--- a/lib/usage.dart
+++ b/lib/usage.dart
@@ -243,7 +243,7 @@
/**
* Events are never added to this controller for the mock implementation.
*/
- StreamController<Map<String, dynamic>> _sendController =
+ final StreamController<Map<String, dynamic>> _sendController =
new StreamController.broadcast();
/**
diff --git a/test/web_test.dart b/test/web_test.dart
index 8d91ae9..1162559 100644
--- a/test/web_test.dart
+++ b/test/web_test.dart
@@ -2,7 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-@TestOn("browser")
+@TestOn('browser')
library usage.web_test;
import 'dart:async';