Closed
Description
return driver
.findElements(buttonsSelector)
.asyncMap((WebElement e) async => {'button': e, 'text': await e.text})
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.where((Map m) => m['text'] == text)
.map((Map m) => m['button'])
.first as WebElement;
Warning:(589, 17) (WebElement e) async => {'button' : e, 'text' : await e.text} ((WebElement) → Future<Map<dynamic, dynamic>>) will need runtime check to cast to type (WebElement) → dynamic
I don't get this warning here
final List<WebElement> cells =
await (await driver
.findElements(firstColumnSelector)
.asyncMap(
(WebElement e) async => {'element': e, 'text': await e.text})
.where((Map item) => item['text'] == taskTitle))
.map((Map item) => item['element'])
.toList() as List<WebElement>;
strong-mode is enabled
I think either the first shouldn't produce a warning or the second should.
If the warning is correct, is a typedef the only way to silence this?