Skip to content

Commit 9043c5f

Browse files
chungwweignprice
authored andcommitted
all_channels: Make row item at least 44px tall with ConstrainedBox
Make sure every row is at least 44px in height by specifying BoxConstraints(minHeight: 44) to meet touch target requirement.
1 parent 3781b30 commit 9043c5f

File tree

2 files changed

+26
-22
lines changed

2 files changed

+26
-22
lines changed

lib/widgets/all_channels.dart

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -96,28 +96,29 @@ class AllChannelsListEntry extends StatelessWidget {
9696
final Subscription? subscription = channel is Subscription ? channel : null;
9797
final hasContentAccess = store.selfHasContentAccess(channel);
9898

99-
return Padding(
100-
padding: EdgeInsetsDirectional.only(start: 8, end: 4),
101-
child: Row(spacing: 6, children: [
102-
Icon(
103-
size: 20,
104-
color: colorSwatchFor(context, subscription).iconOnPlainBackground,
105-
iconDataForStream(channel)),
106-
Expanded(
107-
child: Text(
108-
style: TextStyle(
109-
color: designVariables.textMessage,
110-
fontSize: 17,
111-
height: 20 / 17,
112-
).merge(weightVariableTextStyle(context, wght: 600)),
113-
channel.name)),
114-
if (hasContentAccess) _SubscribeToggle(channel: channel),
115-
ZulipIconButton(
116-
icon: ZulipIcons.more_horizontal,
117-
onPressed: () {
118-
showChannelActionSheet(context, channelId: channel.streamId);
119-
}),
120-
]));
99+
return ConstrainedBox(constraints: const BoxConstraints(minHeight: 44),
100+
child: Padding(
101+
padding: EdgeInsetsDirectional.only(start: 8, end: 4),
102+
child: Row(spacing: 6, children: [
103+
Icon(
104+
size: 20,
105+
color: colorSwatchFor(context, subscription).iconOnPlainBackground,
106+
iconDataForStream(channel)),
107+
Expanded(
108+
child: Text(
109+
style: TextStyle(
110+
color: designVariables.textMessage,
111+
fontSize: 17,
112+
height: 20 / 17,
113+
).merge(weightVariableTextStyle(context, wght: 600)),
114+
channel.name)),
115+
if (hasContentAccess) _SubscribeToggle(channel: channel),
116+
ZulipIconButton(
117+
icon: ZulipIcons.more_horizontal,
118+
onPressed: () {
119+
showChannelActionSheet(context, channelId: channel.streamId);
120+
}),
121+
])));
121122
}
122123
}
123124

test/widgets/all_channels_test.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ void main() {
204204
}
205205

206206
check(findInRow(find.byIcon(ZulipIcons.more_horizontal))).findsOne();
207+
208+
final touchTargetSize = tester.getSize(findElement);
209+
check(touchTargetSize.height).equals(44);
207210
}
208211
});
209212

0 commit comments

Comments
 (0)