OPTMUM USAGE for Get.find<AnyController>() #3368
erenkirkil
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How do you use get.find? Do you use it in initstate by defining late in stateful pages or do you access it with the getter method or do you send the controller variable via the constructor?
In order to access data in a controller on any page, function or class, do I need to call Get.find() within the page or should I send it with Contructor?
The reason I ask this is whether Get.find calls will tire the application and especially when I split widgets into different dart files, I need Get.find() to access the data.
For Stateful Pages
late AnyController anyController;
or just
AnyController get anyController => Get.find<AnyController>();
For Stateless Pages
For AnyClass
Beta Was this translation helpful? Give feedback.
All reactions