binary_map_file 1.8.0 copy "binary_map_file: ^1.8.0" to clipboard
binary_map_file: ^1.8.0 copied to clipboard

Performant key-value file based serialization. Pure Dart, secured support

BinaryMapFile #

Performant key-value store using file system in pure Dart, secured support. More power alternative to shared_preference.


Getting Started #

To get started, simply import the binary_map_file package:

import "dart:io";
import 'package:binary_map_file/binary_map_file.dart';

final file = File(path),
final binaryMapFile = BinaryMapFile(file, secured: false);
await binaryMapFile.ensureInitialized();
// if you want a secured serialization, set the flag secured to `true`

final map = binaryMapFile.map;

Get value #

Get the bool value for key firstRun, if the key is not set or null, then reset the value in map to default value and return gotten value

final firstRun = binaryMapFile.getDefaultValue<bool>('firstRun' , true); //
// or
final value = binaryMapFile.getValue<bool>('firstRun'); // boolean or null

Set value #

binaryMapFile.setValue<bool>('firstRun', false);

Check containing key #

final existed = binaryMapFile.containsKey('firstRun');

Serialize #

Save the current map to file

await binaryMapFile.serialize();

Supported data types #

Support all data types which MessageCodec using the Flutter standard binary encoding.

Supported messages are acyclic values of these forms:

License #

This library is licensed under the MIT License. Feel free to use it and contribute to its development.


Made with ❤️ by Annotium

1
likes
160
points
75
downloads

Publisher

unverified uploader

Weekly Downloads

Performant key-value file based serialization. Pure Dart, secured support

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

crypto, flutter

More

Packages that depend on binary_map_file