mirror of
https://github.com/krille-chan/fluffychat
synced 2024-09-10 11:05:10 +00:00
chore: Nicer new chat design
This commit is contained in:
parent
075a5faa9c
commit
549fc1051e
2 changed files with 43 additions and 37 deletions
|
@ -139,6 +139,7 @@ class BootstrapDialogState extends State<BootstrapDialog> {
|
|||
minLines: 4,
|
||||
maxLines: 4,
|
||||
readOnly: true,
|
||||
style: const TextStyle(fontFamily: 'monospace'),
|
||||
controller: TextEditingController(text: key),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
@ -254,16 +255,22 @@ class BootstrapDialogState extends State<BootstrapDialog> {
|
|||
),
|
||||
const Divider(height: 32),
|
||||
TextField(
|
||||
minLines: 1,
|
||||
maxLines: 1,
|
||||
minLines: 2,
|
||||
maxLines: 2,
|
||||
autocorrect: false,
|
||||
readOnly: _recoveryKeyInputLoading,
|
||||
autofillHints: _recoveryKeyInputLoading
|
||||
? null
|
||||
: [AutofillHints.password],
|
||||
controller: _recoveryKeyTextEditingController,
|
||||
style: const TextStyle(fontFamily: 'monospace'),
|
||||
decoration: InputDecoration(
|
||||
hintText: 'Abc123 Def456',
|
||||
labelStyle: TextStyle(
|
||||
fontFamily: Theme.of(context)
|
||||
.textTheme
|
||||
.bodyText1
|
||||
?.fontFamily),
|
||||
labelText: L10n.of(context)!.recoveryKey,
|
||||
errorText: _recoveryKeyInputError,
|
||||
),
|
||||
|
|
|
@ -39,42 +39,8 @@ class NewPrivateChatView extends StatelessWidget {
|
|||
withScrolling: true,
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: const EdgeInsets.all(_qrCodePadding),
|
||||
alignment: Alignment.center,
|
||||
padding: const EdgeInsets.all(_qrCodePadding * 2),
|
||||
child: InkWell(
|
||||
onTap: controller.inviteAction,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
child: Material(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
elevation: 6,
|
||||
color: Colors.white,
|
||||
shadowColor: const Color(0x44000000),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
QrImage(
|
||||
data:
|
||||
'https://matrix.to/#/${Matrix.of(context).client.userID}',
|
||||
version: QrVersions.auto,
|
||||
size: min(MediaQuery.of(context).size.width - 16, 200),
|
||||
),
|
||||
Image.asset('assets/share.png', width: 48, height: 48),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
subtitle: Text(
|
||||
L10n.of(context)!.createNewChatExplaination,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(12),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12),
|
||||
child: Form(
|
||||
key: controller.formKey,
|
||||
child: TextFormField(
|
||||
|
@ -87,6 +53,10 @@ class NewPrivateChatView extends StatelessWidget {
|
|||
validator: controller.validateForm,
|
||||
inputFormatters: controller.removeMatrixToFormatters,
|
||||
decoration: InputDecoration(
|
||||
contentPadding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 6,
|
||||
),
|
||||
labelText: L10n.of(context)!.typeInInviteLinkManually,
|
||||
hintText: '@username',
|
||||
prefixText: NewPrivateChatController.prefixNoProtocol,
|
||||
|
@ -98,6 +68,35 @@ class NewPrivateChatView extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: const EdgeInsets.all(_qrCodePadding),
|
||||
alignment: Alignment.center,
|
||||
padding: const EdgeInsets.all(_qrCodePadding * 2),
|
||||
child: Material(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
elevation: 10,
|
||||
color: Colors.white,
|
||||
shadowColor: Theme.of(context).appBarTheme.shadowColor,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
QrImage(
|
||||
data:
|
||||
'https://matrix.to/#/${Matrix.of(context).client.userID}',
|
||||
version: QrVersions.auto,
|
||||
size: min(MediaQuery.of(context).size.width - 16, 200),
|
||||
),
|
||||
TextButton.icon(
|
||||
icon: Icon(Icons.adaptive.share_outlined),
|
||||
label: Text(L10n.of(context)!.shareYourInviteLink),
|
||||
onPressed: controller.inviteAction,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
|
Loading…
Reference in a new issue