onGenerate<T> method

void onGenerate<T>(
  1. FutureOr<T> handler(
    1. GeneratorOptions options
    )
)

Implementation

void onGenerate<T>(
  FutureOr<T> Function(GeneratorOptions options) handler,
) {
  server.registerMethod('generate', (Parameters params) async {
    final options = GeneratorOptions.fromJson(params.asMap);
    final result = await handler(options);

    return result;
  });
}