convertFunctionFromSyncToAsync abstract method

void convertFunctionFromSyncToAsync({
  1. required FunctionBody body,
  2. required TypeSystem typeSystem,
  3. required TypeProvider typeProvider,
})

Creates one or more edits that will convert the given function body from being synchronous to be asynchronous. This includes adding the async modifier to the body as well as potentially replacing the return type of the function to Future.

There is currently a limitation in that the function body must not be a generator.

Throws an ArgumentError if the function body is not both synchronous and a non-generator.

Implementation

void convertFunctionFromSyncToAsync({
  required FunctionBody body,
  required TypeSystem typeSystem,
  required TypeProvider typeProvider,
});