build: Update matrix dart sdk
This commit is contained in:
parent
1f12b72271
commit
d2f12452fc
7 changed files with 21 additions and 21 deletions
|
|
@ -74,7 +74,7 @@ class HomeserverPickerController extends State<HomeserverPicker> {
|
||||||
if (homeserverController.text == _lastCheckedUrl) return;
|
if (homeserverController.text == _lastCheckedUrl) return;
|
||||||
_lastCheckedUrl = homeserverController.text;
|
_lastCheckedUrl = homeserverController.text;
|
||||||
setState(() {
|
setState(() {
|
||||||
error = _rawLoginTypes = loginHomeserverSummary = null;
|
error = _rawLoginTypes = loginFlows = null;
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -84,7 +84,8 @@ class HomeserverPickerController extends State<HomeserverPicker> {
|
||||||
homeserver = Uri.https(homeserverController.text, '');
|
homeserver = Uri.https(homeserverController.text, '');
|
||||||
}
|
}
|
||||||
final client = Matrix.of(context).getLoginClient();
|
final client = Matrix.of(context).getLoginClient();
|
||||||
loginHomeserverSummary = await client.checkHomeserver(homeserver);
|
final (_, _, loginFlows) = await client.checkHomeserver(homeserver);
|
||||||
|
this.loginFlows = loginFlows;
|
||||||
if (supportsSso) {
|
if (supportsSso) {
|
||||||
_rawLoginTypes = await client.request(
|
_rawLoginTypes = await client.request(
|
||||||
RequestType.GET,
|
RequestType.GET,
|
||||||
|
|
@ -100,11 +101,10 @@ class HomeserverPickerController extends State<HomeserverPicker> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HomeserverSummary? loginHomeserverSummary;
|
List<LoginFlow>? loginFlows;
|
||||||
|
|
||||||
bool _supportsFlow(String flowType) =>
|
bool _supportsFlow(String flowType) =>
|
||||||
loginHomeserverSummary?.loginFlows.any((flow) => flow.type == flowType) ??
|
loginFlows?.any((flow) => flow.type == flowType) ?? false;
|
||||||
false;
|
|
||||||
|
|
||||||
bool get supportsSso => _supportsFlow('m.login.sso');
|
bool get supportsSso => _supportsFlow('m.login.sso');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import 'package:matrix/matrix.dart';
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
import 'package:universal_html/html.dart' as html;
|
import 'package:universal_html/html.dart' as html;
|
||||||
|
|
||||||
|
// ignore: deprecated_member_use
|
||||||
class FlutterHiveCollectionsDatabase extends HiveCollectionsDatabase {
|
class FlutterHiveCollectionsDatabase extends HiveCollectionsDatabase {
|
||||||
FlutterHiveCollectionsDatabase(
|
FlutterHiveCollectionsDatabase(
|
||||||
super.name,
|
super.name,
|
||||||
|
|
|
||||||
|
|
@ -61,11 +61,19 @@ Future<MatrixSdkDatabase> _constructDatabase(Client client) async {
|
||||||
|
|
||||||
final cipher = await getDatabaseCipher();
|
final cipher = await getDatabaseCipher();
|
||||||
|
|
||||||
final fileStoragePath = PlatformInfos.isIOS || PlatformInfos.isMacOS
|
final databaseDirectory = PlatformInfos.isIOS || PlatformInfos.isMacOS
|
||||||
? await getLibraryDirectory()
|
? await getLibraryDirectory()
|
||||||
: await getApplicationSupportDirectory();
|
: await getApplicationSupportDirectory();
|
||||||
|
Directory? fileStorageLocation;
|
||||||
|
try {
|
||||||
|
fileStorageLocation = await getTemporaryDirectory();
|
||||||
|
} on MissingPlatformDirectoryException catch (_) {
|
||||||
|
Logs().w(
|
||||||
|
'No temporary directory for file cache available on this platform.',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
final path = join(fileStoragePath.path, '${client.clientName}.sqlite');
|
final path = join(databaseDirectory.path, '${client.clientName}.sqlite');
|
||||||
|
|
||||||
// fix dlopen for old Android
|
// fix dlopen for old Android
|
||||||
await applyWorkaroundToOpenSqlCipherOnOldAndroidVersions();
|
await applyWorkaroundToOpenSqlCipherOnOldAndroidVersions();
|
||||||
|
|
@ -105,7 +113,7 @@ Future<MatrixSdkDatabase> _constructDatabase(Client client) async {
|
||||||
client.clientName,
|
client.clientName,
|
||||||
database: database,
|
database: database,
|
||||||
maxFileSize: 1024 * 1024 * 10,
|
maxFileSize: 1024 * 1024 * 10,
|
||||||
fileStoragePath: fileStoragePath,
|
fileStorageLocation: fileStorageLocation?.uri,
|
||||||
deleteFilesAfterDuration: const Duration(days: 30),
|
deleteFilesAfterDuration: const Duration(days: 30),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,6 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
||||||
|
|
||||||
SharedPreferences get store => widget.store;
|
SharedPreferences get store => widget.store;
|
||||||
|
|
||||||
HomeserverSummary? loginHomeserverSummary;
|
|
||||||
XFile? loginAvatar;
|
XFile? loginAvatar;
|
||||||
String? loginUsername;
|
String? loginUsername;
|
||||||
bool? loginRegistrationSupported;
|
bool? loginRegistrationSupported;
|
||||||
|
|
|
||||||
12
pubspec.lock
12
pubspec.lock
|
|
@ -1210,18 +1210,10 @@ packages:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: matrix
|
name: matrix
|
||||||
sha256: f829dd542f354e5073e3b43aaed3adc2829e762a9ec50a3f186ffd7dddc36d5e
|
sha256: "36c7e13d5d7420898f2597d6f5f0611a9da8114a0fde11f41b9e54cd1140b05f"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.26.1"
|
version: "0.27.0"
|
||||||
matrix_api_lite:
|
|
||||||
dependency: transitive
|
|
||||||
description:
|
|
||||||
name: matrix_api_lite
|
|
||||||
sha256: "62bdd1dffb956e956863ba21e52109157502342b749e4728f4105f0c6d73a254"
|
|
||||||
url: "https://pub.dev"
|
|
||||||
source: hosted
|
|
||||||
version: "1.7.2"
|
|
||||||
meta:
|
meta:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@ dependencies:
|
||||||
keyboard_shortcuts: ^0.1.4
|
keyboard_shortcuts: ^0.1.4
|
||||||
latlong2: ^0.9.1
|
latlong2: ^0.9.1
|
||||||
linkify: ^5.0.0
|
linkify: ^5.0.0
|
||||||
matrix: ^0.26.1
|
matrix: ^0.27.0
|
||||||
native_imaging: ^0.1.0
|
native_imaging: ^0.1.0
|
||||||
package_info_plus: ^6.0.0
|
package_info_plus: ^6.0.0
|
||||||
pasteboard: ^0.2.0
|
pasteboard: ^0.2.0
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
// ignore_for_file: depend_on_referenced_packages
|
// ignore_for_file: depend_on_referenced_packages
|
||||||
|
|
||||||
import 'package:matrix/encryption/utils/key_verification.dart';
|
import 'package:matrix/encryption/utils/key_verification.dart';
|
||||||
|
import 'package:matrix/fake_matrix_api.dart';
|
||||||
import 'package:matrix/matrix.dart';
|
import 'package:matrix/matrix.dart';
|
||||||
import 'package:matrix_api_lite/fake_matrix_api.dart';
|
|
||||||
|
|
||||||
import 'package:fluffychat/utils/matrix_sdk_extensions/flutter_hive_collections_database.dart';
|
import 'package:fluffychat/utils/matrix_sdk_extensions/flutter_hive_collections_database.dart';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue