style: Adjust new chat page

This commit is contained in:
Krille 2023-02-26 21:13:56 +01:00
parent ecf5adcdea
commit 2b2c230fcf

View File

@ -20,6 +20,8 @@ class NewPrivateChatView extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final qrCodeSize =
min(MediaQuery.of(context).size.width - 16, 200).toDouble();
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
leading: const BackButton(), leading: const BackButton(),
@ -61,14 +63,33 @@ class NewPrivateChatView extends StatelessWidget {
data: data:
'https://matrix.to/#/${Matrix.of(context).client.userID}', 'https://matrix.to/#/${Matrix.of(context).client.userID}',
version: QrVersions.auto, version: QrVersions.auto,
size: min(MediaQuery.of(context).size.width - 16, 200), size: qrCodeSize,
), ),
TextButton.icon( TextButton.icon(
style: TextButton.styleFrom(
fixedSize:
Size.fromWidth(qrCodeSize - (2 * _qrCodePadding)),
),
icon: Icon(Icons.adaptive.share_outlined), icon: Icon(Icons.adaptive.share_outlined),
label: Text(L10n.of(context)!.shareYourInviteLink), label: Text(L10n.of(context)!.shareYourInviteLink),
onPressed: controller.inviteAction, onPressed: controller.inviteAction,
), ),
const SizedBox(height: 8), const SizedBox(height: 8),
if (PlatformInfos.isMobile) ...[
OutlinedButton.icon(
style: OutlinedButton.styleFrom(
backgroundColor:
Theme.of(context).colorScheme.primaryContainer,
fixedSize: Size.fromWidth(
qrCodeSize - (2 * _qrCodePadding),
),
),
icon: const Icon(Icons.qr_code_scanner_outlined),
label: Text(L10n.of(context)!.scanQrCode),
onPressed: controller.openScannerAction,
),
const SizedBox(height: 8),
],
], ],
), ),
), ),
@ -108,17 +129,6 @@ class NewPrivateChatView extends StatelessWidget {
), ),
], ],
), ),
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
floatingActionButton: PlatformInfos.isMobile
? Padding(
padding: const EdgeInsets.only(bottom: 64.0),
child: FloatingActionButton.extended(
onPressed: controller.openScannerAction,
label: Text(L10n.of(context)!.scanQrCode),
icon: const Icon(Icons.camera_alt_outlined),
),
)
: null,
); );
} }
} }