query method

  1. @override
Future<List<Map<String, dynamic>>> query(
  1. String table, {
  2. String? where,
  3. List? whereArgs,
  4. String? orderBy,
  5. int? limit,
  6. int? offset,
})
override

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() ?? [];
}