setIsolateDebugName method Null safety

void setIsolateDebugName(
  1. String name
)

Set the debug name associated with this platform dispatcher's root isolate.

Accessing this value returns the value contained in the PlatformDispatcher singleton, so instead of getting it from here, you should consider getting it from WidgetsBinding.instance.platformDispatcher instead (or, when WidgetsBinding isn't available, from PlatformDispatcher.instance). The reason this value forwards to the PlatformDispatcher is to provide convenience for applications that only use a single main window.

Normally debug names are automatically generated from the Dart port, entry point, and source file. For example: main.dart$main-1234.

This can be combined with flutter tools --isolate-filter flag to debug specific root isolates. For example: flutter attach --isolate-filter=[name]. Note that this does not rename any child isolates of the root.

Implementation

void setIsolateDebugName(String name) => PlatformDispatcher.instance.setIsolateDebugName(name);