takeScreenshot method Null safety

  1. @override
Future<Map<String, dynamic>> takeScreenshot(
  1. String screenshotName
)
override

Takes screenshot using WebDriver screenshot command.

Only works on Web when tests are run via flutter driver command.

See: https://www.w3.org/TR/webdriver/#screen-capture.

Implementation

@override
Future<Map<String, dynamic>> takeScreenshot(String screenshotName) async {
  await _sendWebDriverCommand(WebDriverCommand.screenshot(screenshotName));
  // Flutter Web doesn't provide the bytes.
  return const <String, dynamic>{'bytes': <int>[]};
}