/// Web/Chrome stub for [AppDatabase]. /// /// SQLCipher / dart:ffi cannot compile for Flutter Web. Chrome runs use an /// in-tab memory map so UI + API flows still work. Persistence is not encrypted /// and is lost on refresh (web is a preview surface, not the release target). class AppDatabase { AppDatabase({this.encrypted = false}); /// Always false on web — there is no SQLCipher path. final bool encrypted; final Map _kv = {}; List _toneSamples = []; factory AppDatabase.memory() => AppDatabase(encrypted: false); static Future open() async => AppDatabase(encrypted: false); Future> loadToneSamples() async => List.from(_toneSamples); Future replaceToneSamples(List samples) async { _toneSamples = List.from(samples); } Future getKv(String key) async => _kv[key]; Future setKv(String key, String value) async { _kv[key] = value; } Future getBoolKv(String key, {bool defaultValue = false}) async { final v = await getKv(key); if (v == null) return defaultValue; return v == '1' || v.toLowerCase() == 'true'; } Future setBoolKv(String key, bool value) async { await setKv(key, value ? '1' : '0'); } Future close() async {} }