spawnIsolate static method

Future<Isolate> spawnIsolate(
  1. FutureOr<void> entryPoint(
    1. SendPort sendPort
    )
)

Implementation

static Future<Isolate> spawnIsolate(FutureOr<void> Function(SendPort sendPort) entryPoint) async {
   final receivePort = ReceivePort();
   final isolate = await Isolate.spawn(entryPoint, receivePort.sendPort);
   return isolate;
 }