|
|
|
@ -39,75 +39,84 @@ class NewPrivateChatView extends StatelessWidget {
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
body: MaxWidthBody(
|
|
|
|
|
withScrolling: true,
|
|
|
|
|
child: 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),
|
|
|
|
|
body: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(
|
|
|
|
|
child: MaxWidthBody(
|
|
|
|
|
withScrolling: true,
|
|
|
|
|
child: 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),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
TextButton.icon(
|
|
|
|
|
icon: Icon(Icons.adaptive.share_outlined),
|
|
|
|
|
label: Text(L10n.of(context)!.shareYourInviteLink),
|
|
|
|
|
onPressed: controller.inviteAction,
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
bottomNavigationBar: MaxWidthBody(
|
|
|
|
|
withScrolling: false,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(12.0),
|
|
|
|
|
child: Form(
|
|
|
|
|
key: controller.formKey,
|
|
|
|
|
child: TextFormField(
|
|
|
|
|
controller: controller.controller,
|
|
|
|
|
autocorrect: false,
|
|
|
|
|
textInputAction: TextInputAction.go,
|
|
|
|
|
focusNode: controller.textFieldFocus,
|
|
|
|
|
onFieldSubmitted: controller.submitAction,
|
|
|
|
|
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,
|
|
|
|
|
suffixIcon: IconButton(
|
|
|
|
|
icon: const Icon(Icons.send_outlined),
|
|
|
|
|
onPressed: controller.submitAction,
|
|
|
|
|
MaxWidthBody(
|
|
|
|
|
withScrolling: false,
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(12.0),
|
|
|
|
|
child: Form(
|
|
|
|
|
key: controller.formKey,
|
|
|
|
|
child: TextFormField(
|
|
|
|
|
controller: controller.controller,
|
|
|
|
|
autocorrect: false,
|
|
|
|
|
textInputAction: TextInputAction.go,
|
|
|
|
|
focusNode: controller.textFieldFocus,
|
|
|
|
|
onFieldSubmitted: controller.submitAction,
|
|
|
|
|
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,
|
|
|
|
|
suffixIcon: IconButton(
|
|
|
|
|
icon: const Icon(Icons.send_outlined),
|
|
|
|
|
onPressed: controller.submitAction,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
|
|
|
|
|
floatingActionButton: PlatformInfos.isMobile && !controller.hideFab
|
|
|
|
|
? FloatingActionButton.extended(
|
|
|
|
|
onPressed: controller.openScannerAction,
|
|
|
|
|
label: Text(L10n.of(context)!.scanQrCode),
|
|
|
|
|
icon: const Icon(Icons.camera_alt_outlined),
|
|
|
|
|
? 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,
|
|
|
|
|
);
|
|
|
|
|