refactor: Update to Dart 3.10 with . shorthands

This commit is contained in:
Christian Kußowski 2025-11-30 12:54:06 +01:00
commit 1ea649f01e
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
167 changed files with 3351 additions and 3912 deletions

View file

@ -29,9 +29,9 @@ class SettingsController extends State<Settings> {
bool profileUpdated = false;
void updateProfile() => setState(() {
profileUpdated = true;
profileFuture = null;
});
profileUpdated = true;
profileFuture = null;
});
void setDisplaynameAction() async {
final profile = await profileFuture;
@ -132,15 +132,9 @@ class SettingsController extends State<Settings> {
imageQuality: 50,
);
if (result == null) return;
file = MatrixFile(
bytes: await result.readAsBytes(),
name: result.path,
);
file = MatrixFile(bytes: await result.readAsBytes(), name: result.path);
} else {
final result = await selectFiles(
context,
type: FileSelectorType.images,
);
final result = await selectFiles(context, type: FileSelectorType.images);
final pickedFile = result.firstOrNull;
if (pickedFile == null) return;
file = MatrixFile(
@ -176,8 +170,8 @@ class SettingsController extends State<Settings> {
await client.encryption?.crossSigning.isCached() ?? false;
final needsBootstrap =
await client.encryption?.keyManager.isCached() == false ||
client.encryption?.crossSigning.enabled == false ||
crossSigning == false;
client.encryption?.crossSigning.enabled == false ||
crossSigning == false;
final isUnknownSession = client.isUnknownSession;
setState(() {
showChatBackupBanner = needsBootstrap || isUnknownSession;
@ -204,9 +198,7 @@ class SettingsController extends State<Settings> {
@override
Widget build(BuildContext context) {
final client = Matrix.of(context).client;
profileFuture ??= client.getProfileFromUserId(
client.userID!,
);
profileFuture ??= client.getProfileFromUserId(client.userID!);
return SettingsView(this);
}
}