execute method

  1. @override
Future<TResponse> execute(
  1. Future<DynamicMap?> callback(
    1. DynamicMap? map
    )
)
override

The value is actually passed to the server side for execution.

実際にサーバー側に値を渡して実行します。

Implementation

@override
Future<TResponse> execute(
  Future<DynamicMap?> Function(DynamicMap? map) callback,
) async {
  final input = toMap();
  final res = await callback.call({
    "mode": mode,
    if (input != null) ...input,
  });
  if (res == null) {
    return throw Exception("Response is empty.");
  }
  return toResponse(res);
}