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,6 +152,8 @@ class NewPrivateChatView extends StatelessWidget {
Center( Center(
child: Padding( child: Padding(
padding: const EdgeInsets.all(64.0), padding: const EdgeInsets.all(64.0),
child: ConstrainedBox(
constraints: const BoxConstraints(maxHeight: 256),
child: Material( child: Material(
borderRadius: BorderRadius.circular(12), borderRadius: BorderRadius.circular(12),
elevation: 10, elevation: 10,
@ -167,6 +170,7 @@ class NewPrivateChatView extends StatelessWidget {
), ),
), ),
), ),
),
], ],
), ),
secondChild: FutureBuilder( secondChild: FutureBuilder(

@ -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