insertWithOnConflict method

Future<int> insertWithOnConflict ({@required String table, @required Map<String, dynamic> values, @required int conflictAlgorithm })

General method for inserting a row into the database.

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

Implementation

Future<int> insertWithOnConflict({
  @required final String table,
  @required final Map<String, dynamic> values,
  @required final int conflictAlgorithm,
}) async {
  final Map<String, dynamic> request = <String, dynamic>{
    'id': id,
    'table': table,
    'values': values,
    'conflictAlgorithm': conflictAlgorithm,
  };
  return await _channel.invokeMethod('insertWithOnConflict', request);
}