Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions lib/widgets/message_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,28 @@ class _MessageListState extends State<MessageList> {
style: const TextStyle(color: Color.fromRGBO(0, 0, 0, 1)),
child: ColoredBox(
color: Colors.white,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 760),
child: _buildListView(context)))));

// Pad the left and right insets, for small devices in landscape.
child: SafeArea(
// A non-ancestor (the compose box) pads the bottom inset;
// prevent extra padding here.
// TODO have MessageListPage adjust the MediaQuery so we don't
// have to worry about this here
bottom: false,

// A non-ancestor (the app bar) pads the top inset. But no
// need to prevent extra padding with `top: false`, because
// Scaffold, which knows about the app bar, sets `body`'s
// ambient `MediaQueryData.padding` to have `top: 0`:
// https://github.com/flutter/flutter/blob/3.7.0-1.2.pre/packages/flutter/lib/src/material/scaffold.dart#L2778

// Keep some padding when there are no horizontal insets,
// which is usual in portrait mode.
minimum: const EdgeInsets.symmetric(horizontal: 8),
child: Center(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 760),
child: _buildListView(context))))));
}

Widget _buildListView(context) {
Expand Down