I have a problem with Null Safety an the problem is 'Null check operator used on a null value'

Issue It happened when getting some data from firebase and decoding them using model, and here is the method: UserModel? userModel; void getUser() { emit(GetUserLoadingsState()); FirebaseFirestore.instance.collection(‘users’).doc(uId).get().then((value) { userModel = UserModel.fromJson(value.data()!); emit(GetUserSuccessState()); }).catchError((error) { emit(GetUserErrorState(error.toString())); }); } Calling the method return

Continue reading