forceOpenLocation method

dynamic forceOpenLocation(
  1. BuildContext contenyat
)

Implementation

forceOpenLocation(BuildContext contenyat) {
  Helper().modalSellOn(contenyat,
      barierDismisable: true,
      message: "Turn on your GPS location",
      alone: true, onOke: () {
        if (Platform.isAndroid) {
          const AndroidIntent intent = AndroidIntent(
            action: 'action_location_source_settings',
          );

          Navigator.pop(contenyat);
          Future.delayed(Duration(seconds: 1)).then((value) async {
            intent.launch();
          });
        } else {
          Navigator.pop(contenyat);
          AppSettings().openLocation().then((value) {
            Navigator.pop(contenyat);
          });
        }
      });
}