2

hi i want to know how te reset all value of controller in getx packages ?

I already tried

Get.reset();

but that's not working

B.Ghost
  • 200
  • 4
  • 15

3 Answers3

2

Get.deleteAll(); deletes all Instances Data Get.delete<ControllerName>(); to delete a particular controller Instance. Also, if you used GetxService then call Get.reset().

Ninad7N
  • 544
  • 4
  • 13
1

Get.reset() is for removing all pages that you added them in stack navigator and it is not for resetting the values of GetXController parameters if you want to reset controller values you must define your controller after build like this: Widget build(BuildContext context) {final MessageController msController = Get.put(MessageController());

0

You have to use force: true:

Get.delete<BookAppointmentController>(force: true);
Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
Kalyan Biswas
  • 350
  • 1
  • 3
  • 10