handleCommand method

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) {
  return switch (command.kind) {
    'get_health'                    => _getHealth(command),
    'get_layer_tree'                => _getLayerTree(command),
    'get_render_tree'               => _getRenderTree(command),
    'enter_text'                    => _enterText(command),
    'send_text_input_action'        => _sendTextInputAction(command),
    'get_text'                      => _getText(command, finderFactory),
    'request_data'                  => _requestData(command),
    'scroll'                        => _scroll(command, prober, finderFactory),
    'scrollIntoView'                => _scrollIntoView(command, finderFactory),
    'set_frame_sync'                => _setFrameSync(command),
    'set_semantics'                 => _setSemantics(command),
    'set_text_entry_emulation'      => _setTextEntryEmulation(command),
    'tap'                           => _tap(command, prober, finderFactory),
    'waitFor'                       => _waitFor(command, finderFactory),
    'waitForAbsent'                 => _waitForAbsent(command, finderFactory),
    'waitForTappable'               => _waitForTappable(command, finderFactory),
    'waitForCondition'              => _waitForCondition(command),
    'waitUntilNoTransientCallbacks' => _waitUntilNoTransientCallbacks(command),
    'waitUntilNoPendingFrame'       => _waitUntilNoPendingFrame(command),
    'waitUntilFirstFrameRasterized' => _waitUntilFirstFrameRasterized(command),
    'get_semantics_id'              => _getSemanticsId(command, finderFactory),
    'get_offset'                    => _getOffset(command, finderFactory),
    'get_diagnostics_tree'          => _getDiagnosticsTree(command, finderFactory),
    final String kind => throw DriverError('Unsupported command kind $kind'),
  };

}