query method

Future<List<Map<String, Object?>>> query(
  1. String command
)

Executes the given SQL command and returns a list of maps representing the result set.

The command parameter is the SQL command to be executed. Returns a Future that completes with a list of maps, where each map represents a row in the result set. The keys in the map are column names, and the values are the corresponding column values.

Example usage:

DatabaseService databaseService = DatabaseService();
List<Map<String, Object?>> result = await databaseService.query('SELECT * FROM users');

Implementation

Future<List<Map<String, Object?>>> query(String command) async {
  return await _db.rawQuery(command) as List<Map<String, Object?>>;
}