diff --git a/floor/lib/src/sqflite_database_factory.dart b/floor/lib/src/sqflite_database_factory.dart index 65aa0614..dc7d02b1 100644 --- a/floor/lib/src/sqflite_database_factory.dart +++ b/floor/lib/src/sqflite_database_factory.dart @@ -19,7 +19,15 @@ final DatabaseFactory sqfliteDatabaseFactory = () { extension DatabaseFactoryExtension on DatabaseFactory { Future getDatabasePath(final String name) async { - final databasesPath = await this.getDatabasesPath(); - return join(databasesPath, name); + late String databasesPath; + + final file = File(name); + if (file.isAbsolute) { + databasesPath = file.path; + } else { + databasesPath = join(await this.getDatabasesPath(), name); + } + + return databasesPath; } }