mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-05-13 03:32:22 -04:00
layout work
This commit is contained in:
parent
accd79c82d
commit
95e5306eb3
11 changed files with 657 additions and 216 deletions
|
@ -21,6 +21,41 @@ class PasteInviteDialog extends ConsumerStatefulWidget {
|
|||
|
||||
@override
|
||||
PasteInviteDialogState createState() => PasteInviteDialogState();
|
||||
|
||||
static Future<void> show(BuildContext context) async {
|
||||
final theme = Theme.of(context);
|
||||
final scale = theme.extension<ScaleScheme>()!;
|
||||
final textTheme = theme.textTheme;
|
||||
|
||||
await showDialog<void>(
|
||||
context: context,
|
||||
// ignore: prefer_expression_function_bodies
|
||||
builder: (context) {
|
||||
return AlertDialog(
|
||||
elevation: 0,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(16)),
|
||||
side: BorderSide(width: 4, color: scale.primaryScale.border),
|
||||
),
|
||||
contentPadding: EdgeInsets.zero,
|
||||
backgroundColor: scale.primaryScale.border,
|
||||
title: Text(
|
||||
translate('paste_invite_dialog.title'),
|
||||
style: textTheme.titleMedium,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
titlePadding: EdgeInsets.fromLTRB(4, 4, 4, 0),
|
||||
content: DecoratedBox(
|
||||
decoration: ShapeDecoration(
|
||||
color: scale.primaryScale.subtleBackground,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
side: BorderSide(
|
||||
width: 4, color: scale.primaryScale.border),
|
||||
)),
|
||||
child: const PasteInviteDialog().paddingAll(4)));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class PasteInviteDialogState extends ConsumerState<PasteInviteDialog> {
|
||||
|
@ -240,16 +275,16 @@ class PasteInviteDialogState extends ConsumerState<PasteInviteDialog> {
|
|||
return SizedBox(height: 400, child: waitingPage(context));
|
||||
}
|
||||
return ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxHeight: 400),
|
||||
constraints: const BoxConstraints(maxHeight: 400, maxWidth: 400),
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(8),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Text(
|
||||
translate('paste_invite_dialog.paste_invite_here'),
|
||||
).paddingAll(8),
|
||||
).paddingLTRB(0, 0, 0, 8),
|
||||
Container(
|
||||
constraints: const BoxConstraints(maxHeight: 200),
|
||||
child: TextField(
|
||||
|
@ -267,12 +302,13 @@ class PasteInviteDialogState extends ConsumerState<PasteInviteDialog> {
|
|||
'---- END VEILIDCHAT CONTACT INVITE -----\n',
|
||||
//labelText: translate('paste_invite_dialog.paste')
|
||||
),
|
||||
).paddingAll(8)),
|
||||
)).paddingLTRB(0, 0, 0, 8),
|
||||
if (_validatingPaste)
|
||||
Column(children: [
|
||||
Text(translate('paste_invite_dialog.validating')),
|
||||
Text(translate('paste_invite_dialog.validating'))
|
||||
.paddingLTRB(0, 0, 0, 8),
|
||||
buildProgressIndicator(context),
|
||||
]),
|
||||
]).paddingAll(16).toCenter(),
|
||||
if (_validInvitation == null &&
|
||||
!_validatingPaste &&
|
||||
_pasteTextController.text.isNotEmpty)
|
||||
|
@ -282,10 +318,15 @@ class PasteInviteDialogState extends ConsumerState<PasteInviteDialog> {
|
|||
]).paddingAll(16).toCenter(),
|
||||
if (_validInvitation != null && !_validatingPaste)
|
||||
Column(children: [
|
||||
ProfileWidget(
|
||||
name: _validInvitation!.contactRequestPrivate.profile.name,
|
||||
title:
|
||||
_validInvitation!.contactRequestPrivate.profile.title),
|
||||
Container(
|
||||
constraints: const BoxConstraints(maxHeight: 64),
|
||||
width: double.infinity,
|
||||
child: ProfileWidget(
|
||||
name: _validInvitation!
|
||||
.contactRequestPrivate.profile.name,
|
||||
title: _validInvitation!
|
||||
.contactRequestPrivate.profile.title))
|
||||
.paddingLTRB(0, 0, 0, 8),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue