Compare commits
1 commit
main
...
krille/sem
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5cff79c7bd |
4 changed files with 48 additions and 8 deletions
|
|
@ -3,6 +3,7 @@ import 'dart:convert';
|
||||||
import 'package:flutter/foundation.dart';
|
import 'package:flutter/foundation.dart';
|
||||||
|
|
||||||
import 'package:hive_flutter/hive_flutter.dart';
|
import 'package:hive_flutter/hive_flutter.dart';
|
||||||
|
import 'package:idb_shim/idb_io.dart';
|
||||||
import 'package:matrix/encryption/utils/key_verification.dart';
|
import 'package:matrix/encryption/utils/key_verification.dart';
|
||||||
import 'package:matrix/matrix.dart';
|
import 'package:matrix/matrix.dart';
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
|
@ -109,7 +110,18 @@ abstract class ClientManager {
|
||||||
EventTypes.RoomPowerLevels,
|
EventTypes.RoomPowerLevels,
|
||||||
},
|
},
|
||||||
logLevel: kReleaseMode ? Level.warning : Level.verbose,
|
logLevel: kReleaseMode ? Level.warning : Level.verbose,
|
||||||
databaseBuilder: FlutterHiveCollectionsDatabase.databaseBuilder,
|
databaseBuilder: (client) async {
|
||||||
|
final path =
|
||||||
|
await FlutterHiveCollectionsDatabase.findDatabasePath(client);
|
||||||
|
Logs().v('Store data at:', path);
|
||||||
|
final db = EasyIdbDatabase(
|
||||||
|
'database_${client.clientName.replaceAll(' ', '_').toLowerCase()}',
|
||||||
|
factory: getIdbFactoryPersistent(path),
|
||||||
|
);
|
||||||
|
await db.open();
|
||||||
|
return db;
|
||||||
|
},
|
||||||
|
legacyDatabaseBuilder: FlutterHiveCollectionsDatabase.databaseBuilder,
|
||||||
supportedLoginTypes: {
|
supportedLoginTypes: {
|
||||||
AuthenticationTypes.password,
|
AuthenticationTypes.password,
|
||||||
AuthenticationTypes.sso,
|
AuthenticationTypes.sso,
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ class FlutterHiveCollectionsDatabase extends HiveCollectionsDatabase {
|
||||||
|
|
||||||
final db = FlutterHiveCollectionsDatabase(
|
final db = FlutterHiveCollectionsDatabase(
|
||||||
'hive_collections_${client.clientName.replaceAll(' ', '_').toLowerCase()}',
|
'hive_collections_${client.clientName.replaceAll(' ', '_').toLowerCase()}',
|
||||||
await _findDatabasePath(client),
|
await findDatabasePath(client),
|
||||||
key: hiverCipher,
|
key: hiverCipher,
|
||||||
);
|
);
|
||||||
try {
|
try {
|
||||||
|
|
@ -79,7 +79,7 @@ class FlutterHiveCollectionsDatabase extends HiveCollectionsDatabase {
|
||||||
return db;
|
return db;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Future<String> _findDatabasePath(Client client) async {
|
static Future<String> findDatabasePath(Client client) async {
|
||||||
String path = client.clientName;
|
String path = client.clientName;
|
||||||
if (!kIsWeb) {
|
if (!kIsWeb) {
|
||||||
Directory directory;
|
Directory directory;
|
||||||
|
|
|
||||||
35
pubspec.lock
35
pubspec.lock
|
|
@ -345,6 +345,14 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.6.2"
|
version: "1.6.2"
|
||||||
|
easy_idb:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: easy_idb
|
||||||
|
sha256: "06c3e834f2d42cc20d78caf44441b3125767961d7687f58b56385ee8f7fcbd61"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.0.0"
|
||||||
emoji_picker_flutter:
|
emoji_picker_flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
@ -858,6 +866,14 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "4.0.2"
|
version: "4.0.2"
|
||||||
|
idb_shim:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: idb_shim
|
||||||
|
sha256: "3ac9d6a90c29e2192d35c8386d7b20cb3865756f5b299d74a829d5b888776d26"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.3.0+2"
|
||||||
image:
|
image:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -1059,11 +1075,12 @@ packages:
|
||||||
matrix:
|
matrix:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: matrix
|
path: "."
|
||||||
sha256: "2b07709bce975d2be4dc4cd3cc1196fcd6c0397d4e250b42a498e35523fc28f3"
|
ref: "krille/easy_idb_database"
|
||||||
url: "https://pub.dev"
|
resolved-ref: "44c9a17961c46e6c1e8f9367fa210cea4953cadb"
|
||||||
source: hosted
|
url: "https://gitlab.com/famedly/company/frontend/famedlysdk.git"
|
||||||
version: "0.20.1"
|
source: git
|
||||||
|
version: "0.18.3"
|
||||||
matrix_api_lite:
|
matrix_api_lite:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -1576,6 +1593,14 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.3.2"
|
version: "0.3.2"
|
||||||
|
sembast:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: sembast
|
||||||
|
sha256: "24829715d11c2c437e67b413f29ff91b5325daa9632f851d44deeea7a29bde9e"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.4.3+1"
|
||||||
sentiment_dart:
|
sentiment_dart:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,7 @@ dependencies:
|
||||||
hive: ^2.2.3
|
hive: ^2.2.3
|
||||||
hive_flutter: ^1.1.0
|
hive_flutter: ^1.1.0
|
||||||
http: ^0.13.4
|
http: ^0.13.4
|
||||||
|
idb_shim: ^2.3.0+2
|
||||||
image_picker: ^0.8.4+8
|
image_picker: ^0.8.4+8
|
||||||
intl: any
|
intl: any
|
||||||
just_audio: ^0.9.30
|
just_audio: ^0.9.30
|
||||||
|
|
@ -166,3 +167,5 @@ dependency_overrides:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/TheOneWithTheBraid/keyboard_shortcuts.git
|
url: https://github.com/TheOneWithTheBraid/keyboard_shortcuts.git
|
||||||
ref: null-safety
|
ref: null-safety
|
||||||
|
matrix:
|
||||||
|
path: ../famedlysdk/
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue