GetX Controller not found, you need to call Get.put or Get.lazyPut error when both controllers depend on each other

Viewed 467

I have two GetX controllers in separate files. Each depends on each other. I get the error saying that the "GetX Controller not found, you need to call Get.put or Get.lazyPut" on initialization because one or the other is not created yet.

I looked at lazyput and thought that it might be a solution but I couldn't get it to work.

In C++ I could just do a forward declaration.

What is the correct approach in GetX when there is interdependency like that?

1 Answers

Refer this sample code for GetX controller. getx_sample

Related