Home > Software engineering >  dart/flutter:: type 'Null' is not a subtype of type 'String' in type cast ERRor,
dart/flutter:: type 'Null' is not a subtype of type 'String' in type cast ERRor,

Time:10-02

I am running into a "type 'Null' is not a subtype of type 'String' in type cast" when I try to retrieve the data.

not sure what the issue is... I think the data is not being found or something along those lines

source code:: Job application firebase Job firebase ERROR, line 75

CodePudding user response:

Try like this

  CloudJobApplication.fromSnapshot(
      QueryDocumentSnapshot<Map<String, dynamic>> snapshot)
      : documentId = snapshot.id,
        jobApplicatorId = snapshot.data()[jobApplicatorIdColumn] ?? "",
        jobApplicationState = snapshot.get(jobApplicationStateColumn) ?? "",
        jobApplicationSubState =
            snapshot.get(jobApplicationSubStateColumn) ?? "";
  • Related