Skip to content

Commit a8751e4

Browse files
committed
chris: adjust _NewDmSearchBar
- move vertical padding inside scroll viewport, as in Figma - simplify some layout: - remove 44px min-height (not clear that the design intends this, and it leaves unnecessary blank space when text-size setting is small) - let content stretch with CrossAxisAlignment.stretch of Column parent, instead of single-child Row with Expanded
1 parent 5f003ec commit a8751e4

File tree

1 file changed

+19
-24
lines changed

1 file changed

+19
-24
lines changed

lib/widgets/new_dm_sheet.dart

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class _NewDmPickerState extends State<NewDmPicker> {
114114

115115
@override
116116
Widget build(BuildContext context) {
117-
return Column(children: [
117+
return Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
118118
_NewDmHeader(selectedUserIds: selectedUserIds),
119119
_NewDmSearchBar(
120120
searchController: searchController,
@@ -235,31 +235,26 @@ class _NewDmSearchBar extends StatelessWidget {
235235
Widget build(BuildContext context) {
236236
final designVariables = DesignVariables.of(context);
237237

238-
return ConstrainedBox(
239-
constraints: const BoxConstraints(
240-
minHeight: 44,
241-
maxHeight: 124),
242-
child: DecoratedBox(
243-
decoration: BoxDecoration(color: designVariables.bgSearchInput),
238+
return Container(
239+
constraints: const BoxConstraints(maxHeight: 124),
240+
decoration: BoxDecoration(color: designVariables.bgSearchInput),
241+
child: SingleChildScrollView(
242+
reverse: true,
244243
child: Padding(
245244
padding: const EdgeInsets.symmetric(horizontal: 14, vertical: 11),
246-
child: SingleChildScrollView(
247-
reverse: true,
248-
child: Row(children: [
249-
Expanded(child: Wrap(
250-
spacing: 6,
251-
runSpacing: 4,
252-
crossAxisAlignment: WrapCrossAlignment.center,
253-
children: [
254-
for (final userId in selectedUserIds)
255-
_SelectedUserChip(userId: userId),
256-
// The IntrinsicWidth lets the text field participate in the Wrap
257-
// when its content fits on the same line with a user chip,
258-
// by preventing it from expanding to fill the available width. See:
259-
// https://github.com/zulip/zulip-flutter/pull/1322#discussion_r2094112488
260-
IntrinsicWidth(child: _buildSearchField(context)),
261-
])),
262-
])))));
245+
child: Wrap(
246+
spacing: 6,
247+
runSpacing: 4,
248+
crossAxisAlignment: WrapCrossAlignment.center,
249+
children: [
250+
for (final userId in selectedUserIds)
251+
_SelectedUserChip(userId: userId),
252+
// The IntrinsicWidth lets the text field participate in the Wrap
253+
// when its content fits on the same line with a user chip,
254+
// by preventing it from expanding to fill the available width. See:
255+
// https://github.com/zulip/zulip-flutter/pull/1322#discussion_r2094112488
256+
IntrinsicWidth(child: _buildSearchField(context)),
257+
]))));
263258
}
264259
}
265260

0 commit comments

Comments
 (0)