|
|
@ -28,9 +28,14 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
|
|
|
VRouter.of(context).toSegments(['rooms', controller.roomId]),
|
|
|
|
VRouter.of(context).toSegments(['rooms', controller.roomId]),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
title: Text(L10n.of(context).tapOnDeviceToVerify),
|
|
|
|
title: Text(L10n.of(context).tapOnDeviceToVerify),
|
|
|
|
bottom: PreferredSize(
|
|
|
|
elevation: 0,
|
|
|
|
preferredSize: const Size.fromHeight(56),
|
|
|
|
),
|
|
|
|
child: ListTile(
|
|
|
|
body: MaxWidthBody(
|
|
|
|
|
|
|
|
withScrolling: true,
|
|
|
|
|
|
|
|
child: Column(
|
|
|
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
ListTile(
|
|
|
|
title: Text(L10n.of(context).deviceVerifyDescription),
|
|
|
|
title: Text(L10n.of(context).deviceVerifyDescription),
|
|
|
|
leading: CircleAvatar(
|
|
|
|
leading: CircleAvatar(
|
|
|
|
backgroundColor: Theme.of(context).secondaryHeaderColor,
|
|
|
|
backgroundColor: Theme.of(context).secondaryHeaderColor,
|
|
|
@ -38,11 +43,8 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
|
|
|
child: const Icon(Icons.lock),
|
|
|
|
child: const Icon(Icons.lock),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const Divider(height: 1),
|
|
|
|
),
|
|
|
|
StreamBuilder(
|
|
|
|
body: MaxWidthBody(
|
|
|
|
|
|
|
|
withScrolling: true,
|
|
|
|
|
|
|
|
child: StreamBuilder(
|
|
|
|
|
|
|
|
stream: room.onUpdate.stream,
|
|
|
|
stream: room.onUpdate.stream,
|
|
|
|
builder: (context, snapshot) {
|
|
|
|
builder: (context, snapshot) {
|
|
|
|
return FutureBuilder<List<DeviceKeys>>(
|
|
|
|
return FutureBuilder<List<DeviceKeys>>(
|
|
|
@ -57,8 +59,8 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!snapshot.hasData) {
|
|
|
|
if (!snapshot.hasData) {
|
|
|
|
return const Center(
|
|
|
|
return const Center(
|
|
|
|
child:
|
|
|
|
child: CircularProgressIndicator.adaptive(
|
|
|
|
CircularProgressIndicator.adaptive(strokeWidth: 2));
|
|
|
|
strokeWidth: 2));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
final deviceKeys = snapshot.data;
|
|
|
|
final deviceKeys = snapshot.data;
|
|
|
|
return ListView.builder(
|
|
|
|
return ListView.builder(
|
|
|
@ -119,8 +121,8 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
|
|
|
if (deviceKeys[i].blocked ||
|
|
|
|
if (deviceKeys[i].blocked ||
|
|
|
|
!deviceKeys[i].verified) {
|
|
|
|
!deviceKeys[i].verified) {
|
|
|
|
items.add(PopupMenuItem(
|
|
|
|
items.add(PopupMenuItem(
|
|
|
|
value:
|
|
|
|
value: deviceKeys[i].userId ==
|
|
|
|
deviceKeys[i].userId == room.client.userID
|
|
|
|
room.client.userID
|
|
|
|
? 'verify'
|
|
|
|
? 'verify'
|
|
|
|
: 'verify_user',
|
|
|
|
: 'verify_user',
|
|
|
|
child: Text(L10n.of(context).verifyStart),
|
|
|
|
child: Text(L10n.of(context).verifyStart),
|
|
|
@ -180,6 +182,8 @@ class ChatEncryptionSettingsView extends StatelessWidget {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|