detachInstance static method

void detachInstance(
  1. BluetoothRfcommPlatform platform
)

Detaches platform from the shared instance slot if it currently occupies it, so the next instance read builds a fresh backend instead of handing out a disposed one. Platform implementations call this from their dispose(); a no-op when platform is not the shared instance.

Implementation

static void detachInstance(BluetoothRfcommPlatform platform) {
  if (identical(_instance, platform)) _instance = null;
}