page route was working when I last wrote the code but that suddenly changed and I don’t know why that would happen.
here is the page route code:
void pinPage(LatLng point) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => pin_attributes(
key: const ValueKey(1),
local: point,
userId: userId,
)));
print("ran");
}
ran prints in the console, so it goes past the page route without actually routing the page
2
Answers
My mistake, the function was called then I tried Navigator.pop(context); to close the show dialog, and this caused it not to run properly. It worked after I modified it to first pop and then run the function.
Try changing code this way,
You can call pinPage() function from a widget,