The argument type 'List<dynamic>' can't be assigned to the parameter type 'String?'. In firebase document

Viewed 5

I try to update list of userUid at the same time but it says this The argument type 'List' can't be assigned to the parameter type 'String?'

var userDocumentUid = snapshot1.data?["members"];
///
onPressed: () async => {
         await DataBase().deleteGroup(userDocumentUid)
}
////
    Future<String> deleteGroup(String List<dynamic> userDocumentUid) async {
        String retVal = "error";
        try {
         await firestore
              .collection("users")
              .doc(userDocumentUid)
              .update({'groupId': ""});
    
          retVal = "success";
        } catch (e) {
          // ignore: avoid_print
          print(e);
        }
        return retVal;
      }

Is there anyway to get the doc as list not as only a string?

0 Answers
Related