openDatabase method

Future<SQLiteDatabase> openDatabase (String path, { String password, int flags: OPEN_READWRITE })

Open the database according to the specified parameters.

See: https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase#openDatabase(java.lang.String,%20android.database.sqlite.SQLiteDatabase.CursorFactory,%20int)

Implementation

static Future<SQLiteDatabase> openDatabase(final String path,
    {String password, int flags = OPEN_READWRITE}) async {
  try {
    final Map<String, dynamic> request = <String, dynamic>{
      'path': path,
      'password': password,
      'flags': flags
    };
    final int id = await _channel.invokeMethod('openDatabase', request);
    return _SQLiteDatabase(id);
  } on PlatformException catch (error) {
    throw error; // TODO: improve error handling
  }
}