query method
Query data from the database
Implementation
@override
Future<List<Map<String, dynamic>>> query(
String table, {
String? where,
List<dynamic>? whereArgs,
String? orderBy,
int? limit,
int? offset,
}) async {
final List? result = await methodChannel.invokeMethod<List>('query', {
'table': table,
'where': where,
'whereArgs': whereArgs,
'orderBy': orderBy,
'limit': limit,
'offset': offset,
});
// Convert List<dynamic> to List<Map<String, dynamic>>
return result?.map((item) => Map<String, dynamic>.from(item as Map)).toList() ?? [];
}