make the code strong
diff --git a/analysis_options.yaml b/analysis_options.yaml
new file mode 100644
index 0000000..a10d4c5
--- /dev/null
+++ b/analysis_options.yaml
@@ -0,0 +1,2 @@
+analyzer:
+ strong-mode: true
diff --git a/lib/dom_model.dart b/lib/dom_model.dart
index a42d73b..215b9b5 100644
--- a/lib/dom_model.dart
+++ b/lib/dom_model.dart
@@ -290,9 +290,9 @@
if (childNodeCount != null) {
map['childNodeCount'] = childNodeCount;
}
- if (children != null && children.isNotEmpty) {
+ if (_children != null && _children.isNotEmpty) {
var newChildren = [];
- children.forEach((child) {
+ _children.forEach((child) {
if (child != null) {
newChildren.add(child._toJsonInternal(visited));
}
diff --git a/lib/forwarder.dart b/lib/forwarder.dart
index 391244e..05dd72f 100644
--- a/lib/forwarder.dart
+++ b/lib/forwarder.dart
@@ -23,14 +23,14 @@
final WipConnection _debugger;
final WipDom domModel;
- /// If false, no Debugger.paused events will be forwarded back to the
- /// client. This gets automatically set to true if a breakpoint is set
- /// by the client.
+ /// If false, no Debugger.paused events will be forwarded back to the client.
+ /// This gets automatically set to true if a breakpoint is set by the client.
bool forwardPausedEvents = false;
- final _subscriptions = <StreamSubscription>[];
+ final List<StreamSubscription> _subscriptions = <StreamSubscription>[];
- final _closedController = new StreamController.broadcast();
+ final StreamController<Null> _closedController =
+ new StreamController.broadcast();
factory WipForwarder(WipConnection debugger, Stream stream,
{StreamSink sink, WipDom domModel}) {
@@ -106,7 +106,7 @@
}
_log.info('forwarding event: $event');
- var json = {'method': event.method};
+ var json = <String, dynamic>{'method': event.method};
if (event.params != null) {
json['params'] = event.params;
}
diff --git a/lib/src/dom.dart b/lib/src/dom.dart
index cf49f78..edb32a5 100644
--- a/lib/src/dom.dart
+++ b/lib/src/dom.dart
@@ -29,7 +29,7 @@
Rgba marginColor,
Rgba paddingColor,
bool showInfo}) {
- var params = {'nodeId': nodeId, 'highlightConfig': {}};
+ var params = <String, dynamic>{'nodeId': nodeId, 'highlightConfig': {}};
if (borderColor != null) {
params['highlightConfig']['borderColor'] = borderColor;
@@ -56,7 +56,12 @@
Future highlightRect(int x, int y, int width, int height,
{Rgba color, Rgba outlineColor}) {
- var params = {'x': x, 'y': y, 'width': width, 'height': height};
+ var params = <String, dynamic>{
+ 'x': x,
+ 'y': y,
+ 'width': width,
+ 'height': height
+ };
if (color != null) {
params['color'] = color;
@@ -108,7 +113,7 @@
}
Future<WipRemoteObject> resolveNode(int nodeId, {String objectGroup}) async {
- var params = {'nodeId': nodeId};
+ var params = <String, dynamic>{'nodeId': nodeId};
if (objectGroup != null) {
params['objectGroup'] = objectGroup;
}
diff --git a/lib/webkit_inspection_protocol.dart b/lib/webkit_inspection_protocol.dart
index 6f868b0..fb43151 100644
--- a/lib/webkit_inspection_protocol.dart
+++ b/lib/webkit_inspection_protocol.dart
@@ -19,7 +19,6 @@
import 'dart:io' show HttpClient, HttpClientResponse, WebSocket;
import 'package:logging/logging.dart' show Logger;
-
import 'package:logging/logging.dart';
part 'src/console.dart';