import 'package:flutter_secure_storage/flutter_secure_storage.dart'; abstract class FlutterSecureStorageInterface { Future write({ required String key, required String? value, IOSOptions? iOptions, AndroidOptions? aOptions, LinuxOptions? lOptions, WebOptions? webOptions, MacOsOptions? mOptions, WindowsOptions? wOptions, }); Future read({ required String key, IOSOptions? iOptions, AndroidOptions? aOptions, LinuxOptions? lOptions, WebOptions? webOptions, MacOsOptions? mOptions, WindowsOptions? wOptions, }); Future delete({ required String key, IOSOptions? iOptions, AndroidOptions? aOptions, LinuxOptions? lOptions, WebOptions? webOptions, MacOsOptions? mOptions, WindowsOptions? wOptions, }); } class SecureStorageWrapper implements FlutterSecureStorageInterface { final FlutterSecureStorage secureStore; const SecureStorageWrapper(this.secureStore); @override Future read({ required String key, IOSOptions? iOptions, AndroidOptions? aOptions, LinuxOptions? lOptions, WebOptions? webOptions, MacOsOptions? mOptions, WindowsOptions? wOptions, }) { return secureStore.read( key: key, iOptions: iOptions, aOptions: aOptions, lOptions: lOptions, webOptions: webOptions, mOptions: mOptions, wOptions: wOptions, ); } @override Future write({ required String key, required String? value, IOSOptions? iOptions, AndroidOptions? aOptions, LinuxOptions? lOptions, WebOptions? webOptions, MacOsOptions? mOptions, WindowsOptions? wOptions, }) { return secureStore.write( key: key, value: value, iOptions: iOptions, aOptions: aOptions, lOptions: lOptions, webOptions: webOptions, mOptions: mOptions, wOptions: wOptions, ); } @override Future delete({ required String key, IOSOptions? iOptions, AndroidOptions? aOptions, LinuxOptions? lOptions, WebOptions? webOptions, MacOsOptions? mOptions, WindowsOptions? wOptions, }) async { await secureStore.delete( key: key, iOptions: iOptions, aOptions: aOptions, lOptions: lOptions, webOptions: webOptions, mOptions: mOptions, wOptions: wOptions, ); } } // Mock class for testing purposes class FakeSecureStorage implements FlutterSecureStorageInterface { final Map _store = {}; int _interactions = 0; int get interactions => _interactions; int _writes = 0; int get writes => _writes; int _reads = 0; int get reads => _reads; int _deletes = 0; int get deletes => _deletes; @override Future read({ required String key, IOSOptions? iOptions, AndroidOptions? aOptions, LinuxOptions? lOptions, WebOptions? webOptions, MacOsOptions? mOptions, WindowsOptions? wOptions, }) async { _interactions++; _reads++; return _store[key]; } @override Future write({ required String key, required String? value, IOSOptions? iOptions, AndroidOptions? aOptions, LinuxOptions? lOptions, WebOptions? webOptions, MacOsOptions? mOptions, WindowsOptions? wOptions, }) async { _interactions++; _writes++; _store[key] = value; } @override Future delete({ required String key, IOSOptions? iOptions, AndroidOptions? aOptions, LinuxOptions? lOptions, WebOptions? webOptions, MacOsOptions? mOptions, WindowsOptions? wOptions, }) async { _interactions++; _deletes++; _store.remove(key); } }