Skip to content

Instantly share code, notes, and snippets.

@TarunNagaSai
Created January 19, 2023 18:36
Show Gist options
  • Select an option

  • Save TarunNagaSai/77ff27a166a0dbca24a4ae0108eca963 to your computer and use it in GitHub Desktop.

Select an option

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
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