I want to run dart code in background as well as when app is killed. I am making app related to when user is outside of radius (double value), I will call API using Dio. I had tried some packages to run code in background but couldnt go well. I am using Getx package. If anyone could share the code how to run code in background and app killed, it will be really helpful for me. I dont want to run code in main.dart file. You can make any controller file or something else to explain it. Thank You!
Code: class RadiusMonitorController extends GetxController with WidgetsBindingObserver {
}
lets say when this controller is registered i want to perform operations in this controller when app is in background/killed.