beforeCallback method

dynamic beforeCallback()

Implementation

beforeCallback() {
  return FutureBuilder(
    future: firstTimeBeforeCall,
    builder: (BuildContext context, AsyncSnapshot<RoutePageInfo> snapshot) {
      appRoutePath.loadingHook.set(snapshot.connectionState == ConnectionState.done);
      if (snapshot.connectionState == ConnectionState.done) {
        replaceCurrentPageInfo = snapshot.data;
        return build2(context);
      } else {
        _callBeforeCount++;
        if (_callBeforeCount < 2) {
          return appRoutePath.initLoadingPage;
        } else {
          return Navigator(
            key: navigatorKey,
            pages: pageTrack,
            onPopPage: handlePopPage,
          );
        }
      }
    },
  );
}