8-13/
This commit is contained in:
@@ -25,9 +25,10 @@ class CRUD {
|
||||
if (response.statusCode == 200) {
|
||||
var jsonData = jsonDecode(response.body);
|
||||
if (jsonData['status'] == 'success') {
|
||||
print(jsonData['message']);
|
||||
return jsonData['message'];
|
||||
print(jsonData['data']);
|
||||
return response.body;
|
||||
}
|
||||
return response.body;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +48,7 @@ class CRUD {
|
||||
'Basic ${base64Encode(utf8.encode(AppCredintials.basicAuthCredentials))}',
|
||||
},
|
||||
);
|
||||
|
||||
print(response.request);
|
||||
if (response.statusCode == 200) {
|
||||
var jsonData = jsonDecode(response.body);
|
||||
if (jsonData['status'] == 'success') {
|
||||
@@ -57,12 +58,9 @@ class CRUD {
|
||||
);
|
||||
|
||||
return response.body;
|
||||
} else if (jsonData['status'] == 'success1') {
|
||||
print(jsonData['data']);
|
||||
return jsonData;
|
||||
}
|
||||
}
|
||||
return (response.body);
|
||||
// return (response.body);
|
||||
}
|
||||
|
||||
Future<dynamic> getGoogleApi({
|
||||
|
||||
16
lib/controller/functions/location_permission.dart
Normal file
16
lib/controller/functions/location_permission.dart
Normal file
@@ -0,0 +1,16 @@
|
||||
import 'package:location/location.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class LocationPermissions {
|
||||
late Location location;
|
||||
|
||||
Future locationPermissions() async {
|
||||
location = Location();
|
||||
var permissionStatus = await location.requestPermission();
|
||||
if (permissionStatus == PermissionStatus.denied) {
|
||||
// The user denied the location permission.
|
||||
Get.defaultDialog(title: 'GPS Required Allow !.'.tr, middleText: '');
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user