update<T extends TableBase> method

Future<int?> update<T extends TableBase>(
  1. T obj
)

Implementation

Future<int?> update<T extends TableBase>(T obj) async {
  try {
    /// Leave it in this format for Throw to stay in this catch
    final res = await updateOrThrow(obj);
    return res;
  } catch (error, stackTrace) {
    obj.saveResult = BoolResult(
        success: false,
        errorMessage:
            '$_tableName-> Save failed. Error: ${error.toString()}');
    _dbModel?.logFunction?.call(Log(
        msg: '$_tableName -> Save failed. Error: ${error.toString()}',
        error: error,
        stackTrace: stackTrace));
    return null;
  }
}