new branch

This commit is contained in:
2025-04-14 11:26:43 +07:00
parent 30ee4540ba
commit d5b323e158
64 changed files with 1001 additions and 300 deletions

View File

@@ -43,21 +43,22 @@ class MapServices {
List<LatLng> polylineCoordinates = [];
PolylinePoints polylinePoints = PolylinePoints();
PolylineResult result = await polylinePoints.getRouteBetweenCoordinates(
ApplicationConstants.MAP_KEY,
PointLatLng(origin.latitude, origin.longitude),
PointLatLng(destination.latitude, destination.longitude),
travelMode: TravelMode.driving,
optimizeWaypoints: true);
if (result.points.isNotEmpty) {
for (var point in result.points) {
polylineCoordinates.add(LatLng(point.latitude, point.longitude));
}
return polylineCoordinates;
} else {
log("Lỗi khi tìm đường");
return [];
}
// PolylineResult result = await polylinePoints.getRouteBetweenCoordinates(
// ApplicationConstants.MAP_KEY,
// PointLatLng(origin.latitude, origin.longitude),
// PointLatLng(destination.latitude, destination.longitude),
// travelMode: TravelMode.driving,
// optimizeWaypoints: true);
// if (result.points.isNotEmpty) {
// for (var point in result.points) {
// polylineCoordinates.add(LatLng(point.latitude, point.longitude));
// }
// return polylineCoordinates;
// } else {
// log("Lỗi khi tìm đường");
// return [];
// }
return [];
}
}

View File

@@ -39,7 +39,9 @@ class NotificationServices {
}
Future<String> getDeviceToken() async {
String? token = await messaging.getToken();
print("GET FB TOKEN");
String? token = await messaging.getAPNSToken();
print("GET FB: ${token}");
return token!;
}
@@ -50,6 +52,9 @@ class NotificationServices {
}
Future<void> showNotification(RemoteMessage message) async {
dev.log(message.toString());
dev.log(message.data.toString());
dev.log(message.data["notification"].toString());
String? title = message.data['title'];
String? body = message.data['body'];
String type = message.data['type'] ?? "normal";