update method
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;
}