saveData<T> method
- String key,
- T value
Implementation
Future<void> saveData<T>(String key, T value) async {
if (value is String) {
await _secureStorage.write(key: key, value: value);
} else if (value is int || value is double || value is bool) {
await _secureStorage.write(key: key, value: value.toString());
} else {
throw Exception('Unsupported type');
}
}