set method
Implementation
@override
Future<void> set(String key, value) async {
assert(value != null);
final box = await _box.future;
if (_isPrimitive(value)) {
return box.put(key, value);
} else if (_isSerializable(value)) {
return box.put(key, value.toJson());
} else {
throw 'value should either be of primitive type or have a toJson() function';
}
}