design: Better paddings in tablet mode
This commit is contained in:
parent
4994db663f
commit
7332e533d0
4 changed files with 28 additions and 16 deletions
|
|
@ -53,6 +53,7 @@ class ChatMembersView extends StatelessWidget {
|
|||
),
|
||||
body: MaxWidthBody(
|
||||
withScrolling: false,
|
||||
innerPadding: const EdgeInsets.symmetric(vertical: 8),
|
||||
child: error != null
|
||||
? Center(
|
||||
child: Padding(
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ class InvitationSelectionView extends StatelessWidget {
|
|||
title: Text(L10n.of(context)!.inviteContact),
|
||||
),
|
||||
body: MaxWidthBody(
|
||||
innerPadding: const EdgeInsets.symmetric(vertical: 8),
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ class NewPrivateChatView extends StatelessWidget {
|
|||
),
|
||||
body: MaxWidthBody(
|
||||
withScrolling: false,
|
||||
innerPadding: const EdgeInsets.symmetric(vertical: 8),
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
|
|
@ -151,18 +152,21 @@ class NewPrivateChatView extends StatelessWidget {
|
|||
Center(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(64.0),
|
||||
child: Material(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
elevation: 10,
|
||||
color: Colors.white,
|
||||
shadowColor:
|
||||
Theme.of(context).appBarTheme.shadowColor,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: QrImageView(
|
||||
data:
|
||||
'https://matrix.to/#/${Matrix.of(context).client.userID}',
|
||||
version: QrVersions.auto,
|
||||
// size: qrCodeSize,
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxHeight: 256),
|
||||
child: Material(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
elevation: 10,
|
||||
color: Colors.white,
|
||||
shadowColor:
|
||||
Theme.of(context).appBarTheme.shadowColor,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: QrImageView(
|
||||
data:
|
||||
'https://matrix.to/#/${Matrix.of(context).client.userID}',
|
||||
version: QrVersions.auto,
|
||||
// size: qrCodeSize,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -9,12 +9,14 @@ class MaxWidthBody extends StatelessWidget {
|
|||
final double maxWidth;
|
||||
final bool withFrame;
|
||||
final bool withScrolling;
|
||||
final EdgeInsets? innerPadding;
|
||||
|
||||
const MaxWidthBody({
|
||||
this.child,
|
||||
this.maxWidth = 600,
|
||||
this.withFrame = true,
|
||||
this.withScrolling = true,
|
||||
this.innerPadding,
|
||||
super.key,
|
||||
});
|
||||
@override
|
||||
|
|
@ -36,16 +38,20 @@ class MaxWidthBody extends StatelessWidget {
|
|||
Theme.of(context).appBarTheme.scrolledUnderElevation ??
|
||||
4,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
borderRadius: BorderRadius.circular(
|
||||
AppConfig.borderRadius,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
shadowColor: Theme.of(context).appBarTheme.shadowColor,
|
||||
child: child,
|
||||
)
|
||||
: child,
|
||||
);
|
||||
if (!withScrolling) return childWithPadding;
|
||||
if (!withScrolling) {
|
||||
return Padding(
|
||||
padding: innerPadding ?? EdgeInsets.zero,
|
||||
child: childWithPadding,
|
||||
);
|
||||
}
|
||||
return SingleChildScrollView(
|
||||
padding: innerPadding,
|
||||
physics: const ScrollPhysics(),
|
||||
child: childWithPadding,
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue