Skip to content
This repository was archived by the owner on Oct 28, 2024. It is now read-only.

Commit 0890323

Browse files
authored
enable the avoid_dynamic_calls lint (#30)
1 parent 8b1dbdb commit 0890323

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
- Add optional `signIn` argument to `startWithDebugPort`.
44
To be used together with `user-data-dir` to start a chrome
55
window signed into the default profile with extensions enabled.
6+
- Enable the `avoid_dynamic_calls` lint.
67

78
## 1.0.0
89

analysis_options.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ analyzer:
77
linter:
88
rules:
99
- always_declare_return_types
10+
- avoid_dynamic_calls
1011
- avoid_unused_constructor_parameters
1112
- cancel_subscriptions
1213
- directives_ordering

test/chrome_test.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ Future<String> _evaluateExpression(WipPage page, String expression) async {
138138
'Runtime.evaluate',
139139
params: {'expression': expression},
140140
);
141-
var value = wipResponse.json['result']['result']['value'];
141+
var response = wipResponse.json['result'] as Map<String, dynamic>;
142+
var value = (response['result'] as Map<String, dynamic>)['value'];
142143
result = (value != null && value is String) ? value : '';
143144
}
144145
return result;

0 commit comments

Comments
 (0)