From 124d32274be89c1f50774375c4bc4bd49eec11a2 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Wed, 16 Feb 2022 16:55:41 -0800 Subject: [PATCH] enable the avoid_dynamic_calls lint --- CHANGELOG.md | 1 + analysis_options.yaml | 1 + test/chrome_test.dart | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a339c8..d428a71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ - Add optional `signIn` argument to `startWithDebugPort`. To be used together with `user-data-dir` to start a chrome window signed into the default profile with extensions enabled. +- Enable the `avoid_dynamic_calls` lint. ## 1.0.0 diff --git a/analysis_options.yaml b/analysis_options.yaml index b191605..87eecf1 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -7,6 +7,7 @@ analyzer: linter: rules: - always_declare_return_types + - avoid_dynamic_calls - avoid_unused_constructor_parameters - cancel_subscriptions - directives_ordering diff --git a/test/chrome_test.dart b/test/chrome_test.dart index 0c098a2..be87d53 100644 --- a/test/chrome_test.dart +++ b/test/chrome_test.dart @@ -138,7 +138,8 @@ Future _evaluateExpression(WipPage page, String expression) async { 'Runtime.evaluate', params: {'expression': expression}, ); - var value = wipResponse.json['result']['result']['value']; + var response = wipResponse.json['result'] as Map; + var value = (response['result'] as Map)['value']; result = (value != null && value is String) ? value : ''; } return result;