dispose method

Future<void> dispose ()

Disposes the Android view.

The AndroidViewController object is unusable after calling this. The identifier of the platform view cannot be reused after the view is disposed.

Implementation

Future<void> dispose() async {
  if (_state == _AndroidViewState.creating || _state == _AndroidViewState.created)
    await SystemChannels.platform_views.invokeMethod('dispose', id);
  _state = _AndroidViewState.disposed;
}