getRules method

Future<List<Rule>> getRules(
  1. String eventName,
  2. int webViewInstanceId,
  3. List<String>? ruleIdentifiers
)

Returns currently registered rules. eventName Name of the event this function affects. webViewInstanceId If provided, this is an integer that uniquely identfies the

Implementation

Future<List<Rule>> getRules(
  String eventName,
  int webViewInstanceId,
  List<String>? ruleIdentifiers,
) {
  var $completer = Completer<List<Rule>>();
  _wrapped.getRules(
    eventName,
    webViewInstanceId,
    ruleIdentifiers?.toJSArray((e) => e),
    (JSArray rules) {
      if (checkRuntimeLastError($completer)) {
        $completer.complete(rules.toDart
            .cast<$js.Rule>()
            .map((e) => Rule.fromJS(e))
            .toList());
      }
    }.toJS,
  );
  return $completer.future;
}