I searched a lot but couldn't find a solution. I need your help.
In my database model, I have a method like this to get the data:
Future<Map<String,dynamic>> getSystemSettings() async {
var response = await _firestore.collection("system").doc("settings").get();
return response.data();
}
Later, I want to use the data in the form of Map <String, dynamic> from the class I want to get the data from by calling the method as follows.
getValues() {
database.getSystemSettings().then((value) {
print("value");
print(value);
});
What I expect is to see my Map <String, dynamic> type data in place of value in the second code block, but I get the following error.
The method 'sistemAyarlariniAl' was called on null.
Receiver: null
Tried calling: sistemAyarlariniAl()
Can you help me with this? Where am I doing wrong?
database.getSystemSettings()? show your full code