replaceOrThrow method

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

Convenience method for replacing a row in the database.

Inserts a new row if a row does not already exist.

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

Implementation

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