Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show only verified users tweets on feed page #149

Closed
ublockme opened this issue Apr 22, 2021 · 9 comments
Closed

Show only verified users tweets on feed page #149

ublockme opened this issue Apr 22, 2021 · 9 comments

Comments

@ublockme
Copy link

Hi brother! Hope well!

I just want to change news feed to show only verified users post (no followers post) for discover page. Can you guide me please.

@TheAlphamerc
Copy link
Owner

If you want to display tweets of verified user then check for isVarified value in model.user.isVarified value and apply conditions according to it to display tweets.

@ublockme
Copy link
Author

ublockme commented Apr 23, 2021

Like this brother? 👇

` List list;

if (!isBusy && feedlist != null && feedlist.isNotEmpty) {
  list = feedlist.where((x) {
    /// If Tweet is a comment then no need to add it in tweet list
    if (x.parentkey != null &&
        x.childRetwetkey == null &&
        x.user.userId != userModel.userId) {
      return false;
    }

    /// Only include Tweets of logged-in user's and verified users
    if (x.user.userId == userModel.userId ||
        (userModel?.isVerified != null &&
            userModel.isVerified.contains(x.user.userId))) {
      return true;`

@TheAlphamerc
Copy link
Owner

Try this.

if (x.user.userId == userModel.userId || (userModel?.followingList != null
 &&  userModel.followingList.contains(x.user.userId) && x.user.isVerified)) {
      return true;
   } else {
     return false;
  }

@ublockme
Copy link
Author

Ok brother i will but I don't wanna show following tweets so can I remove it like this?

if (x.user.userId == userModel.userId || (userModel?.followingList != null
 && x.user.isVerified)) {
      return true;
   } else {
     return false;
  }

@TheAlphamerc
Copy link
Owner

If you don't want to see following user's tweets then use below.

if (x.user.userId == userModel.userId || (userModel?.followingList != null
 &&  !userModel.followingList.contains(x.user.userId) && x.user.isVerified)) {
      return true;
   } else {
     return false;
  }

@ublockme
Copy link
Author

Ok i try and tell u brother.

@ublockme
Copy link
Author

ublockme commented Apr 24, 2021

Only this code working well brother to show only verified users tweet on feed page

if (x.user.userId == userModel.userId || (x.user.isVerified)) {
      return true;
   } else {
     return false;
  }

@TheAlphamerc
Copy link
Owner

Yes this code will work but you also will be able to see all users tweets whether you are following them or not.

@ublockme
Copy link
Author

Yes thats what i need 😜
Thank u brother
I close this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants