toMapOrBool static method

dynamic toMapOrBool(
  1. ElementInteractions elementInteractions
)

Implementation

static dynamic toMapOrBool(ElementInteractions elementInteractions) {
  return switch (elementInteractions) {
    ElementInteractionsOptions() => elementInteractions.toMap(),
    // Serialize as the default options map (not a bare `true`) so the
    // Flutter-aware cssSelectorAllowlist is applied. A bare `true` would keep
    // the Browser SDK's tag-based default, which never matches Flutter's
    // semantic-role nodes, so "enabled" clicks would capture nothing on web.
    ElementInteractionsEnabled() => const ElementInteractionsOptions().toMap(),
    ElementInteractionsDisabled() => false,
    Type() => throw UnimplementedError(),
  };
}