update to 3.13
This commit is contained in:
@ -11,11 +11,11 @@ import '../utils/const.dart';
|
||||
|
||||
class DestinationService{
|
||||
|
||||
static Future<List<dynamic>> getDestinations(int user_id) async {
|
||||
static Future<List<dynamic>> getDestinations(int userId) async {
|
||||
List<dynamic> cats = [];
|
||||
String server_url = ConstValues.currentServer();
|
||||
String url = "${server_url}/api/destinations/?user_id=${user_id}";
|
||||
print('++++++++${url}');
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = "$serverUrl/api/destinations/?user_id=$userId";
|
||||
print('++++++++$url');
|
||||
final http.Response response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
@ -29,11 +29,11 @@ class DestinationService{
|
||||
return cats;
|
||||
}
|
||||
|
||||
static Future<Map<String, dynamic>> deleteDestination(int dest_id) async {
|
||||
static Future<Map<String, dynamic>> deleteDestination(int destId) async {
|
||||
Map<String, dynamic> cats = {};
|
||||
String server_url = ConstValues.currentServer();
|
||||
String url = "${server_url}/api/delete_destination/?dest_id=${dest_id}";
|
||||
print('++++++++${url}');
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = "$serverUrl/api/delete_destination/?dest_id=$destId";
|
||||
print('++++++++$url');
|
||||
final http.Response response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
@ -44,15 +44,15 @@ class DestinationService{
|
||||
if (response.statusCode == 200) {
|
||||
cats = json.decode(utf8.decode(response.bodyBytes));
|
||||
}
|
||||
print("####### ---- ${cats}");
|
||||
print("####### ---- $cats");
|
||||
return cats;
|
||||
}
|
||||
|
||||
static Future<int> updateOrder(int action_id, int order, String dir) async {
|
||||
static Future<int> updateOrder(int actionId, int order, String dir) async {
|
||||
int cats = 0;
|
||||
String server_url = ConstValues.currentServer();
|
||||
String url = "${server_url}/api/updateorder/?user_action_id=${action_id}&order=${order}&dir=${dir}";
|
||||
print('++++++++${url}');
|
||||
String serverUrl = ConstValues.currentServer();
|
||||
String url = "$serverUrl/api/updateorder/?user_action_id=$actionId&order=$order&dir=$dir";
|
||||
print('++++++++$url');
|
||||
final http.Response response = await http.get(
|
||||
Uri.parse(url),
|
||||
headers: <String, String>{
|
||||
@ -69,7 +69,7 @@ class DestinationService{
|
||||
static Future<List<PointLatLng>>? getDestinationLine(List<Destination> destinations, Map<String, dynamic> mtx) async{
|
||||
PolylinePoints polylinePoints = PolylinePoints();
|
||||
|
||||
if(destinations.length <= 0){
|
||||
if(destinations.isEmpty){
|
||||
return [];
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ class DestinationService{
|
||||
|
||||
int j = 0;
|
||||
|
||||
PolylineWayPoint pwp = PolylineWayPoint(location: "${la},${ln}", stopOver: false);
|
||||
PolylineWayPoint pwp = PolylineWayPoint(location: "$la,$ln", stopOver: false);
|
||||
|
||||
|
||||
//print("----- UUUUUU ${pwp}");
|
||||
@ -101,15 +101,15 @@ class DestinationService{
|
||||
}
|
||||
|
||||
final DestinationController destinationController = Get.find<DestinationController>();
|
||||
int trav_mode = destinationController.travelMode.value;
|
||||
String _mode = "WALKING";
|
||||
if(trav_mode == 1){
|
||||
int travMode = destinationController.travelMode.value;
|
||||
String mode = "WALKING";
|
||||
if(travMode == 1){
|
||||
//_mode = TravelMode.driving;
|
||||
_mode = "DRIVING";
|
||||
mode = "DRIVING";
|
||||
}
|
||||
else if(trav_mode == 2) {
|
||||
else if(travMode == 2) {
|
||||
//_mode = TravelMode.transit;
|
||||
_mode = "TRANSIT";
|
||||
mode = "TRANSIT";
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user