refactor: Update to Dart 3.10 with . shorthands
This commit is contained in:
parent
75a37f3f7c
commit
1ea649f01e
167 changed files with 3351 additions and 3912 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue