initializeController method
Initialize a controller with lifecycle hooks
Implementation
void initializeController(ZenController controller) {
try {
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);
}
}