insert method
Insert data into the database
Implementation
@override
Future<int> insert(String table, Map<String, dynamic> data) async {
final result = await methodChannel.invokeMethod('insert', {
'table': table,
'data': data,
});
// 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;
}