Localization Changes #3

This commit is contained in:
2025-08-19 11:18:25 +05:30
58 changed files with 460 additions and 363 deletions

View File

@@ -3,33 +3,30 @@ import 'package:flutter_secure_storage/flutter_secure_storage.dart';
class SecureStorage {
final FlutterSecureStorage _storage;
SecureStorage(): _storage = const FlutterSecureStorage();
SecureStorage() : _storage = const FlutterSecureStorage();
Future<void> write(String key, dynamic value) async {
final stringValue = value is String
? value
: json.encode(value);
final stringValue = value is String ? value : json.encode(value);
await _storage.write(key: key, value: stringValue);
}
Future<dynamic> read(String key) async {
final value = await _storage.read(key: key);
if (value == null) return null;
try {
return json.decode(value);
} catch (_) {
return value;
}
}
Future<void> delete(String key) async {
await _storage.delete(key: key);
}
Future<void> deleteAll() async {
await _storage.deleteAll();
}
}
}