Line data Source code
1 : import 'dart:async';
2 :
3 : typedef ComputeCallback = Future<R> Function<Q, R>(
4 : FutureOr<R> Function(Q message) callback,
5 : Q message, {
6 : String? debugLabel,
7 : });
8 :
9 : // keep types in sync with [computeCallbackFromRunInBackground]
10 : typedef ComputeRunner = Future<T> Function<T, U>(
11 : FutureOr<T> Function(U arg) function,
12 : U arg,
13 : );
14 :
15 0 : ComputeCallback computeCallbackFromRunInBackground(ComputeRunner runner) {
16 0 : return <U, T>(
17 : FutureOr<T> Function(U arg) callback,
18 : U arg, {
19 : String? debugLabel,
20 : }) =>
21 0 : runner.call(callback, arg);
22 : }
|