style: Encryption page adjustments

This commit is contained in:
Christian Pauly 2023-02-17 13:01:44 +01:00
parent 3c17d812b3
commit 73174003a9
2 changed files with 32 additions and 37 deletions

View File

@ -96,13 +96,16 @@ abstract class FluffyThemes {
), ),
dialogTheme: DialogTheme( dialogTheme: DialogTheme(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppConfig.borderRadius), borderRadius: BorderRadius.circular(AppConfig.borderRadius / 2),
), ),
), ),
elevatedButtonTheme: ElevatedButtonThemeData( elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(16),
textStyle: const TextStyle(fontSize: 16), textStyle: const TextStyle(fontSize: 16),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
),
), ),
), ),
); );

View File

@ -60,7 +60,8 @@ class ChatEncryptionSettingsView extends StatelessWidget {
if (room.isDirectChat) if (room.isDirectChat)
Padding( Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: Center( child: SizedBox(
width: double.infinity,
child: ElevatedButton.icon( child: ElevatedButton.icon(
onPressed: controller.startVerification, onPressed: controller.startVerification,
icon: const Icon(Icons.verified_outlined), icon: const Icon(Icons.verified_outlined),
@ -69,15 +70,7 @@ class ChatEncryptionSettingsView extends StatelessWidget {
), ),
), ),
if (room.encrypted) ...[ if (room.encrypted) ...[
const Divider(height: 1), const SizedBox(height: 16),
ListTile(
title: Text(
L10n.of(context)!.deviceKeys,
style: const TextStyle(
fontWeight: FontWeight.bold,
),
),
),
StreamBuilder( StreamBuilder(
stream: room.onUpdate.stream, stream: room.onUpdate.stream,
builder: (context, snapshot) => FutureBuilder< builder: (context, snapshot) => FutureBuilder<
@ -123,40 +116,39 @@ class ChatEncryptionSettingsView extends StatelessWidget {
: Colors.orange, : Colors.orange,
size: 20, size: 20,
), ),
const SizedBox(width: 4),
Text( Text(
deviceKeys[i].deviceId ?? deviceKeys[i].deviceId ??
L10n.of(context)!.unknownDevice, L10n.of(context)!.unknownDevice,
), ),
const SizedBox(width: 4), const SizedBox(width: 4),
Expanded( Flexible(
child: Align( fit: FlexFit.loose,
alignment: Alignment.centerRight, child: Material(
child: Material( shape: RoundedRectangleBorder(
shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(
borderRadius: BorderRadius.circular( AppConfig.borderRadius),
AppConfig.borderRadius), side: BorderSide(
side: BorderSide( color: Theme.of(context)
.colorScheme
.primary,
),
),
color: Theme.of(context)
.colorScheme
.primaryContainer,
child: Padding(
padding: const EdgeInsets.all(4.0),
child: Text(
deviceKeys[i].userId,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Theme.of(context) color: Theme.of(context)
.colorScheme .colorScheme
.primary, .primary,
), fontSize: 12,
), fontStyle: FontStyle.italic,
color: Theme.of(context)
.colorScheme
.primaryContainer,
child: Padding(
padding: const EdgeInsets.all(4.0),
child: Text(
deviceKeys[i].userId,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: Theme.of(context)
.colorScheme
.primary,
fontSize: 12,
fontStyle: FontStyle.italic,
),
), ),
), ),
), ),