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