setNavigatorKey method

void setNavigatorKey(
  1. GlobalKey<NavigatorState> navigatorKey
)

we need a context object, to push/pop page when receive invitation request so we need navigatorKey to get context

Implementation

void setNavigatorKey(GlobalKey<NavigatorState> navigatorKey) {
  ZegoLoggerService.logInfo(
    'setNavigatorKey, '
    'isInit:${private._isInit},'
    'navigatorKey:$navigatorKey',
    tag: 'call',
    subTag: 'call invitation service(${identityHashCode(this)})',
  );

  if (private._isInit) {
    private._data?.contextQuery = () {
      return navigatorKey.currentState!.context;
    };
  } else {
    private._contextQuery = () {
      return navigatorKey.currentState!.context;
    };
  }
}