anchor.diff:          Expanded(child: SizedBox()),
           StreamBuilder(
             stream: FlutterBlue.instance.state,
  -          builder: (context,  snapshot){
  +          builder: (context, snapshot) {
               print("Future instance is: " + snapshot.data.toString());
  -            if(snapshot.hasData){
  +            if (snapshot.hasData) {
                 return Switch(
                   value: bluetoothStarted(context, snapshot),
                   onChanged: (permissionGranted) {
  -
                     startBluetooth(context, permissionGranted);
                     bool forceOff = false;
  -                  if(((snapshot.data as BluetoothState == BluetoothState.unauthorized )  ||(snapshot.data as BluetoothState == BluetoothState.off ) )&& permissionGranted){
  +                  if (((snapshot.data as BluetoothState ==
  +                              BluetoothState.unauthorized) ||
  +                          (snapshot.data as BluetoothState ==
  +                              BluetoothState.off)) &&
  +                      permissionGranted) {
                       forceOff = true;
                       showDialog(
                           context: context,
  
positive.code:   bool bluetoothStarted(BuildContext context, AsyncSnapshot<dynamic> snapshot) {
      _bluetoothSingleton = AdvancedWayfindingSingleton();
  
      if(( snapshot.data as BluetoothState == BluetoothState.unauthorized) || (_bluetoothSingleton != null && !_bluetoothSingleton.advancedWayfindingEnabled)){
        _bluetoothSingleton.advancedWayfindingEnabled = false;
      }
        return _bluetoothSingleton.advancedWayfindingEnabled;
    }
    void checkToResumeBluetooth(BuildContext context) async{
  
      SharedPreferences prefs = await SharedPreferences.getInstance();
  
      if(prefs.containsKey("advancedWayfindingEnabled") && prefs.getBool('advancedWayfindingEnabled')){
        print(prefs.getBool("advancedWayfindingEnabled"));
        AdvancedWayfindingSingleton bluetoothSingleton = AdvancedWayfindingSingleton();
        if(bluetoothSingleton.firstInstance) {
          bluetoothSingleton.firstInstance = false;
          print("Instance: "+ bluetoothSingleton.firstInstance.toString());
          if(bluetoothSingleton.userDataProvider == null) {
            bluetoothSingleton.userDataProvider =
                Provider.of<UserDataProvider>(context, listen: false);
          }
  
negative.code:                         });
                    }
                    setState(() {
                      if (forceOff) {
                        _bluetoothSingleton.advancedWayfindingEnabled = false;
                      } else {
                        _bluetoothSingleton.advancedWayfindingEnabled =
                            !_bluetoothSingleton.advancedWayfindingEnabled;
                      }
  
                      if (!_bluetoothSingleton.advancedWayfindingEnabled) {
                        _bluetoothSingleton.stopScans();
                      }
                      SharedPreferences.getInstance().then((value) {
                        value.setBool("advancedWayfindingEnabled",
                            _bluetoothSingleton.advancedWayfindingEnabled);
                      });
                    });
                  },
                  activeColor: ColorPrimary,
                );
              } else {
                return CircularProgressIndicator();
              }
            },
          ),
        ],
      );
    }
  