updateWithOnConflict method

Future<int> updateWithOnConflict ({@required String table, @required Map<String, dynamic> values, String where, List<String> whereArgs, @required int conflictAlgorithm })

Convenience method for updating rows in the database.

See: https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase#updateWithOnConflict(java.lang.String,%20android.content.ContentValues,%20java.lang.String,%20java.lang.String[],%20int)

Implementation

Future<int> updateWithOnConflict({
  @required final String table,
  @required final Map<String, dynamic> values,
  final String where,
  final List<String> whereArgs,
  @required final int conflictAlgorithm,
}) async {
  final Map<String, dynamic> request = <String, dynamic>{
    'id': id,
    'table': table,
    'values': values,
    'whereClause': where, // note the name mapping
    'whereArgs': whereArgs,
    'conflictAlgorithm': conflictAlgorithm,
  };
  return await _channel.invokeMethod('updateWithOnConflict', request);
}