Skip to content

Commit dac2f4b

Browse files
committed
all_channels: Make row item at least 44px tall
Add SizedBox(height: 40, width: 52), the size of the toggle, as a placeholder for hidden toggle to prevent UI jump. Adjust Row padding (top: 2, bottom: 2) to maintain 44px touch target.
1 parent 7e3f92e commit dac2f4b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/widgets/all_channels.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class AllChannelsListEntry extends StatelessWidget {
104104
narrow: ChannelNarrow(channel.streamId))),
105105
onLongPress: () => showChannelActionSheet(context, channelId: channel.streamId),
106106
child: Padding(
107-
padding: EdgeInsetsDirectional.only(start: 8, end: 12),
107+
padding: const EdgeInsets.fromLTRB(8, 2, 12, 2),
108108
child: Row(spacing: 6, children: [
109109
Icon(
110110
size: 20,
@@ -120,7 +120,7 @@ class AllChannelsListEntry extends StatelessWidget {
120120
height: 20 / 17,
121121
).merge(weightVariableTextStyle(context, wght: 600)),
122122
channel.name)),
123-
if (hasContentAccess) _SubscribeToggle(channel: channel),
123+
hasContentAccess ? _SubscribeToggle(channel: channel) : const SizedBox(height: 40, width: 52)
124124
])));
125125
}
126126
}

test/widgets/all_channels_test.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ void main() {
203203
} else {
204204
check(maybeToggle).isNull();
205205
}
206+
207+
final touchTargetSize = tester.getSize(findElement);
208+
check(touchTargetSize.height).equals(44);
206209
}
207210
});
208211

0 commit comments

Comments
 (0)