updateInstance<T extends Model> static method
Updates instance with partial withJson.
Implementation
static Future<bool> updateInstance<T extends Model>({
required T instance,
required Map<String, dynamic> withJson,
}) async {
final constructor = _jsonConstructors[T];
if (constructor == null) return false;
withJson.remove('uuid');
withJson.remove('id');
withJson.remove('created_at');
final currentJson = _prepareForSave<T>(instance);
currentJson.addAll(withJson);
final updatedInstance = constructor(currentJson) as T;
return await save<T>(updatedInstance);
}