initializeController method

void initializeController(
  1. ZenController controller
)

Implementation

void initializeController(ZenController controller) {
  try {
    if (!controller.isInitialized) {
      controller.onInit();

      // Schedule onReady to be called after the current frame
      WidgetsBinding.instance.addPostFrameCallback((_) {
        if (!controller.isDisposed) {
          controller.onReady();
        }
      });
    }
  } catch (e, stack) {
    ZenLogger.logError(
        'Error initializing controller ${controller.runtimeType}', e, stack);
  }
}