10/6/1
This commit is contained in:
@@ -7,3 +7,32 @@ void launchUrl1(String url) async {
|
||||
print('Could not launch $url');
|
||||
}
|
||||
}
|
||||
|
||||
void launchCommunication(
|
||||
String method, String contactInfo, String message) async {
|
||||
String url;
|
||||
|
||||
switch (method) {
|
||||
case 'phone':
|
||||
url = 'tel:$contactInfo';
|
||||
break;
|
||||
case 'sms':
|
||||
url = 'sms:$contactInfo?body=$message';
|
||||
break;
|
||||
case 'whatsapp':
|
||||
url = 'whatsapp://send?phone=$contactInfo&text=$message';
|
||||
break;
|
||||
case 'email':
|
||||
url = 'mailto:$contactInfo?subject=Subject&body=$message';
|
||||
break;
|
||||
default:
|
||||
print('Invalid communication method');
|
||||
return;
|
||||
}
|
||||
|
||||
if (await canLaunchUrl(Uri.parse(url))) {
|
||||
launchUrl(Uri.parse(url));
|
||||
} else {
|
||||
print('Could not launch $url');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,10 +77,10 @@ class LocationController extends GetxController {
|
||||
: null)!;
|
||||
|
||||
// Print location details
|
||||
// print('Accuracy: ${_locationData.accuracy}');
|
||||
// print('Latitude: ${_locationData.latitude}');
|
||||
// print('Longitude: ${_locationData.longitude}');
|
||||
// print('Time: ${_locationData.time}');
|
||||
print('Accuracy: ${_locationData.accuracy}');
|
||||
print('Latitude: ${_locationData.latitude}');
|
||||
print('Longitude: ${_locationData.longitude}');
|
||||
print('Time: ${_locationData.time}');
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user