init method

  1. @override
Future<void> init()
override

Initializes any data needed by this model.

Implementation

@override
Future<void> init() async {
  for (final socket in sockets) {
    socket.connectionStatus.addListener(() => socket.connectionStatus.value
      ? onConnect(socket.device)
      : onDisconnect(socket.device),
    );
    socket.messages.listen(models.messages.addMessage);
    await socket.init();
  }
  final level = Logger.level;
  Logger.level = LogLevel.warning;
  await updateSockets();
  Logger.level = level;
}