onInit method
Called immediately after the widget is allocated in memory. You might use this to initialize something for the controller.
Implementation
@override
void onInit() {
super.onInit();
// Forzar landscape
SystemChrome.setPreferredOrientations([
DeviceOrientation.landscapeLeft,
DeviceOrientation.landscapeRight,
]);
// Fullscreen inmersivo
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersiveSticky);
// Inicializar engines
flockingEngine = NeomFlockingEngine();
// Recibir el painter engine del generador (para sincronización de audio)
if (Sint.arguments != null && Sint.arguments is NeomFrequencyPainterEngine) {
painterEngine = Sint.arguments;
} else if (Sint.isRegistered<NeomFrequencyPainterEngine>()) {
painterEngine = Sint.find<NeomFrequencyPainterEngine>();
}
}