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

@ -33,67 +33,71 @@ class Settings3PidView extends StatelessWidget {
withScrolling: false,
child: FutureBuilder<List<ThirdPartyIdentifier>?>(
future: controller.request,
builder: (
BuildContext context,
AsyncSnapshot<List<ThirdPartyIdentifier>?> snapshot,
) {
if (snapshot.hasError) {
return Center(
child: Text(
snapshot.error.toString(),
textAlign: TextAlign.center,
),
);
}
if (!snapshot.hasData) {
return const Center(
child: CircularProgressIndicator.adaptive(strokeWidth: 2),
);
}
final identifier = snapshot.data!;
return Column(
children: [
ListTile(
leading: CircleAvatar(
backgroundColor: theme.scaffoldBackgroundColor,
foregroundColor:
identifier.isEmpty ? Colors.orange : Colors.grey,
child: Icon(
identifier.isEmpty
? Icons.warning_outlined
: Icons.info_outlined,
builder:
(
BuildContext context,
AsyncSnapshot<List<ThirdPartyIdentifier>?> snapshot,
) {
if (snapshot.hasError) {
return Center(
child: Text(
snapshot.error.toString(),
textAlign: TextAlign.center,
),
),
title: Text(
identifier.isEmpty
? L10n.of(context).noPasswordRecoveryDescription
: L10n.of(context)
.withTheseAddressesRecoveryDescription,
),
),
const Divider(),
Expanded(
child: ListView.builder(
itemCount: identifier.length,
itemBuilder: (BuildContext context, int i) => ListTile(
);
}
if (!snapshot.hasData) {
return const Center(
child: CircularProgressIndicator.adaptive(strokeWidth: 2),
);
}
final identifier = snapshot.data!;
return Column(
children: [
ListTile(
leading: CircleAvatar(
backgroundColor: theme.scaffoldBackgroundColor,
foregroundColor: Colors.grey,
child: Icon(identifier[i].iconData),
foregroundColor: identifier.isEmpty
? Colors.orange
: Colors.grey,
child: Icon(
identifier.isEmpty
? Icons.warning_outlined
: Icons.info_outlined,
),
),
title: Text(identifier[i].address),
trailing: IconButton(
tooltip: L10n.of(context).delete,
icon: const Icon(Icons.delete_forever_outlined),
color: Colors.red,
onPressed: () => controller.delete3Pid(identifier[i]),
title: Text(
identifier.isEmpty
? L10n.of(context).noPasswordRecoveryDescription
: L10n.of(
context,
).withTheseAddressesRecoveryDescription,
),
),
),
),
],
);
},
const Divider(),
Expanded(
child: ListView.builder(
itemCount: identifier.length,
itemBuilder: (BuildContext context, int i) => ListTile(
leading: CircleAvatar(
backgroundColor: theme.scaffoldBackgroundColor,
foregroundColor: Colors.grey,
child: Icon(identifier[i].iconData),
),
title: Text(identifier[i].address),
trailing: IconButton(
tooltip: L10n.of(context).delete,
icon: const Icon(Icons.delete_forever_outlined),
color: Colors.red,
onPressed: () =>
controller.delete3Pid(identifier[i]),
),
),
),
),
],
);
},
),
),
);