isMainThread static method

bool isMainThread()

Check if the current thread is the main thread.

Returns

  • True if the current thread is the main thread, false otherwise.

Throws:

  • An exception if it fails.

Implementation

static bool isMainThread() {
  final OperationResult resultString = staticMethod('Debug', 'isMainThread');
  return resultString['result'];
}