update service generation + add multiple images to one geoPoint
This commit is contained in:
parent
5651022cce
commit
93b8dbeb92
@ -0,0 +1,151 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:manager_app/Screens/Configurations/Section/SubSection/Map/listView_card_geoPoint_images.dart';
|
||||
import 'package:manager_app/Screens/Resources/select_resource_modal.dart';
|
||||
import 'package:manager_app/app_context.dart';
|
||||
import 'package:manager_app/constants.dart';
|
||||
import 'package:managerapi/api.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class GeoPointImageList extends StatefulWidget {
|
||||
final List<ImageGeoPoint> images;
|
||||
final ValueChanged<List<ImageGeoPoint>> onChanged;
|
||||
const GeoPointImageList({
|
||||
Key key,
|
||||
this.images,
|
||||
this.onChanged,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
_GeoPointImageListState createState() => _GeoPointImageListState();
|
||||
}
|
||||
|
||||
class _GeoPointImageListState extends State<GeoPointImageList> {
|
||||
List<ImageGeoPoint> imagesGeo;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
imagesGeo = new List<ImageGeoPoint>.from(widget.images);
|
||||
|
||||
//imagesGeo = widget.images;
|
||||
}
|
||||
|
||||
void _onReorder(int oldIndex, int newIndex) {
|
||||
setState(
|
||||
() {
|
||||
if (newIndex > oldIndex) {
|
||||
newIndex -= 1;
|
||||
}
|
||||
final ImageGeoPoint item = imagesGeo.removeAt(oldIndex);
|
||||
imagesGeo.insert(newIndex, item);
|
||||
|
||||
/*var i = 0;
|
||||
menuDTO.sections.forEach((image) {
|
||||
//image.order = i; // TODO
|
||||
i++;
|
||||
});*/
|
||||
|
||||
widget.onChanged(imagesGeo);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final appContext = Provider.of<AppContext>(context);
|
||||
Size size = MediaQuery.of(context).size;
|
||||
|
||||
return Stack(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 10.0, right: 10.0, bottom: 10.0, top: 15.0),
|
||||
child: ReorderableListView(
|
||||
onReorder: _onReorder,
|
||||
scrollDirection: Axis.horizontal,
|
||||
padding: const EdgeInsets.symmetric(vertical: 20.0),
|
||||
children: List.generate(
|
||||
imagesGeo.length,
|
||||
(index) {
|
||||
return ListViewCardGeoPointImages(
|
||||
imagesGeo,
|
||||
index,
|
||||
Key('$index'),
|
||||
appContext,
|
||||
(imagesOutput) {
|
||||
setState(() {
|
||||
//List<ImageGeoPoint> test = new List<ImageGeoPoint>.from(imagesOutput);
|
||||
imagesGeo = imagesOutput;
|
||||
widget.onChanged(imagesGeo);
|
||||
});
|
||||
}
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 10,
|
||||
left: 10,
|
||||
child: Text(
|
||||
"Images test",
|
||||
style: TextStyle(fontSize: 15),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 10,
|
||||
right: 10,
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
showSelectResourceModal(
|
||||
"Sélectionner une ressource",
|
||||
(ResourceDTO resource) {
|
||||
setState(() {
|
||||
ImageGeoPoint newImage = new ImageGeoPoint( imageResourceId: resource.id, imageSource: resource.type == ResourceType.imageUrl ? resource.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resource.id);
|
||||
imagesGeo.add(newImage);
|
||||
});
|
||||
},
|
||||
1,
|
||||
true,
|
||||
context
|
||||
);
|
||||
/*showNewOrUpdateGeoPoint(
|
||||
null,
|
||||
(GeoPointDTO geoPoint) {
|
||||
setState(() {
|
||||
mapDTO.points.add(geoPoint);
|
||||
widget.onChanged(jsonEncode(mapDTO).toString());
|
||||
});
|
||||
},
|
||||
appContext,
|
||||
context);*/
|
||||
},
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.width * 0.04,
|
||||
width: MediaQuery.of(context).size.width * 0.04,
|
||||
child: Icon(
|
||||
Icons.add,
|
||||
color: kTextLightColor,
|
||||
size: 30.0,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.lightGreen,
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.circular(20.0),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: kSecond,
|
||||
spreadRadius: 0.5,
|
||||
blurRadius: 5,
|
||||
offset: Offset(0, 1.5), // changes position of shadow
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,138 @@
|
||||
import 'package:auto_size_text/auto_size_text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:manager_app/Components/fetch_section_icon.dart';
|
||||
import 'file:///C:/Users/Thomas%20Fransolet/Documents/Documents/Perso/MuseeDeLaFraise/manager-app/lib/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart';
|
||||
import 'file:///C:/Users/Thomas%20Fransolet/Documents/Documents/Perso/MuseeDeLaFraise/manager-app/lib/Screens/Configurations/Section/SubSection/Menu/showEditSubSection.dart';
|
||||
import 'package:manager_app/app_context.dart';
|
||||
import 'package:manager_app/constants.dart';
|
||||
import 'package:managerapi/api.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class ListViewCardGeoPointImages extends StatefulWidget {
|
||||
final int index;
|
||||
final Key key;
|
||||
final List<ImageGeoPoint> listImages;
|
||||
final AppContext appContext;
|
||||
final ValueChanged<List<ImageGeoPoint>> onChanged;
|
||||
|
||||
ListViewCardGeoPointImages(
|
||||
this.listImages,
|
||||
this.index,
|
||||
this.key,
|
||||
this.appContext,
|
||||
this.onChanged
|
||||
);
|
||||
|
||||
@override
|
||||
_ListViewCardGeoPointImagesState createState() => _ListViewCardGeoPointImagesState();
|
||||
}
|
||||
|
||||
class _ListViewCardGeoPointImagesState extends State<ListViewCardGeoPointImages> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final appContext = Provider.of<AppContext>(context);
|
||||
Size size = MediaQuery.of(context).size;
|
||||
|
||||
return Card(
|
||||
margin: EdgeInsets.all(4),
|
||||
child: Center(
|
||||
child: Stack(
|
||||
children: [
|
||||
Container(
|
||||
width: 200,
|
||||
height: 200,
|
||||
/*decoration: BoxDecoration(
|
||||
color: kWhite,
|
||||
border: Border.all(width: 0.5, color: kSecond),
|
||||
),*/
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(right: 30.0),
|
||||
child: getElement(widget.index, widget.listImages[widget.index], size, appContext)
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
child: Row(
|
||||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
widget.listImages.removeAt(widget.index);
|
||||
widget.onChanged(widget.listImages);
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Icon(
|
||||
Icons.delete,
|
||||
color: kPrimaryColor,
|
||||
size: 25.0,
|
||||
),
|
||||
)
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
getElement(int index, ImageGeoPoint imageGeoPoint, Size size, AppContext appContext) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
height: double.infinity,
|
||||
child: Stack(
|
||||
children: [
|
||||
Center(
|
||||
child: Image.network(
|
||||
imageGeoPoint.imageSource,
|
||||
fit:BoxFit.scaleDown
|
||||
),
|
||||
)
|
||||
/*Align(
|
||||
alignment: Alignment.center,
|
||||
child: AutoSizeText(
|
||||
imageGeoPoint.,
|
||||
style: new TextStyle(fontSize: 15),
|
||||
maxLines: 2,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),*/
|
||||
/*Positioned(
|
||||
top: 20,
|
||||
left: 20,
|
||||
child: Icon(
|
||||
getSectionIcon(sectionDTO.type),
|
||||
color: kSecond,
|
||||
size: 18.0,
|
||||
),
|
||||
),*/
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
boxDecoration(SectionDTO sectionDTO, appContext) {
|
||||
return BoxDecoration(
|
||||
color: kBackgroundColor,
|
||||
shape: BoxShape.rectangle,
|
||||
border: Border.all(width: 1.5, color: kSecond),
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
/*image: sectionDTO.title != null ? new DecorationImage(
|
||||
fit: BoxFit.scaleDown,
|
||||
/*image: new NetworkImage(
|
||||
sectionDTO.,
|
||||
),*/
|
||||
) : null,*/
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: kSecond,
|
||||
spreadRadius: 0.5,
|
||||
blurRadius: 5,
|
||||
offset: Offset(0, 1.5), // changes position of shadow
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
@ -5,7 +5,7 @@ import 'package:manager_app/Components/fetch_section_icon.dart';
|
||||
import 'package:manager_app/Components/image_input_container.dart';
|
||||
import 'package:manager_app/Components/multi_select_container.dart';
|
||||
import 'package:manager_app/Components/slider_input_container.dart';
|
||||
import 'package:manager_app/Screens/Configurations/Section/SubSection/showNewOrUpdateGeoPoint.dart';
|
||||
import 'file:///C:/Users/Thomas%20Fransolet/Documents/Documents/Perso/MuseeDeLaFraise/manager-app/lib/Screens/Configurations/Section/SubSection/Map/showNewOrUpdateGeoPoint.dart';
|
||||
import 'package:manager_app/app_context.dart';
|
||||
import 'package:manager_app/constants.dart';
|
||||
import 'package:managerapi/api.dart';
|
||||
@ -5,6 +5,7 @@ import 'package:manager_app/Components/rounded_button.dart';
|
||||
import 'package:manager_app/Components/string_input_container.dart';
|
||||
import 'package:manager_app/Components/text_form_input_container.dart';
|
||||
import 'package:manager_app/Models/managerContext.dart';
|
||||
import 'package:manager_app/Screens/Configurations/Section/SubSection/Map/image_reorderList.dart';
|
||||
import 'package:manager_app/app_context.dart';
|
||||
import 'package:manager_app/constants.dart';
|
||||
import 'package:managerapi/api.dart';
|
||||
@ -12,8 +13,6 @@ import 'package:managerapi/api.dart';
|
||||
void showNewOrUpdateGeoPoint(GeoPointDTO inputGeoPointDTO, Function getResult, AppContext appContext, BuildContext context) {
|
||||
GeoPointDTO geoPointDTO = new GeoPointDTO();
|
||||
|
||||
print("showNewOrUpdateGeoPoint");
|
||||
print(inputGeoPointDTO);
|
||||
if (inputGeoPointDTO != null) {
|
||||
geoPointDTO = inputGeoPointDTO;
|
||||
} else {
|
||||
@ -37,7 +36,7 @@ void showNewOrUpdateGeoPoint(GeoPointDTO inputGeoPointDTO, Function getResult, A
|
||||
borderRadius: BorderRadius.all(Radius.circular(20.0))
|
||||
),
|
||||
content: Container(
|
||||
width: size.width *0.5,
|
||||
width: size.width *0.7,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
@ -45,18 +44,7 @@ void showNewOrUpdateGeoPoint(GeoPointDTO inputGeoPointDTO, Function getResult, A
|
||||
Column(
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
ImageInputContainer(
|
||||
label: "Image :",
|
||||
initialValue: geoPointDTO.imageResourceId,
|
||||
color: kPrimaryColor,
|
||||
onChanged: (ResourceDTO resource) {
|
||||
geoPointDTO.imageSource = resource.type == ResourceType.imageUrl ? resource.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resource.id;
|
||||
geoPointDTO.imageResourceId = resource.id;
|
||||
},
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: [
|
||||
StringInputContainer(
|
||||
label: "Latitude :",
|
||||
@ -73,16 +61,37 @@ void showNewOrUpdateGeoPoint(GeoPointDTO inputGeoPointDTO, Function getResult, A
|
||||
},
|
||||
)
|
||||
],
|
||||
)
|
||||
],
|
||||
),
|
||||
Container(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
height: size.height * 0.33,
|
||||
width: double.infinity,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: getTranslations(context, appContext, geoPointDTO),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: size.height * 0.33,
|
||||
decoration: BoxDecoration(
|
||||
color: kWhite,
|
||||
shape: BoxShape.rectangle,
|
||||
border: Border.all(width: 1.5, color: kSecond),
|
||||
borderRadius: BorderRadius.circular(10.0),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: kSecond,
|
||||
spreadRadius: 0.5,
|
||||
blurRadius: 5,
|
||||
offset: Offset(0, 1.5), // changes position of shadow
|
||||
),
|
||||
],
|
||||
),
|
||||
child: GeoPointImageList(
|
||||
images: geoPointDTO.images,
|
||||
onChanged: (List<ImageGeoPoint> imagesOutput) {
|
||||
geoPointDTO.images = imagesOutput;
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@ -104,6 +113,9 @@ void showNewOrUpdateGeoPoint(GeoPointDTO inputGeoPointDTO, Function getResult, A
|
||||
icon: Icons.undo,
|
||||
color: kSecond,
|
||||
press: () {
|
||||
if (inputGeoPointDTO != null) {
|
||||
geoPointDTO.images = inputGeoPointDTO.images;
|
||||
}
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
fontSize: 20,
|
||||
@ -1,8 +1,8 @@
|
||||
import 'package:auto_size_text/auto_size_text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:manager_app/Components/fetch_section_icon.dart';
|
||||
import 'package:manager_app/Screens/Configurations/Section/SubSection/new_update_image_slider.dart';
|
||||
import 'package:manager_app/Screens/Configurations/Section/SubSection/showEditSubSection.dart';
|
||||
import 'file:///C:/Users/Thomas%20Fransolet/Documents/Documents/Perso/MuseeDeLaFraise/manager-app/lib/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart';
|
||||
import 'file:///C:/Users/Thomas%20Fransolet/Documents/Documents/Perso/MuseeDeLaFraise/manager-app/lib/Screens/Configurations/Section/SubSection/Menu/showEditSubSection.dart';
|
||||
import 'package:manager_app/app_context.dart';
|
||||
import 'package:manager_app/constants.dart';
|
||||
import 'package:managerapi/api.dart';
|
||||
@ -2,8 +2,7 @@ import 'package:auto_size_text/auto_size_text.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:manager_app/Components/fetch_section_icon.dart';
|
||||
import 'package:manager_app/Screens/Configurations/Section/SubSection/listView_card_image.dart';
|
||||
import 'package:manager_app/Screens/Configurations/Section/SubSection/listView_card_subSection.dart';
|
||||
import 'file:///C:/Users/Thomas%20Fransolet/Documents/Documents/Perso/MuseeDeLaFraise/manager-app/lib/Screens/Configurations/Section/SubSection/Menu/listView_card_subSection.dart';
|
||||
import 'package:manager_app/Screens/Configurations/new_section_popup.dart';
|
||||
import 'package:manager_app/app_context.dart';
|
||||
import 'package:manager_app/constants.dart';
|
||||
@ -5,13 +5,13 @@ import 'package:manager_app/Components/rounded_button.dart';
|
||||
import 'package:manager_app/Components/string_input_container.dart';
|
||||
import 'package:manager_app/Components/text_form_input_container.dart';
|
||||
import 'package:manager_app/Models/managerContext.dart';
|
||||
import 'package:manager_app/Screens/Configurations/Section/SubSection/slider_config.dart';
|
||||
import 'package:manager_app/Screens/Configurations/Section/SubSection/web_video_config.dart';
|
||||
import 'file:///C:/Users/Thomas%20Fransolet/Documents/Documents/Perso/MuseeDeLaFraise/manager-app/lib/Screens/Configurations/Section/SubSection/Slider/slider_config.dart';
|
||||
import 'file:///C:/Users/Thomas%20Fransolet/Documents/Documents/Perso/MuseeDeLaFraise/manager-app/lib/Screens/Configurations/Section/SubSection/WebOrVideo/web_video_config.dart';
|
||||
import 'package:manager_app/app_context.dart';
|
||||
import 'package:manager_app/constants.dart';
|
||||
import 'package:managerapi/api.dart';
|
||||
|
||||
import 'map_config.dart';
|
||||
import '../Map/map_config.dart';
|
||||
import 'menu_config.dart';
|
||||
|
||||
void showEditSubSection(SectionDTO subSectionDTO, Function getResult, AppContext appContext, BuildContext context) {
|
||||
@ -1,6 +1,6 @@
|
||||
import 'package:auto_size_text/auto_size_text.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:manager_app/Screens/Configurations/Section/SubSection/new_update_image_slider.dart';
|
||||
import 'file:///C:/Users/Thomas%20Fransolet/Documents/Documents/Perso/MuseeDeLaFraise/manager-app/lib/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart';
|
||||
import 'package:manager_app/app_context.dart';
|
||||
import 'package:manager_app/constants.dart';
|
||||
import 'package:managerapi/api.dart';
|
||||
@ -37,11 +37,15 @@ void showNewOrUpdateImageSlider(ImageDTO inputImageDTO, Function getResult, AppC
|
||||
width: size.width *0.5,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Text("Image/vidéo", style: new TextStyle(fontSize: 25, fontWeight: FontWeight.w400)),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
ImageInputContainer(
|
||||
Align(
|
||||
alignment: AlignmentDirectional.center,
|
||||
child: ImageInputContainer(
|
||||
label: "Image :",
|
||||
initialValue: imageDTO.resourceId,
|
||||
color: kPrimaryColor,
|
||||
@ -50,6 +54,7 @@ void showNewOrUpdateImageSlider(ImageDTO inputImageDTO, Function getResult, AppC
|
||||
imageDTO.resourceId = resource.id;
|
||||
},
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
@ -1,7 +1,7 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:manager_app/Screens/Configurations/Section/SubSection/listView_card_image.dart';
|
||||
import 'package:manager_app/Screens/Configurations/Section/SubSection/new_update_image_slider.dart';
|
||||
import 'file:///C:/Users/Thomas%20Fransolet/Documents/Documents/Perso/MuseeDeLaFraise/manager-app/lib/Screens/Configurations/Section/SubSection/Slider/listView_card_image.dart';
|
||||
import 'file:///C:/Users/Thomas%20Fransolet/Documents/Documents/Perso/MuseeDeLaFraise/manager-app/lib/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart';
|
||||
import 'package:manager_app/app_context.dart';
|
||||
import 'package:manager_app/constants.dart';
|
||||
import 'package:managerapi/api.dart';
|
||||
@ -8,8 +8,8 @@ import 'package:manager_app/Components/multi_string_input_container.dart';
|
||||
import 'package:manager_app/Components/rounded_button.dart';
|
||||
import 'package:manager_app/Components/string_input_container.dart';
|
||||
import 'package:manager_app/Models/managerContext.dart';
|
||||
import 'package:manager_app/Screens/Configurations/Section/SubSection/slider_config.dart';
|
||||
import 'package:manager_app/Screens/Configurations/Section/SubSection/web_video_config.dart';
|
||||
import 'file:///C:/Users/Thomas%20Fransolet/Documents/Documents/Perso/MuseeDeLaFraise/manager-app/lib/Screens/Configurations/Section/SubSection/Slider/slider_config.dart';
|
||||
import 'file:///C:/Users/Thomas%20Fransolet/Documents/Documents/Perso/MuseeDeLaFraise/manager-app/lib/Screens/Configurations/Section/SubSection/WebOrVideo/web_video_config.dart';
|
||||
import 'package:manager_app/app_context.dart';
|
||||
import 'package:manager_app/client.dart';
|
||||
import 'package:manager_app/constants.dart';
|
||||
@ -17,8 +17,8 @@ import 'package:managerapi/api.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
import 'SubSection/map_config.dart';
|
||||
import 'SubSection/menu_config.dart';
|
||||
import 'SubSection/Map/map_config.dart';
|
||||
import 'SubSection/Menu/menu_config.dart';
|
||||
|
||||
class SectionDetailScreen extends StatefulWidget {
|
||||
final String id;
|
||||
|
||||
@ -10,6 +10,7 @@ doc/DeviceDetailDTO.md
|
||||
doc/DeviceDetailDTOAllOf.md
|
||||
doc/GeoPointDTO.md
|
||||
doc/ImageDTO.md
|
||||
doc/ImageGeoPoint.md
|
||||
doc/LoginDTO.md
|
||||
doc/MapDTO.md
|
||||
doc/MapType.md
|
||||
@ -51,6 +52,7 @@ lib/model/device_detail_dto_all_of.dart
|
||||
lib/model/device_dto.dart
|
||||
lib/model/geo_point_dto.dart
|
||||
lib/model/image_dto.dart
|
||||
lib/model/image_geo_point.dart
|
||||
lib/model/login_dto.dart
|
||||
lib/model/map_dto.dart
|
||||
lib/model/map_type.dart
|
||||
|
||||
@ -111,6 +111,7 @@ Class | Method | HTTP request | Description
|
||||
- [DeviceDetailDTOAllOf](doc\/DeviceDetailDTOAllOf.md)
|
||||
- [GeoPointDTO](doc\/GeoPointDTO.md)
|
||||
- [ImageDTO](doc\/ImageDTO.md)
|
||||
- [ImageGeoPoint](doc\/ImageGeoPoint.md)
|
||||
- [LoginDTO](doc\/LoginDTO.md)
|
||||
- [MapDTO](doc\/MapDTO.md)
|
||||
- [MapType](doc\/MapType.md)
|
||||
|
||||
@ -11,8 +11,7 @@ Name | Type | Description | Notes
|
||||
**id** | **int** | | [optional]
|
||||
**title** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
|
||||
**description** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
|
||||
**imageResourceId** | **String** | | [optional]
|
||||
**imageSource** | **String** | | [optional]
|
||||
**images** | [**List<ImageGeoPoint>**](ImageGeoPoint.md) | | [optional] [default to const []]
|
||||
**latitude** | **String** | | [optional]
|
||||
**longitude** | **String** | | [optional]
|
||||
|
||||
|
||||
17
manager_api/doc/ImageGeoPoint.md
Normal file
17
manager_api/doc/ImageGeoPoint.md
Normal file
@ -0,0 +1,17 @@
|
||||
# managerapi.model.ImageGeoPoint
|
||||
|
||||
## Load the model package
|
||||
```dart
|
||||
import 'package:managerapi/api.dart';
|
||||
```
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**imageResourceId** | **String** | | [optional]
|
||||
**imageSource** | **String** | | [optional]
|
||||
**order** | **int** | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@ -40,6 +40,7 @@ part 'model/device_detail_dto.dart';
|
||||
part 'model/device_detail_dto_all_of.dart';
|
||||
part 'model/geo_point_dto.dart';
|
||||
part 'model/image_dto.dart';
|
||||
part 'model/image_geo_point.dart';
|
||||
part 'model/login_dto.dart';
|
||||
part 'model/map_dto.dart';
|
||||
part 'model/map_type.dart';
|
||||
|
||||
@ -168,6 +168,8 @@ class ApiClient {
|
||||
return GeoPointDTO.fromJson(value);
|
||||
case 'ImageDTO':
|
||||
return ImageDTO.fromJson(value);
|
||||
case 'ImageGeoPoint':
|
||||
return ImageGeoPoint.fromJson(value);
|
||||
case 'LoginDTO':
|
||||
return LoginDTO.fromJson(value);
|
||||
case 'MapDTO':
|
||||
|
||||
@ -15,8 +15,7 @@ class GeoPointDTO {
|
||||
this.id,
|
||||
this.title,
|
||||
this.description,
|
||||
this.imageResourceId,
|
||||
this.imageSource,
|
||||
this.images,
|
||||
this.latitude,
|
||||
this.longitude,
|
||||
});
|
||||
@ -27,9 +26,7 @@ class GeoPointDTO {
|
||||
|
||||
List<TranslationDTO> description;
|
||||
|
||||
String imageResourceId;
|
||||
|
||||
String imageSource;
|
||||
List<ImageGeoPoint> images;
|
||||
|
||||
String latitude;
|
||||
|
||||
@ -40,8 +37,7 @@ class GeoPointDTO {
|
||||
other.id == id &&
|
||||
other.title == title &&
|
||||
other.description == description &&
|
||||
other.imageResourceId == imageResourceId &&
|
||||
other.imageSource == imageSource &&
|
||||
other.images == images &&
|
||||
other.latitude == latitude &&
|
||||
other.longitude == longitude;
|
||||
|
||||
@ -50,13 +46,12 @@ class GeoPointDTO {
|
||||
(id == null ? 0 : id.hashCode) +
|
||||
(title == null ? 0 : title.hashCode) +
|
||||
(description == null ? 0 : description.hashCode) +
|
||||
(imageResourceId == null ? 0 : imageResourceId.hashCode) +
|
||||
(imageSource == null ? 0 : imageSource.hashCode) +
|
||||
(images == null ? 0 : images.hashCode) +
|
||||
(latitude == null ? 0 : latitude.hashCode) +
|
||||
(longitude == null ? 0 : longitude.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'GeoPointDTO[id=$id, title=$title, description=$description, imageResourceId=$imageResourceId, imageSource=$imageSource, latitude=$latitude, longitude=$longitude]';
|
||||
String toString() => 'GeoPointDTO[id=$id, title=$title, description=$description, images=$images, latitude=$latitude, longitude=$longitude]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
@ -69,11 +64,8 @@ class GeoPointDTO {
|
||||
if (description != null) {
|
||||
json[r'description'] = description;
|
||||
}
|
||||
if (imageResourceId != null) {
|
||||
json[r'imageResourceId'] = imageResourceId;
|
||||
}
|
||||
if (imageSource != null) {
|
||||
json[r'imageSource'] = imageSource;
|
||||
if (images != null) {
|
||||
json[r'images'] = images;
|
||||
}
|
||||
if (latitude != null) {
|
||||
json[r'latitude'] = latitude;
|
||||
@ -92,8 +84,7 @@ class GeoPointDTO {
|
||||
id: json[r'id'],
|
||||
title: TranslationDTO.listFromJson(json[r'title']),
|
||||
description: TranslationDTO.listFromJson(json[r'description']),
|
||||
imageResourceId: json[r'imageResourceId'],
|
||||
imageSource: json[r'imageSource'],
|
||||
images: ImageGeoPoint.listFromJson(json[r'images']),
|
||||
latitude: json[r'latitude'],
|
||||
longitude: json[r'longitude'],
|
||||
);
|
||||
|
||||
89
manager_api/lib/model/image_geo_point.dart
Normal file
89
manager_api/lib/model/image_geo_point.dart
Normal file
@ -0,0 +1,89 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.0
|
||||
|
||||
// ignore_for_file: unused_element, unused_import
|
||||
// ignore_for_file: always_put_required_named_parameters_first
|
||||
// ignore_for_file: lines_longer_than_80_chars
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
class ImageGeoPoint {
|
||||
/// Returns a new [ImageGeoPoint] instance.
|
||||
ImageGeoPoint({
|
||||
this.imageResourceId,
|
||||
this.imageSource,
|
||||
this.order,
|
||||
});
|
||||
|
||||
String imageResourceId;
|
||||
|
||||
String imageSource;
|
||||
|
||||
int order;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is ImageGeoPoint &&
|
||||
other.imageResourceId == imageResourceId &&
|
||||
other.imageSource == imageSource &&
|
||||
other.order == order;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
(imageResourceId == null ? 0 : imageResourceId.hashCode) +
|
||||
(imageSource == null ? 0 : imageSource.hashCode) +
|
||||
(order == null ? 0 : order.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'ImageGeoPoint[imageResourceId=$imageResourceId, imageSource=$imageSource, order=$order]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
if (imageResourceId != null) {
|
||||
json[r'imageResourceId'] = imageResourceId;
|
||||
}
|
||||
if (imageSource != null) {
|
||||
json[r'imageSource'] = imageSource;
|
||||
}
|
||||
if (order != null) {
|
||||
json[r'order'] = order;
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [ImageGeoPoint] instance and imports its values from
|
||||
/// [json] if it's non-null, null if [json] is null.
|
||||
static ImageGeoPoint fromJson(Map<String, dynamic> json) => json == null
|
||||
? null
|
||||
: ImageGeoPoint(
|
||||
imageResourceId: json[r'imageResourceId'],
|
||||
imageSource: json[r'imageSource'],
|
||||
order: json[r'order'],
|
||||
);
|
||||
|
||||
static List<ImageGeoPoint> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
|
||||
json == null || json.isEmpty
|
||||
? true == emptyIsNull ? null : <ImageGeoPoint>[]
|
||||
: json.map((v) => ImageGeoPoint.fromJson(v)).toList(growable: true == growable);
|
||||
|
||||
static Map<String, ImageGeoPoint> mapFromJson(Map<String, dynamic> json) {
|
||||
final map = <String, ImageGeoPoint>{};
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic v) => map[key] = ImageGeoPoint.fromJson(v));
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of ImageGeoPoint-objects as value to a dart map
|
||||
static Map<String, List<ImageGeoPoint>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
|
||||
final map = <String, List<ImageGeoPoint>>{};
|
||||
if (json != null && json.isNotEmpty) {
|
||||
json.forEach((String key, dynamic v) {
|
||||
map[key] = ImageGeoPoint.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
|
||||
});
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1413,18 +1413,30 @@ components:
|
||||
nullable: true
|
||||
items:
|
||||
$ref: '#/components/schemas/TranslationDTO'
|
||||
imageResourceId:
|
||||
type: string
|
||||
nullable: true
|
||||
imageSource:
|
||||
type: string
|
||||
images:
|
||||
type: array
|
||||
nullable: true
|
||||
items:
|
||||
$ref: '#/components/schemas/ImageGeoPoint'
|
||||
latitude:
|
||||
type: string
|
||||
nullable: true
|
||||
longitude:
|
||||
type: string
|
||||
nullable: true
|
||||
ImageGeoPoint:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
properties:
|
||||
imageResourceId:
|
||||
type: string
|
||||
nullable: true
|
||||
imageSource:
|
||||
type: string
|
||||
nullable: true
|
||||
order:
|
||||
type: integer
|
||||
format: int32
|
||||
SliderDTO:
|
||||
type: object
|
||||
additionalProperties: false
|
||||
|
||||
36
manager_api/test/image_geo_point_test.dart
Normal file
36
manager_api/test/image_geo_point_test.dart
Normal file
@ -0,0 +1,36 @@
|
||||
//
|
||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
// @dart=2.0
|
||||
|
||||
// ignore_for_file: unused_element, unused_import
|
||||
// ignore_for_file: always_put_required_named_parameters_first
|
||||
// ignore_for_file: lines_longer_than_80_chars
|
||||
|
||||
import 'package:managerapi/api.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
// tests for ImageGeoPoint
|
||||
void main() {
|
||||
final instance = ImageGeoPoint();
|
||||
|
||||
group('test ImageGeoPoint', () {
|
||||
// String imageResourceId
|
||||
test('to test the property `imageResourceId`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// String imageSource
|
||||
test('to test the property `imageSource`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
// int order
|
||||
test('to test the property `order`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user