Created
January 19, 2023 18:36
-
-
Save TarunNagaSai/77ff27a166a0dbca24a4ae0108eca963 to your computer and use it in GitHub Desktop.
Using binding to create an instance of the controller will helps to access it in the entire app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:get/get.dart'; | |
| import 'package:no_internet_configuration/controller/internet_service_controller.dart'; | |
| /// Initial bindings to the app | |
| class InitialBindings extends Bindings { | |
| @override | |
| void dependencies() { | |
| Get.put<NetworkServicesController>( | |
| NetworkServicesController(), | |
| /// passing it true will keep the controller instance in the app memory | |
| /// untill the app is complelty closed | |
| permanent: true, | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment