design: Better paddings in tablet mode

pull/787/head
krille-chan 2 years ago
parent 4994db663f
commit 7332e533d0
No known key found for this signature in database

@ -53,6 +53,7 @@ class ChatMembersView extends StatelessWidget {
), ),
body: MaxWidthBody( body: MaxWidthBody(
withScrolling: false, withScrolling: false,
innerPadding: const EdgeInsets.symmetric(vertical: 8),
child: error != null child: error != null
? Center( ? Center(
child: Padding( child: Padding(

@ -36,6 +36,7 @@ class InvitationSelectionView extends StatelessWidget {
title: Text(L10n.of(context)!.inviteContact), title: Text(L10n.of(context)!.inviteContact),
), ),
body: MaxWidthBody( body: MaxWidthBody(
innerPadding: const EdgeInsets.symmetric(vertical: 8),
child: Column( child: Column(
children: [ children: [
Padding( Padding(

@ -39,6 +39,7 @@ class NewPrivateChatView extends StatelessWidget {
), ),
body: MaxWidthBody( body: MaxWidthBody(
withScrolling: false, withScrolling: false,
innerPadding: const EdgeInsets.symmetric(vertical: 8),
child: Column( child: Column(
children: [ children: [
Padding( Padding(
@ -151,18 +152,21 @@ class NewPrivateChatView extends StatelessWidget {
Center( Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(64.0), padding: const EdgeInsets.all(64.0),
child: Material( child: ConstrainedBox(
borderRadius: BorderRadius.circular(12), constraints: const BoxConstraints(maxHeight: 256),
elevation: 10, child: Material(
color: Colors.white, borderRadius: BorderRadius.circular(12),
shadowColor: elevation: 10,
Theme.of(context).appBarTheme.shadowColor, color: Colors.white,
clipBehavior: Clip.hardEdge, shadowColor:
child: QrImageView( Theme.of(context).appBarTheme.shadowColor,
data: clipBehavior: Clip.hardEdge,
'https://matrix.to/#/${Matrix.of(context).client.userID}', child: QrImageView(
version: QrVersions.auto, data:
// size: qrCodeSize, '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 double maxWidth;
final bool withFrame; final bool withFrame;
final bool withScrolling; final bool withScrolling;
final EdgeInsets? innerPadding;
const MaxWidthBody({ const MaxWidthBody({
this.child, this.child,
this.maxWidth = 600, this.maxWidth = 600,
this.withFrame = true, this.withFrame = true,
this.withScrolling = true, this.withScrolling = true,
this.innerPadding,
super.key, super.key,
}); });
@override @override
@ -36,16 +38,20 @@ class MaxWidthBody extends StatelessWidget {
Theme.of(context).appBarTheme.scrolledUnderElevation ?? Theme.of(context).appBarTheme.scrolledUnderElevation ??
4, 4,
clipBehavior: Clip.hardEdge, clipBehavior: Clip.hardEdge,
borderRadius: BorderRadius.circular( borderRadius: BorderRadius.circular(AppConfig.borderRadius),
AppConfig.borderRadius,
),
shadowColor: Theme.of(context).appBarTheme.shadowColor, shadowColor: Theme.of(context).appBarTheme.shadowColor,
child: child, child: child,
) )
: child, : child,
); );
if (!withScrolling) return childWithPadding; if (!withScrolling) {
return Padding(
padding: innerPadding ?? EdgeInsets.zero,
child: childWithPadding,
);
}
return SingleChildScrollView( return SingleChildScrollView(
padding: innerPadding,
physics: const ScrollPhysics(), physics: const ScrollPhysics(),
child: childWithPadding, child: childWithPadding,
); );

Loading…
Cancel
Save