queryDatabase method

  1. @override
Future<String> queryDatabase(
  1. String query
)
override

Retrieves data from the database using the specified SQL query.

Implementation

@override
Future<String> queryDatabase(String query) async {
  try {
    final result = await methodChannel
        .invokeMethod<List>('queryDatabase', {'query': query});
    return result == null ? "" : "[${result.join(",")}]";
  } catch (e) {
    rethrow;
  }
}