change: Polish new chat design

This commit is contained in:
Christian Pauly 2021-08-23 18:32:57 +02:00
parent d0a21da63b
commit 14586297dc

View File

@ -19,8 +19,6 @@ class NewPrivateChatView extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final qrCodeSize = min(AppConfig.columnWidth - _qrCodePadding * 6,
MediaQuery.of(context).size.width - _qrCodePadding * 6);
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
leading: BackButton(), leading: BackButton(),
@ -40,18 +38,6 @@ class NewPrivateChatView extends StatelessWidget {
body: MaxWidthBody( body: MaxWidthBody(
child: ListView( child: ListView(
children: [ children: [
Padding(
padding: const EdgeInsets.only(
top: _qrCodePadding * 2,
left: _qrCodePadding * 2,
right: _qrCodePadding * 2,
),
child: Text(
L10n.of(context).createNewChatExplaination,
textAlign: TextAlign.center,
style: TextStyle(fontSize: 16),
),
),
Container( Container(
margin: EdgeInsets.all(_qrCodePadding), margin: EdgeInsets.all(_qrCodePadding),
alignment: Alignment.center, alignment: Alignment.center,
@ -64,20 +50,29 @@ 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: qrCodeSize, size: min(MediaQuery.of(context).size.width - 16, 200),
), ),
), ),
), ),
Divider(), Divider(),
ListTile( ListTile(
title: Text(L10n.of(context).shareYourInviteLink), subtitle: Text(L10n.of(context).createNewChatExplaination),
trailing: Padding( trailing: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Icon(Icons.share_outlined), child: Icon(Icons.info_outline_rounded),
), ),
onTap: controller.inviteAction,
), ),
Divider(), Divider(),
Padding(
padding: const EdgeInsets.all(12.0),
child: SizedBox(
height: 56,
child: OutlinedButton.icon(
onPressed: controller.inviteAction,
icon: Icon(Icons.share_outlined),
label: Text(L10n.of(context).shareYourInviteLink)),
),
),
Padding( Padding(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
child: Form( child: Form(
@ -103,8 +98,8 @@ class NewPrivateChatView extends StatelessWidget {
Center( Center(
child: Image.asset( child: Image.asset(
'assets/private_chat_wallpaper.png', 'assets/private_chat_wallpaper.png',
width: qrCodeSize, width: min(AppConfig.columnWidth - _qrCodePadding * 6,
height: qrCodeSize, MediaQuery.of(context).size.width - _qrCodePadding * 6),
), ),
), ),
], ],