Using a Mac? You might find www.synapsemac.com useful :)

Wednesday, 8 February 2023

Get list from firebase and check value in list - flutter



Future checkBookmarkOrNot(String checkerUid) async {
    List<dynamic> arrayField = [];
    var userSnap = await FirebaseFirestore.instance
        .collection('users')
        .doc(_auth.currentUser!.uid)
        .get();
    arrayField = userSnap['bookmarkUids'];
    bool have = arrayField.contains(checkerUid);
    return have; } 


s
have is bool value which is true when checkuid in bookmarkUids array

No comments:

Post a Comment