Channels and platform threading

When invoking channels on the platform side destined for Flutter,
invoke them on the platform’s main thread.
When invoking channels in Flutter destined for the platform side,
either invoke them from any Isolate that is the root
Isolate, or that is registered as a background Isolate.
The handlers for the platform side can execute on the platform’s main thread
or they can execute on a background thread if using a Task Queue.
You can invoke the platform side handlers asynchronously
and on any thread when the Task Queue API is available;
otherwise, they must be invoked on the platform thread.

Note:
  On Android, the platform’s main thread is sometimes
  called the “main thread”, but it is technically defined
  as the UI thread. Annotate methods that need
  to be run on the UI thread with @UiThread.
  On iOS, this thread is officially
  referred to as the main thread.

Using plugins and channels from background isolates