https://github.com/icapps/flutter_secure_file_storage
https://github.com/icapps/flutter_secure_file_storage
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/icapps/flutter_secure_file_storage
- Owner: icapps
- License: mit
- Created: 2021-12-15T15:12:11.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2025-04-08T11:40:50.000Z (about 1 year ago)
- Last Synced: 2025-04-08T12:35:04.115Z (about 1 year ago)
- Language: Dart
- Size: 176 KB
- Stars: 8
- Watchers: 6
- Forks: 6
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Flutter secure file storage
[](https://pub.dartlang.org/packages/flutter_secure_file_storage)
An implementation for flutter secure file storage. For example keychain has a soft limit of 4kb. Using the file system instead we can store much larger content.
AES/GCM/NoPadding encryption is used to encrypt the data. The keys are generated using `Random.secure`and stored using the [flutter_secure_storage](https://pub.dev/packages/flutter_secure_storage) package, the values are encrypted by the [pointycastle](https://pub.dev/packages/pointycastle) package or native for Android
## Usage
It's implemented to use the same structure as FlutterSecureStorage and therefore you can switch easily between them. But we also support Uint8List as input/output
```dart
import 'package:flutter_secure_file_storage/flutter_secure_file_storage.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
// Create storage
final storage = FlutterSecureFileStorage(FlutterSecureStorage());
// Read value
final value = await storage.read(key: key);
// Read all values
Map 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);
```
### Configure Android version
In [project]/android/app/build.gradle set minSdkVersion to >= 18.
```
android {
...
defaultConfig {
...
minSdkVersion 18
...
}
}
```