writeIfNull method

Future<void> writeIfNull(
  1. String key,
  2. dynamic value
)

Write data on your only if data is null

Implementation

Future<void> writeIfNull(String key, dynamic value) async {
  if (read(key) != null) return;
  return write(key, value);
}