tap method

Future<void> tap(
  1. String elementId
)

Taps the row, grid item or button with elementId on the alert, if one is shown, or else on the top screen. Completes when the app's callback has finished.

Implementation

Future<void> tap(String elementId) async {
  final shownAlert = alert;
  if (shownAlert != null) {
    alert = null;
    return _send(
        'select', {'templateId': shownAlert['id'], 'elementId': elementId});
  }
  if (screens.isEmpty) throw StateError('The car shows no screen.');
  await _send(
      'select', {'templateId': screens.last['id'], 'elementId': elementId});
}