Skip to content

Instantly share code, notes, and snippets.

@RyanDsilva
Created June 26, 2022 09:17
Show Gist options
  • Save RyanDsilva/a1968aaeac2b00d9330f7e156d754aeb to your computer and use it in GitHub Desktop.
Save RyanDsilva/a1968aaeac2b00d9330f7e156d754aeb to your computer and use it in GitHub Desktop.
Using Secure Storage
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
Future<void> secureStorageActions() async {
// Create storage
const storage = FlutterSecureStorage();
// Read value
String? value = await storage.read(key: 'key');
// Read all values
Map<String, String> allValues = await storage.readAll();
// Delete value
await storage.delete(key: 'key');
// Delete all
await storage.deleteAll();
// Write value
await storage.write(key: 'key', value: 'value');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment