From fae7fcce80c95cad8493101c374cac18e13e2e0b Mon Sep 17 00:00:00 2001 From: Dillon Nys Date: Wed, 6 Mar 2024 22:45:25 -0800 Subject: [PATCH] avoid wrapper class --- .../secure_storage_platform.web.dart | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/packages/celest_core/lib/src/secure_storage/secure_storage_platform.web.dart b/packages/celest_core/lib/src/secure_storage/secure_storage_platform.web.dart index 88060ed4..821de141 100644 --- a/packages/celest_core/lib/src/secure_storage/secure_storage_platform.web.dart +++ b/packages/celest_core/lib/src/secure_storage/secure_storage_platform.web.dart @@ -1,23 +1,9 @@ import 'package:celest_core/src/secure_storage/secure_storage.dart'; -final class SecureStoragePlatform implements SecureStorage { - SecureStoragePlatform({ - String? scope, - }) : _impl = MemorySecureStorage(scope: scope ?? _defaultScope); - - final SecureStorage _impl; +extension type SecureStoragePlatform._(SecureStorage _impl) + implements SecureStorage { + SecureStoragePlatform({String? scope}) + : _impl = MemorySecureStorage(scope: scope ?? _defaultScope); static const _defaultScope = 'dev.celest.celest'; - - @override - void clear() => _impl.clear(); - - @override - String? delete(String key) => _impl.delete(key); - - @override - String? read(String key) => _impl.read(key); - - @override - String write(String key, String value) => _impl.write(key, value); }