Skip to content

Commit 946e401

Browse files
committed
🐛 (fix) onlike clicked error on console fix
1.:bug: #10 (comment)
1 parent e6de564 commit 946e401

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

lib/widgets/tweet/widgets/tweetIconsRow.dart

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@ class TweetIconsRow extends StatelessWidget {
5151
iconColor: iconColor,
5252
size: size ?? 20,
5353
onPressed: () {
54-
var state = Provider.of<FeedState>(
55-
context,
56-
);
54+
var state = Provider.of<FeedState>(context, listen: false);
5755
state.setTweetToReply = model;
5856
Navigator.of(context).pushNamed('/ComposeTweetPage');
5957
},
@@ -221,12 +219,8 @@ class TweetIconsRow extends StatelessWidget {
221219
}
222220

223221
void addLikeToTweet(BuildContext context) {
224-
var state = Provider.of<FeedState>(
225-
context,
226-
);
227-
var authState = Provider.of<AuthState>(
228-
context,
229-
);
222+
var state = Provider.of<FeedState>(context, listen: false);
223+
var authState = Provider.of<AuthState>(context, listen: false);
230224
state.addLikeToTweet(model, authState.userId);
231225
}
232226

0 commit comments

Comments
 (0)