I have a function called pushRequest that sets value in the Firestore. The data I am trying to push is a Map<String, Map<String, String>>, and the kEY to the map is randomly generated to i am having trouble Pulling the data from the Firestore using StreamBuilders. Could anyone help me with this issue or is it even possible to Pull data without knowing the KEY
String createId() {
String date = formatDate(DateTime.now(), [yyyy, mm, dd]);
String string = randomAlphaNumeric(5).toUpperCase();
String id = '$date-$string';
return id.toString();
}
pushRequest({
@required int categpryId,
@required String location,
@required String fullName,
@required String emailId,
@required String mobileNumber,
@required String date,
@required String comment,
@required BuildContext context,
}) {
String orderId = createId();
var user = context.read<User>();
var dataMap = {
"categoryId": categpryId,
"location": location,
"fullname": fullName,
"emailId": emailId,
"mobileNumber": mobileNumber,
"date": date,
"comment": comment,
};
_firebaseFirestore.collection("Active").doc("1").set(
{
orderId: dataMap,
},
);
}