Fix geopoint doesn't working
This commit is contained in:
parent
5c318b39dd
commit
d212f9f31c
@ -32,6 +32,26 @@ void showNewOrUpdateGeoPoint(MapDTO mapDTO, GeoPointDTO? inputGeoPointDTO, Funct
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var defaultPosition = LatLong(50.429333, 4.891434); // Default Namur
|
||||||
|
var pointPosition;
|
||||||
|
|
||||||
|
if(geoPointDTO.geometry != null) {
|
||||||
|
switch(geoPointDTO.geometry!.type) {
|
||||||
|
case "Point":
|
||||||
|
var coordinates = geoPointDTO.geometry!.coordinates as List<dynamic>;
|
||||||
|
pointPosition = LatLong(coordinates.first, coordinates.last);
|
||||||
|
break;
|
||||||
|
case "LineString":
|
||||||
|
pointPosition = LatLong(50.429333, 4.891434); // TODO default Namur
|
||||||
|
break;
|
||||||
|
case "Polygon":
|
||||||
|
pointPosition = LatLong(50.429333, 4.891434); // TODO default Namur
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
LatLong initPosition = geoPointDTO.geometry == null ? defaultPosition : pointPosition;
|
||||||
|
|
||||||
Size size = MediaQuery.of(context).size;
|
Size size = MediaQuery.of(context).size;
|
||||||
showDialog(
|
showDialog(
|
||||||
builder: (BuildContext context) => AlertDialog(
|
builder: (BuildContext context) => AlertDialog(
|
||||||
@ -51,7 +71,7 @@ void showNewOrUpdateGeoPoint(MapDTO mapDTO, GeoPointDTO? inputGeoPointDTO, Funct
|
|||||||
height: 350,
|
height: 350,
|
||||||
child: FlutterLocationPicker(
|
child: FlutterLocationPicker(
|
||||||
initZoom: 14,
|
initZoom: 14,
|
||||||
initPosition: /*geoPointDTO.latitude == null && geoPointDTO.longitude == null ?*/ LatLong(50.429333, 4.891434) /*: LatLong(double.parse(geoPointDTO.latitude!), double.parse(geoPointDTO.longitude!))*/,
|
initPosition: initPosition,
|
||||||
minZoomLevel: 0,
|
minZoomLevel: 0,
|
||||||
maxZoomLevel: 17,
|
maxZoomLevel: 17,
|
||||||
markerIcon: const Icon(
|
markerIcon: const Icon(
|
||||||
@ -78,13 +98,12 @@ void showNewOrUpdateGeoPoint(MapDTO mapDTO, GeoPointDTO? inputGeoPointDTO, Funct
|
|||||||
onError: (e) => print(e),
|
onError: (e) => print(e),
|
||||||
selectLocationButtonLeadingIcon: const Icon(Icons.check, color: kPrimaryColor),
|
selectLocationButtonLeadingIcon: const Icon(Icons.check, color: kPrimaryColor),
|
||||||
onPicked: (pickedData) {
|
onPicked: (pickedData) {
|
||||||
print("TODO !");
|
geoPointDTO.geometry = new GeometryDTO(type: "Point", coordinates: [pickedData.latLong.latitude, pickedData.latLong.longitude]);
|
||||||
/*geoPointDTO.latitude = pickedData.latLong.latitude.toString();
|
|
||||||
geoPointDTO.longitude = pickedData.latLong.longitude.toString();*/
|
|
||||||
},
|
},
|
||||||
onChanged: (pickedData) {
|
onChanged: (pickedData) {
|
||||||
/*print("onChanged");
|
print("onChanged");
|
||||||
print(pickedData.latLong.latitude);
|
geoPointDTO.geometry = new GeometryDTO(type: "Point", coordinates: [pickedData.latLong.latitude, pickedData.latLong.longitude]);
|
||||||
|
/*print(pickedData.latLong.latitude);
|
||||||
print(pickedData.latLong.longitude);
|
print(pickedData.latLong.longitude);
|
||||||
print(pickedData.address);
|
print(pickedData.address);
|
||||||
print(pickedData.addressData);*/
|
print(pickedData.addressData);*/
|
||||||
@ -353,11 +372,11 @@ void showNewOrUpdateGeoPoint(MapDTO mapDTO, GeoPointDTO? inputGeoPointDTO, Funct
|
|||||||
color: kPrimaryColor,
|
color: kPrimaryColor,
|
||||||
textColor: kWhite,
|
textColor: kWhite,
|
||||||
press: () {
|
press: () {
|
||||||
print("TODO");
|
//print("TODO");
|
||||||
/*if (geoPointDTO.latitude != null && geoPointDTO.longitude != null) {
|
if (geoPointDTO.geometry != null && geoPointDTO.geometry!.coordinates != null) {
|
||||||
getResult(geoPointDTO);
|
getResult(geoPointDTO);
|
||||||
Navigator.of(context).pop();
|
Navigator.of(context).pop();
|
||||||
}*/
|
}
|
||||||
},
|
},
|
||||||
fontSize: 20,
|
fontSize: 20,
|
||||||
),
|
),
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
// Openapi Generator last run: : 2025-11-21T15:08:31.489558
|
// Openapi Generator last run: : 2025-11-27T16:46:46.408321
|
||||||
import 'package:openapi_generator_annotations/openapi_generator_annotations.dart';
|
import 'package:openapi_generator_annotations/openapi_generator_annotations.dart';
|
||||||
|
|
||||||
@Openapi(
|
@Openapi(
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
"info": {
|
"info": {
|
||||||
"title": "Manager Service",
|
"title": "Manager Service",
|
||||||
"description": "API Manager Service",
|
"description": "API Manager Service",
|
||||||
"version": "Version Alpha"
|
"version": "Version Alpha 0.0"
|
||||||
},
|
},
|
||||||
"servers": [
|
"servers": [
|
||||||
{
|
{
|
||||||
@ -4341,7 +4341,7 @@
|
|||||||
"content": {
|
"content": {
|
||||||
"application/json": {
|
"application/json": {
|
||||||
"schema": {
|
"schema": {
|
||||||
"$ref": "#/components/schemas/GeoPoint"
|
"$ref": "#/components/schemas/GeoPointDTO"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -281,9 +281,3 @@ lib/model/video_dto.dart
|
|||||||
lib/model/weather_dto.dart
|
lib/model/weather_dto.dart
|
||||||
lib/model/web_dto.dart
|
lib/model/web_dto.dart
|
||||||
pubspec.yaml
|
pubspec.yaml
|
||||||
test/game_dto_all_of_puzzle_image_test.dart
|
|
||||||
test/game_dto_test.dart
|
|
||||||
test/game_types_test.dart
|
|
||||||
test/guided_path_section_game_test.dart
|
|
||||||
test/section_game_all_of_game_puzzle_image_test.dart
|
|
||||||
test/section_game_test.dart
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@ API Manager Service
|
|||||||
|
|
||||||
This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
||||||
|
|
||||||
- API version: Version Alpha
|
- API version: Version Alpha 0.0
|
||||||
- Generator version: 7.9.0
|
- Generator version: 7.9.0
|
||||||
- Build package: org.openapitools.codegen.languages.DartClientCodegen
|
- Build package: org.openapitools.codegen.languages.DartClientCodegen
|
||||||
|
|
||||||
|
|||||||
@ -417,7 +417,7 @@ Name | Type | Description | Notes
|
|||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
# **sectionMapUpdate**
|
# **sectionMapUpdate**
|
||||||
> GeoPoint sectionMapUpdate(geoPointDTO)
|
> GeoPointDTO sectionMapUpdate(geoPointDTO)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -446,7 +446,7 @@ Name | Type | Description | Notes
|
|||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
[**GeoPoint**](GeoPoint.md)
|
[**GeoPointDTO**](GeoPointDTO.md)
|
||||||
|
|
||||||
### Authorization
|
### Authorization
|
||||||
|
|
||||||
|
|||||||
@ -577,7 +577,7 @@ class SectionMapApi {
|
|||||||
/// Parameters:
|
/// Parameters:
|
||||||
///
|
///
|
||||||
/// * [GeoPointDTO] geoPointDTO (required):
|
/// * [GeoPointDTO] geoPointDTO (required):
|
||||||
Future<GeoPoint?> sectionMapUpdate(
|
Future<GeoPointDTO?> sectionMapUpdate(
|
||||||
GeoPointDTO geoPointDTO,
|
GeoPointDTO geoPointDTO,
|
||||||
) async {
|
) async {
|
||||||
final response = await sectionMapUpdateWithHttpInfo(
|
final response = await sectionMapUpdateWithHttpInfo(
|
||||||
@ -593,8 +593,8 @@ class SectionMapApi {
|
|||||||
response.statusCode != HttpStatus.noContent) {
|
response.statusCode != HttpStatus.noContent) {
|
||||||
return await apiClient.deserializeAsync(
|
return await apiClient.deserializeAsync(
|
||||||
await _decodeBodyBytes(response),
|
await _decodeBodyBytes(response),
|
||||||
'GeoPoint',
|
'GeoPointDTO',
|
||||||
) as GeoPoint;
|
) as GeoPointDTO;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user