Question might be misleading, but I’m currently working on a project where I use Get.toNamed
a lot and I’m sending some data every time. But, when I hot reload the changes I get
════════ Exception caught by widgets library ═══════════════════════════════════
type 'Null' is not a subtype of type `int`
and I’m changing route with
onTap: () {
print(_sliderValue);
Get.toNamed('/stations/detail/booking', arguments: {
'duration': _sliderValue,
});
},
Is there any proper way of not losing data while routing between pages or hot reload?
2
Answers
This may be because the variable is private with the underscore.
Try
sliderValue
instead of_sliderValue
Im always using Get.toNamed to send arguments but never found issue like this soo maybe you can try this
You can route to page by
SecondPage.show(somethingId : 'id#0');
and in controller