debugLockDelegate abstract method Null safety

bool debugLockDelegate(
  1. BuildContext context
)

This is called by PlatformMenuBar when it is initialized, to be sure that only one is active at a time.

The debugLockDelegate function should be called before the first call to setMenus.

If the lock is successfully acquired, debugLockDelegate will return true.

If your implementation of a PlatformMenuDelegate can have only limited active instances, enforce it when you override this function.

See also:

Implementation

bool debugLockDelegate(BuildContext context);