Merhaba ;
flutter da qr kod butonuna basıldığında konum alan bir işlem yaptım. bu işlem sanal emulatörde sorunsuz çalışıyor. bazı telefonlar da normal çalışıyor. ancak Turkcel Tablette debug modda uygulamayı çalıştırdığımda konum alma işlemini yapmıyor ve consol’da Surface::setBuffersDimensions(this=0xb45ab600,w=800,h=1216) yazıyor. sorun nedir ?
Future<void> _getCurrentLocation() async {
bool serviceEnabled;
LocationPermission permission;
// Test if location services are enabled.
serviceEnabled = await Geolocator.isLocationServiceEnabled();
print("Servis İzni : $serviceEnabled");
if (!serviceEnabled) {
// Location services are not enabled don't continue
// accessing the position and request users of the
// App to enable the location services.
await Geolocator.openLocationSettings();
return Future.error('Location services are disabled.');
}
permission = await Geolocator.checkPermission();
if (permission == LocationPermission.denied) {
permission = await Geolocator.requestPermission();
if (permission == LocationPermission.denied) {
// Permissions are denied, next time you could try
// requesting permissions again (this is also where
// Android's shouldShowRequestPermissionRationale
// returned true. According to Android guidelines
// your App should show an explanatory UI now.
return Future.error('Location permissions are denied');
}
}
if (permission == LocationPermission.deniedForever) {
// Permissions are denied forever, handle appropriately.
return Future.error(
'Location permissions are permanently denied, we cannot request permissions.');
}
Geolocator.getCurrentPosition(
desiredAccuracy: LocationAccuracy.high,
forceAndroidLocationManager: true)
.then((Position position) {
setState(() {
_currentPosition = position;
KonumBelirlimi = "1";
});
}).catchError((e) {
print("Hata : $e");
KonumBelirlimi = "0";
});
}