@@ -14,12 +14,14 @@ import 'package:waves/features/threads/presentation/thread_feed/widgets/vote_ico
1414class InteractionTile extends StatelessWidget {
1515 const InteractionTile (
1616 {this .hideCommentInfo = false ,
17+ this .showVoteAndComment = true ,
1718 super .key,
1819 required this .item,
1920 this .removeCommentGesture = false });
2021
2122 final ThreadFeedModel item;
2223 final bool hideCommentInfo;
24+ final bool showVoteAndComment;
2325 final bool removeCommentGesture;
2426
2527 @override
@@ -34,43 +36,45 @@ class InteractionTile extends StatelessWidget {
3436 final iconColor = theme.primaryColorDark.withOpacity (0.8 );
3537 const iconGap = 5.0 ;
3638 const borderRadius = BorderRadius .all (Radius .circular (40 ));
37- final rowChildren = < Widget > [
38- VoteIconButton (
39- item: item,
40- iconColor: iconColor,
41- iconGap: iconGap,
42- textStyle: style (theme),
43- ),
44- ];
39+ final rowChildren = < Widget > [];
40+
41+ void addSpacer () {
42+ if (rowChildren.isNotEmpty) {
43+ rowChildren.add (gap ());
44+ }
45+ }
46+
47+ if (showVoteAndComment) {
48+ rowChildren.add (
49+ VoteIconButton (
50+ item: item,
51+ iconColor: iconColor,
52+ iconGap: iconGap,
53+ textStyle: style (theme),
54+ ),
55+ );
56+ }
4557
4658 if (item.pendingPayoutValue != null ) {
47- rowChildren
48- .. add (gap ())
49- .. add ( ThreadEarnings (
59+ addSpacer ();
60+ rowChildren. add (
61+ ThreadEarnings (
5062 pendingPayoutvalue: item.pendingPayoutValue,
5163 iconColor: iconColor,
5264 iconGap: iconGap,
5365 textStyle: style (theme),
54- ));
66+ ),
67+ );
5568 }
5669
57- rowChildren
58- .. add ( gap ())
59- . .add (
70+ if (showVoteAndComment && ! hideCommentInfo) {
71+ addSpacer ();
72+ rowChildren .add (
6073 IconWithText (
6174 onTap: () {
6275 if (! removeCommentGesture) {
6376 context.pushNamed (Routes .commentDetailView, extra: item);
6477 }
65- // if (context.read<UserController>().isUserLoggedIn) {
66- // context.pushNamed(
67- // Routes.addCommentView,
68- // queryParameters: {
69- // RouteKeys.accountName: item.author,
70- // RouteKeys.permlink: item.permlink
71- // },
72- // );
73- // }
7478 },
7579 icon: Icons .comment,
7680 iconColor: iconColor,
@@ -79,34 +83,36 @@ class InteractionTile extends StatelessWidget {
7983 iconGap: iconGap,
8084 textStyle: style (theme),
8185 ),
82- )
83- ..add (gap ())
84- ..add (
85- IconWithText (
86- onTap: () {
87- Share .share (
88- 'https://ecency.com/${item .category }/@${item .author }/${item .permlink }' );
89- },
86+ );
87+ }
88+
89+ addSpacer ();
90+ rowChildren.add (
91+ IconWithText (
92+ onTap: () {
93+ Share .share (
94+ 'https://ecency.com/${item .category }/@${item .author }/${item .permlink }' );
95+ },
96+ borderRadius: borderRadius,
97+ icon: Icons .share,
98+ iconColor: iconColor,
99+ ),
100+ );
101+
102+ addSpacer ();
103+ rowChildren.add (
104+ BookmarkButton (
90105 borderRadius: borderRadius,
91- icon: Icons .share,
92106 iconColor: iconColor,
93- ),
94- )
95- ..add (gap ())
96- ..add (
97- BookmarkButton (
98- borderRadius: borderRadius,
99- iconColor: iconColor,
100- isBookmarked:
101- bookmarkProvider.isBookmarkPresent (item.idString),
102- onAdd: () {
103- bookmarkProvider.addBookmark (item.idString, item);
104- },
105- onRemove: () {
106- bookmarkProvider.removeBookmark (item.idString);
107- },
108- toastType: '${item .author }/${item .permlink }' ),
109- );
107+ isBookmarked: bookmarkProvider.isBookmarkPresent (item.idString),
108+ onAdd: () {
109+ bookmarkProvider.addBookmark (item.idString, item);
110+ },
111+ onRemove: () {
112+ bookmarkProvider.removeBookmark (item.idString);
113+ },
114+ toastType: '${item .author }/${item .permlink }' ),
115+ );
110116
111117 return Padding (
112118 padding: const EdgeInsets .only (right: 4 ),
0 commit comments