chore: Make key fingerprints in chat encryption page selectable
This commit is contained in:
parent
4d7f0295ca
commit
8f4c8b7501
1 changed files with 72 additions and 66 deletions
|
|
@ -101,78 +101,84 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
final deviceKeys = snapshot.data!;
|
final deviceKeys = snapshot.data!;
|
||||||
return ListView.builder(
|
return SelectionArea(
|
||||||
shrinkWrap: true,
|
child: ListView.builder(
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
shrinkWrap: true,
|
||||||
itemCount: deviceKeys.length,
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
itemBuilder: (BuildContext context, int i) => Column(
|
itemCount: deviceKeys.length,
|
||||||
mainAxisSize: .min,
|
itemBuilder: (BuildContext context, int i) => Column(
|
||||||
children: [
|
mainAxisSize: .min,
|
||||||
if (i == 0 ||
|
children: [
|
||||||
deviceKeys[i].userId !=
|
if (i == 0 ||
|
||||||
deviceKeys[i - 1].userId) ...[
|
deviceKeys[i].userId !=
|
||||||
const Divider(),
|
deviceKeys[i - 1].userId) ...[
|
||||||
FutureBuilder(
|
const Divider(),
|
||||||
future: room.client.getUserProfile(
|
FutureBuilder(
|
||||||
deviceKeys[i].userId,
|
future: room.client.getUserProfile(
|
||||||
|
deviceKeys[i].userId,
|
||||||
|
),
|
||||||
|
builder: (context, snapshot) {
|
||||||
|
final displayname =
|
||||||
|
snapshot.data?.displayname ??
|
||||||
|
deviceKeys[i].userId.localpart ??
|
||||||
|
deviceKeys[i].userId;
|
||||||
|
return ListTile(
|
||||||
|
leading: Avatar(
|
||||||
|
name: displayname,
|
||||||
|
mxContent: snapshot.data?.avatarUrl,
|
||||||
|
),
|
||||||
|
title: Text(displayname),
|
||||||
|
subtitle: Text(deviceKeys[i].userId),
|
||||||
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
builder: (context, snapshot) {
|
],
|
||||||
final displayname =
|
ListTile(
|
||||||
snapshot.data?.displayname ??
|
leading: Switch.adaptive(
|
||||||
deviceKeys[i].userId.localpart ??
|
value: !deviceKeys[i].blocked,
|
||||||
deviceKeys[i].userId;
|
activeThumbColor: deviceKeys[i].verified
|
||||||
return ListTile(
|
? Colors.green
|
||||||
leading: Avatar(
|
: Colors.orange,
|
||||||
name: displayname,
|
onChanged: (_) =>
|
||||||
mxContent: snapshot.data?.avatarUrl,
|
controller.toggleDeviceKey(deviceKeys[i]),
|
||||||
|
),
|
||||||
|
title: Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
deviceKeys[i].verified
|
||||||
|
? L10n.of(context).verified
|
||||||
|
: deviceKeys[i].blocked
|
||||||
|
? L10n.of(context).blocked
|
||||||
|
: L10n.of(context).unverified,
|
||||||
|
style: TextStyle(
|
||||||
|
color: deviceKeys[i].verified
|
||||||
|
? Colors.green
|
||||||
|
: deviceKeys[i].blocked
|
||||||
|
? Colors.red
|
||||||
|
: Colors.orange,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
title: Text(displayname),
|
const Text(' | ID: '),
|
||||||
subtitle: Text(deviceKeys[i].userId),
|
Text(
|
||||||
);
|
deviceKeys[i].deviceId ??
|
||||||
},
|
L10n.of(context).unknownDevice,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
subtitle: Text(
|
||||||
|
deviceKeys[i].ed25519Key?.beautified ??
|
||||||
|
L10n.of(
|
||||||
|
context,
|
||||||
|
).unknownEncryptionAlgorithm,
|
||||||
|
style: TextStyle(
|
||||||
|
fontFamily: 'RobotoMono',
|
||||||
|
color: theme.colorScheme.secondary,
|
||||||
|
fontSize: 11,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
SwitchListTile(
|
),
|
||||||
value: !deviceKeys[i].blocked,
|
|
||||||
activeThumbColor: deviceKeys[i].verified
|
|
||||||
? Colors.green
|
|
||||||
: Colors.orange,
|
|
||||||
onChanged: (_) =>
|
|
||||||
controller.toggleDeviceKey(deviceKeys[i]),
|
|
||||||
title: Row(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
deviceKeys[i].verified
|
|
||||||
? L10n.of(context).verified
|
|
||||||
: deviceKeys[i].blocked
|
|
||||||
? L10n.of(context).blocked
|
|
||||||
: L10n.of(context).unverified,
|
|
||||||
style: TextStyle(
|
|
||||||
color: deviceKeys[i].verified
|
|
||||||
? Colors.green
|
|
||||||
: deviceKeys[i].blocked
|
|
||||||
? Colors.red
|
|
||||||
: Colors.orange,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const Text(' | ID: '),
|
|
||||||
Text(
|
|
||||||
deviceKeys[i].deviceId ??
|
|
||||||
L10n.of(context).unknownDevice,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
subtitle: Text(
|
|
||||||
deviceKeys[i].ed25519Key?.beautified ??
|
|
||||||
L10n.of(context).unknownEncryptionAlgorithm,
|
|
||||||
style: TextStyle(
|
|
||||||
fontFamily: 'RobotoMono',
|
|
||||||
color: theme.colorScheme.secondary,
|
|
||||||
fontSize: 11,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue