call method Null safety

Object? call(
  1. [List<Object>? args,
  2. Map<Symbol, Object>? namedArgs]

Dynamically call this Throttle with the specified arguments.

Acts the same as calling func with positional arguments corresponding to the elements of args and named arguments corresponding to the elements of namedArgs.

This includes giving the same errors if func isn't callable or if it expects different parameters.


List<Movie> fetchMovies(
   String movieName, {
   bool adult = false,
 }) async {
   final data = api.getData(query);

final throttledFetchMovies = Throttle(
  const Duration(milliseconds: 350),

throttledFetchMovies(['tenet'], {#adult: true});

gives exactly the same result as

fetchMovies('tenet', adult: true).


Object? call([List<Object>? args, Map<Symbol, Object>? namedArgs]) =>, namedArgs);