-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #629 from appwrite/fix-offline-linux
Ensure offline support works in linux
- Loading branch information
Showing
6 changed files
with
54 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import 'package:sembast/sembast.dart'; | ||
|
||
class OfflineDatabase { | ||
static final OfflineDatabase instance = OfflineDatabase._internal(); | ||
|
||
OfflineDatabase._internal(); | ||
|
||
Future<Database> db() async { | ||
throw UnimplementedError(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import 'package:sembast/sembast.dart'; | ||
import 'package:sembast_web/sembast_web.dart'; | ||
|
||
class OfflineDatabase { | ||
static final OfflineDatabase instance = OfflineDatabase._internal(); | ||
Database? _db; | ||
|
||
OfflineDatabase._internal(); | ||
|
||
Future<Database> db() async { | ||
if (_db == null) { | ||
final factory = databaseFactoryWeb; | ||
_db = await factory.openDatabase('{{ spec.title | caseLower }}.db'); | ||
} | ||
return _db!; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters