update method

  1. @override
Future<int> update(
  1. String table,
  2. Map<String, dynamic> data, {
  3. String? where,
  4. List? whereArgs,
})
override

Update data in the database

Implementation

@override
Future<int> update(
  String table,
  Map<String, dynamic> data, {
  String? where,
  List<dynamic>? whereArgs,
}) async {
  final result = await methodChannel.invokeMethod('update', {
    'table': table,
    'data': data,
    'where': where,
    'whereArgs': whereArgs,
  });
  // Handle both int and long types that might come from Android
  if (result is int) {
    return result;
  } else if (result is num) {
    return result.toInt();
  }
  return 0;
}