update method

  1. @override
Future<JobDone> update(
  1. String boxName,
  2. String key,
  3. dynamic value
)
override

Implementation

@override
Future<JobDone> update(String boxName, String key, dynamic value) async {
  try {
    final box = await openBox(boxName);
    if (!box.containsKey(boxName)) {
      throw const DatabaseBridgeException(error: 'key_not_exist');
    }
    await box.put(key, value);
    return const JobDone();
  } catch (e) {
    throw DatabaseBridgeException(error: e);
  }
}