handleCommand method Null safety

Future<Result> handleCommand(
  1. Command command,
  2. WidgetController prober,
  3. CreateFinderFactory finderFactory
)

Deserializes the finder from JSON generated by Command.serialize or CommandWithTarget.serialize.

Implementation

Future<Result> handleCommand(Command command, WidgetController prober, CreateFinderFactory finderFactory) {
  switch(command.kind) {
    case 'get_health': return _getHealth(command);
    case 'get_layer_tree': return _getLayerTree(command);
    case 'get_render_tree': return _getRenderTree(command);
    case 'enter_text': return _enterText(command);
    case 'get_text': return _getText(command, finderFactory);
    case 'request_data': return _requestData(command);
    case 'scroll': return _scroll(command, prober, finderFactory);
    case 'scrollIntoView': return _scrollIntoView(command, finderFactory);
    case 'set_frame_sync': return _setFrameSync(command);
    case 'set_semantics': return _setSemantics(command);
    case 'set_text_entry_emulation': return _setTextEntryEmulation(command);
    case 'tap': return _tap(command, prober, finderFactory);
    case 'waitFor': return _waitFor(command, finderFactory);
    case 'waitForAbsent': return _waitForAbsent(command, finderFactory);
    case 'waitForTappable': return _waitForTappable(command, finderFactory);
    case 'waitForCondition': return _waitForCondition(command);
    case 'waitUntilNoTransientCallbacks': return _waitUntilNoTransientCallbacks(command);
    case 'waitUntilNoPendingFrame': return _waitUntilNoPendingFrame(command);
    case 'waitUntilFirstFrameRasterized': return _waitUntilFirstFrameRasterized(command);
    case 'get_semantics_id': return _getSemanticsId(command, finderFactory);
    case 'get_offset': return _getOffset(command, finderFactory);
    case 'get_diagnostics_tree': return _getDiagnosticsTree(command, finderFactory);
  }

  throw DriverError('Unsupported command kind ${command.kind}');
}