@@ -15,7 +15,12 @@ import 'unread_count_badge.dart';
1515
1616/// Scrollable listing of subscribed streams.
1717class SubscriptionListPageBody extends StatefulWidget {
18- const SubscriptionListPageBody ({super .key});
18+ const SubscriptionListPageBody ({
19+ super .key,
20+ this .showTopicListButtonInActionSheet = true ,
21+ });
22+
23+ final bool showTopicListButtonInActionSheet;
1924
2025 @override
2126 State <SubscriptionListPageBody > createState () => _SubscriptionListPageBodyState ();
@@ -106,11 +111,17 @@ class _SubscriptionListPageBodyState extends State<SubscriptionListPageBody> wit
106111 slivers: [
107112 if (pinned.isNotEmpty) ...[
108113 _SubscriptionListHeader (label: zulipLocalizations.pinnedSubscriptionsLabel),
109- _SubscriptionList (unreadsModel: unreadsModel, subscriptions: pinned),
114+ _SubscriptionList (
115+ unreadsModel: unreadsModel,
116+ subscriptions: pinned,
117+ showTopicListButtonInActionSheet: widget.showTopicListButtonInActionSheet),
110118 ],
111119 if (unpinned.isNotEmpty) ...[
112120 _SubscriptionListHeader (label: zulipLocalizations.unpinnedSubscriptionsLabel),
113- _SubscriptionList (unreadsModel: unreadsModel, subscriptions: unpinned),
121+ _SubscriptionList (
122+ unreadsModel: unreadsModel,
123+ subscriptions: unpinned,
124+ showTopicListButtonInActionSheet: widget.showTopicListButtonInActionSheet),
114125 ],
115126
116127 // TODO(#188): add button leading to "All Streams" page with ability to subscribe
@@ -160,10 +171,12 @@ class _SubscriptionList extends StatelessWidget {
160171 const _SubscriptionList ({
161172 required this .unreadsModel,
162173 required this .subscriptions,
174+ required this .showTopicListButtonInActionSheet,
163175 });
164176
165177 final Unreads ? unreadsModel;
166178 final List <Subscription > subscriptions;
179+ final bool showTopicListButtonInActionSheet;
167180
168181 @override
169182 Widget build (BuildContext context) {
@@ -176,7 +189,8 @@ class _SubscriptionList extends StatelessWidget {
176189 && unreadsModel! .countInChannelNarrow (subscription.streamId) > 0 ;
177190 return SubscriptionItem (subscription: subscription,
178191 unreadCount: unreadCount,
179- showMutedUnreadBadge: showMutedUnreadBadge);
192+ showMutedUnreadBadge: showMutedUnreadBadge,
193+ showTopicListButtonInActionSheet: showTopicListButtonInActionSheet);
180194 });
181195 }
182196}
@@ -188,11 +202,13 @@ class SubscriptionItem extends StatelessWidget {
188202 required this .subscription,
189203 required this .unreadCount,
190204 required this .showMutedUnreadBadge,
205+ required this .showTopicListButtonInActionSheet,
191206 });
192207
193208 final Subscription subscription;
194209 final int unreadCount;
195210 final bool showMutedUnreadBadge;
211+ final bool showTopicListButtonInActionSheet;
196212
197213 @override
198214 Widget build (BuildContext context) {
@@ -210,7 +226,9 @@ class SubscriptionItem extends StatelessWidget {
210226 MessageListPage .buildRoute (context: context,
211227 narrow: ChannelNarrow (subscription.streamId)));
212228 },
213- onLongPress: () => showChannelActionSheet (context, channelId: subscription.streamId),
229+ onLongPress: () => showChannelActionSheet (context,
230+ channelId: subscription.streamId,
231+ showTopicListButton: showTopicListButtonInActionSheet),
214232 child: Row (crossAxisAlignment: CrossAxisAlignment .center, children: [
215233 const SizedBox (width: 16 ),
216234 Padding (
0 commit comments