store method

Future<void> store(
  1. String key,
  2. Map<String, dynamic> json, {
  3. Duration maxAge = const Duration(hours: 10),
})

Stores the data contained in json under the key specified

maxAge specifies for how long the data should be saved in cache

Implementation

Future<void> store(
  String key,
  Map<String, dynamic> json, {
  Duration maxAge = const Duration(hours: 10),
}) async =>
    _manager.putFile(
      key,
      Uint8List.fromList(utf8.encode(jsonEncode(json))),
      maxAge: maxAge,
    );