set method

Future<void> set(
  1. String itemName,
  2. T value
)

Implementation

Future<void> set(String itemName, T value) async {
  final directory = await _localDirectory;

  final file = File('${directory.path}/$itemName');

  final bytes = serialize(value);
  await file.writeAsBytes(bytes, flush: true);
}