destroyInstance method

Future<void> destroyInstance()

Destroys the native instance and frees any resources associated with it.

Also removes any listeners associated with this instance.

Implementation

Future<void> destroyInstance() async {
  await _methodChannel.invokeMethod('destroyInstance', {
    'instanceId': instanceId,
  });
  removeListeners();
}