init static method

Future<void> init()

Implementation

static Future<void> init() async {
  if (_loaded) return;
  try {
    if (!kIsWeb) {
      final dir = Directory.systemTemp;
      _file = File('${dir.path}/.autopilot_store.json');
      if (await _file!.exists()) {
        final raw = await _file!.readAsString();
        _mem = Map<String, dynamic>.from(jsonDecode(raw) as Map);
      }
    }
  } catch (e) {
    AutoPilotLogger.warn('Storage init failed: $e — using memory only');
    _mem = {};
  }
  _loaded = true;
}