@@ -15,7 +15,12 @@ import 'unread_count_badge.dart';
15
15
16
16
/// Scrollable listing of subscribed streams.
17
17
class SubscriptionListPageBody extends StatefulWidget {
18
- const SubscriptionListPageBody ({super .key});
18
+ const SubscriptionListPageBody ({
19
+ super .key,
20
+ this .showTopicListButtonInActionSheet = true ,
21
+ });
22
+
23
+ final bool showTopicListButtonInActionSheet;
19
24
20
25
@override
21
26
State <SubscriptionListPageBody > createState () => _SubscriptionListPageBodyState ();
@@ -106,11 +111,17 @@ class _SubscriptionListPageBodyState extends State<SubscriptionListPageBody> wit
106
111
slivers: [
107
112
if (pinned.isNotEmpty) ...[
108
113
_SubscriptionListHeader (label: zulipLocalizations.pinnedSubscriptionsLabel),
109
- _SubscriptionList (unreadsModel: unreadsModel, subscriptions: pinned),
114
+ _SubscriptionList (
115
+ unreadsModel: unreadsModel,
116
+ subscriptions: pinned,
117
+ showTopicListButtonInActionSheet: widget.showTopicListButtonInActionSheet),
110
118
],
111
119
if (unpinned.isNotEmpty) ...[
112
120
_SubscriptionListHeader (label: zulipLocalizations.unpinnedSubscriptionsLabel),
113
- _SubscriptionList (unreadsModel: unreadsModel, subscriptions: unpinned),
121
+ _SubscriptionList (
122
+ unreadsModel: unreadsModel,
123
+ subscriptions: unpinned,
124
+ showTopicListButtonInActionSheet: widget.showTopicListButtonInActionSheet),
114
125
],
115
126
116
127
// TODO(#188): add button leading to "All Streams" page with ability to subscribe
@@ -160,10 +171,12 @@ class _SubscriptionList extends StatelessWidget {
160
171
const _SubscriptionList ({
161
172
required this .unreadsModel,
162
173
required this .subscriptions,
174
+ required this .showTopicListButtonInActionSheet,
163
175
});
164
176
165
177
final Unreads ? unreadsModel;
166
178
final List <Subscription > subscriptions;
179
+ final bool showTopicListButtonInActionSheet;
167
180
168
181
@override
169
182
Widget build (BuildContext context) {
@@ -176,7 +189,8 @@ class _SubscriptionList extends StatelessWidget {
176
189
&& unreadsModel! .countInChannelNarrow (subscription.streamId) > 0 ;
177
190
return SubscriptionItem (subscription: subscription,
178
191
unreadCount: unreadCount,
179
- showMutedUnreadBadge: showMutedUnreadBadge);
192
+ showMutedUnreadBadge: showMutedUnreadBadge,
193
+ showTopicListButtonInActionSheet: showTopicListButtonInActionSheet);
180
194
});
181
195
}
182
196
}
@@ -188,11 +202,13 @@ class SubscriptionItem extends StatelessWidget {
188
202
required this .subscription,
189
203
required this .unreadCount,
190
204
required this .showMutedUnreadBadge,
205
+ required this .showTopicListButtonInActionSheet,
191
206
});
192
207
193
208
final Subscription subscription;
194
209
final int unreadCount;
195
210
final bool showMutedUnreadBadge;
211
+ final bool showTopicListButtonInActionSheet;
196
212
197
213
@override
198
214
Widget build (BuildContext context) {
@@ -210,7 +226,9 @@ class SubscriptionItem extends StatelessWidget {
210
226
MessageListPage .buildRoute (context: context,
211
227
narrow: ChannelNarrow (subscription.streamId)));
212
228
},
213
- onLongPress: () => showChannelActionSheet (context, channelId: subscription.streamId),
229
+ onLongPress: () => showChannelActionSheet (context,
230
+ channelId: subscription.streamId,
231
+ showTopicListButton: showTopicListButtonInActionSheet),
214
232
child: Row (crossAxisAlignment: CrossAxisAlignment .center, children: [
215
233
const SizedBox (width: 16 ),
216
234
Padding (
0 commit comments