Map details done + change translations modal
This commit is contained in:
parent
8990d0fcd6
commit
6037b287d7
@ -12,12 +12,14 @@ class ImageInputContainer extends StatefulWidget {
|
|||||||
final String label;
|
final String label;
|
||||||
final String initialValue;
|
final String initialValue;
|
||||||
final ValueChanged<ResourceDTO> onChanged;
|
final ValueChanged<ResourceDTO> onChanged;
|
||||||
|
final BoxFit imageFit;
|
||||||
const ImageInputContainer({
|
const ImageInputContainer({
|
||||||
Key key,
|
Key key,
|
||||||
this.color = kSecond,
|
this.color = kSecond,
|
||||||
this.label,
|
this.label,
|
||||||
this.initialValue,
|
this.initialValue,
|
||||||
this.onChanged,
|
this.onChanged,
|
||||||
|
this.imageFit = BoxFit.cover,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -123,9 +125,10 @@ class _ImageInputContainerState extends State<ImageInputContainer> {
|
|||||||
boxDecoration(ResourceDetailDTO resourceDetailDTO, appContext) {
|
boxDecoration(ResourceDetailDTO resourceDetailDTO, appContext) {
|
||||||
return BoxDecoration(
|
return BoxDecoration(
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
|
color: kWhite,
|
||||||
borderRadius: BorderRadius.circular(30.0),
|
borderRadius: BorderRadius.circular(30.0),
|
||||||
image: new DecorationImage(
|
image: new DecorationImage(
|
||||||
fit: BoxFit.cover,
|
fit: widget.imageFit,
|
||||||
image: new NetworkImage(
|
image: new NetworkImage(
|
||||||
resourceDetailDTO.type == ResourceType.image ? appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resourceDetailDTO.id : resourceDetailDTO.data,
|
resourceDetailDTO.type == ResourceType.image ? appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resourceDetailDTO.id : resourceDetailDTO.data,
|
||||||
),
|
),
|
||||||
|
|||||||
@ -1,29 +1,42 @@
|
|||||||
|
import 'package:auto_size_text/auto_size_text.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:manager_app/Components/rounded_button.dart';
|
import 'package:manager_app/Components/rounded_button.dart';
|
||||||
import 'package:manager_app/Components/string_input_container.dart';
|
import 'package:manager_app/Components/string_input_container.dart';
|
||||||
|
import 'package:manager_app/Components/text_form_input_container.dart';
|
||||||
import 'package:manager_app/Components/translation_tab.dart';
|
import 'package:manager_app/Components/translation_tab.dart';
|
||||||
|
import 'package:manager_app/Models/managerContext.dart';
|
||||||
|
import 'package:manager_app/app_context.dart';
|
||||||
import 'package:manager_app/constants.dart';
|
import 'package:manager_app/constants.dart';
|
||||||
import 'package:managerapi/api.dart';
|
import 'package:managerapi/api.dart';
|
||||||
import 'package:collection/collection.dart';
|
import 'package:collection/collection.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
showMultiStringInput (String text, List<TranslationDTO> values, List<TranslationDTO> newValues, Function onGetResult, int maxLines, BuildContext context) { /*Function onSelect,*/
|
showMultiStringInput (String label, String modalLabel, List<TranslationDTO> values, List<TranslationDTO> newValues, Function onGetResult, int maxLines, BuildContext context) { /*Function onSelect,*/
|
||||||
showDialog(
|
showDialog(
|
||||||
builder: (BuildContext context) => AlertDialog(
|
builder: (BuildContext context) => AlertDialog(
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.all(Radius.circular(20.0))
|
borderRadius: BorderRadius.all(Radius.circular(20.0))
|
||||||
),
|
),
|
||||||
title: Text(text),
|
title: Center(child: Text(modalLabel)),
|
||||||
content: SingleChildScrollView(
|
content: SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: getTranslations(context, Provider.of<AppContext>(context), label, newValues),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
/*Container(
|
||||||
width: 500,
|
width: 500,
|
||||||
height: 200,
|
height: 200,
|
||||||
child: TranslationTab(
|
child: TranslationTab(
|
||||||
translations: newValues,
|
translations: newValues,
|
||||||
maxLines: maxLines
|
maxLines: maxLines
|
||||||
)
|
)
|
||||||
),
|
),*/
|
||||||
/*Column(
|
/*Column(
|
||||||
children: showValues(newValues),
|
children: showValues(newValues),
|
||||||
),*/
|
),*/
|
||||||
@ -72,6 +85,54 @@ showMultiStringInput (String text, List<TranslationDTO> values, List<Translation
|
|||||||
), context: context
|
), context: context
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getTranslations(BuildContext context, AppContext appContext, String label, List<TranslationDTO> newValues) {
|
||||||
|
List<Widget> translations = <Widget>[];
|
||||||
|
ManagerAppContext managerAppContext = appContext.getContext();
|
||||||
|
for(var language in managerAppContext.selectedConfiguration.languages) {
|
||||||
|
translations.add(
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context).size.width *0.05,
|
||||||
|
height: MediaQuery.of(context).size.height *0.10,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border(
|
||||||
|
right: BorderSide(width: 1.5, color: kSecond),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Center(child: AutoSizeText(language.toUpperCase()))
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 8.0),
|
||||||
|
child: Container(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
TextFormInputContainer(
|
||||||
|
label: label,
|
||||||
|
color: kWhite,
|
||||||
|
isTitle: true,
|
||||||
|
initialValue: newValues.where((element) => element.language == language).first.value,
|
||||||
|
onChanged: (value) {
|
||||||
|
newValues.where((element) => element.language == language).first.value = value;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return translations;
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
showValues(List<TranslationDTO> newValues) {
|
showValues(List<TranslationDTO> newValues) {
|
||||||
List<Widget> valuesToShow = new List<Widget>();
|
List<Widget> valuesToShow = new List<Widget>();
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import 'package:managerapi/api.dart';
|
|||||||
class MultiStringContainer extends StatelessWidget {
|
class MultiStringContainer extends StatelessWidget {
|
||||||
final Color color;
|
final Color color;
|
||||||
final String label;
|
final String label;
|
||||||
|
final String modalLabel;
|
||||||
final List<TranslationDTO> initialValue;
|
final List<TranslationDTO> initialValue;
|
||||||
final Function onGetResult;
|
final Function onGetResult;
|
||||||
final int maxLines;
|
final int maxLines;
|
||||||
@ -16,6 +17,7 @@ class MultiStringContainer extends StatelessWidget {
|
|||||||
Key key,
|
Key key,
|
||||||
this.color = kSecond,
|
this.color = kSecond,
|
||||||
this.label,
|
this.label,
|
||||||
|
this.modalLabel,
|
||||||
this.initialValue,
|
this.initialValue,
|
||||||
this.onGetResult,
|
this.onGetResult,
|
||||||
this.maxLines,
|
this.maxLines,
|
||||||
@ -43,7 +45,7 @@ class MultiStringContainer extends StatelessWidget {
|
|||||||
initialValue.forEach((value) {
|
initialValue.forEach((value) {
|
||||||
newValues.add(TranslationDTO.fromJson(jsonDecode(jsonEncode(value))));
|
newValues.add(TranslationDTO.fromJson(jsonDecode(jsonEncode(value))));
|
||||||
});
|
});
|
||||||
showMultiStringInput(label, initialValue, newValues, onGetResult, maxLines, context);
|
showMultiStringInput(label, modalLabel, initialValue, newValues, onGetResult, maxLines, context);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
|||||||
63
lib/Components/slider_input_container.dart
Normal file
63
lib/Components/slider_input_container.dart
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:manager_app/Components/rounded_input_field.dart';
|
||||||
|
import 'package:manager_app/constants.dart';
|
||||||
|
|
||||||
|
class SliderInputContainer extends StatefulWidget {
|
||||||
|
final Color color;
|
||||||
|
final String label;
|
||||||
|
final double initialValue;
|
||||||
|
final int min;
|
||||||
|
final int max;
|
||||||
|
final ValueChanged<double> onChanged;
|
||||||
|
const SliderInputContainer({
|
||||||
|
Key key,
|
||||||
|
this.color = kSecond,
|
||||||
|
this.label,
|
||||||
|
this.initialValue,
|
||||||
|
this.min,
|
||||||
|
this.max,
|
||||||
|
this.onChanged,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_SliderInputContainerState createState() => _SliderInputContainerState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SliderInputContainerState extends State<SliderInputContainer> {
|
||||||
|
double currentValue;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
currentValue = widget.initialValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment: AlignmentDirectional.centerStart,
|
||||||
|
child: Text(widget.label, style: TextStyle(fontSize: 25, fontWeight: FontWeight.w300))
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(10.0),
|
||||||
|
child: Slider(
|
||||||
|
value: currentValue,
|
||||||
|
onChanged: (value) {
|
||||||
|
setState(() => currentValue = value);
|
||||||
|
widget.onChanged(value);
|
||||||
|
},
|
||||||
|
divisions: widget.max - widget.min,
|
||||||
|
min: widget.min.toDouble(),
|
||||||
|
max: widget.max.toDouble(),
|
||||||
|
label: "$currentValue",
|
||||||
|
activeColor: widget.color,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -117,7 +117,7 @@ class _ListViewCard extends State<ListViewCard> {
|
|||||||
|
|
||||||
boxDecoration(ImageDTO imageDTO, appContext) {
|
boxDecoration(ImageDTO imageDTO, appContext) {
|
||||||
return BoxDecoration(
|
return BoxDecoration(
|
||||||
color: imageDTO.title == null ? Colors.lightGreen : kBackgroundColor,
|
color: kBackgroundColor,
|
||||||
shape: BoxShape.rectangle,
|
shape: BoxShape.rectangle,
|
||||||
border: Border.all(width: 1.5, color: kSecond),
|
border: Border.all(width: 1.5, color: kSecond),
|
||||||
borderRadius: BorderRadius.circular(10.0),
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
|||||||
@ -0,0 +1,269 @@
|
|||||||
|
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/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 'package:manager_app/app_context.dart';
|
||||||
|
import 'package:manager_app/constants.dart';
|
||||||
|
import 'package:managerapi/api.dart';
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class MapConfig extends StatefulWidget {
|
||||||
|
final String color;
|
||||||
|
final String label;
|
||||||
|
final String initialValue;
|
||||||
|
final ValueChanged<String> onChanged;
|
||||||
|
const MapConfig({
|
||||||
|
Key key,
|
||||||
|
this.color,
|
||||||
|
this.label,
|
||||||
|
this.initialValue,
|
||||||
|
this.onChanged,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_MapConfigState createState() => _MapConfigState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MapConfigState extends State<MapConfig> {
|
||||||
|
MapDTO mapDTO;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
|
||||||
|
mapDTO = MapDTO.fromJson(json.decode(widget.initialValue));
|
||||||
|
List<GeoPointDTO> test = new List<GeoPointDTO>.from(mapDTO.points);
|
||||||
|
mapDTO.points = test;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final appContext = Provider.of<AppContext>(context);
|
||||||
|
Size size = MediaQuery.of(context).size;
|
||||||
|
|
||||||
|
return
|
||||||
|
SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
height: size.height * 0.15,
|
||||||
|
width: double.infinity,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
// Icon
|
||||||
|
ImageInputContainer(
|
||||||
|
label: "Icône:",
|
||||||
|
initialValue: mapDTO.iconResourceId,
|
||||||
|
color: kPrimaryColor,
|
||||||
|
imageFit: BoxFit.contain,
|
||||||
|
onChanged: (ResourceDTO resource) {
|
||||||
|
mapDTO.iconSource = resource.type == ResourceType.imageUrl ? resource.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resource.id;
|
||||||
|
mapDTO.iconResourceId = resource.id;
|
||||||
|
widget.onChanged(jsonEncode(mapDTO).toString());
|
||||||
|
},
|
||||||
|
),
|
||||||
|
// Map Type
|
||||||
|
MultiSelectContainer(
|
||||||
|
label: "Type :",
|
||||||
|
initialValue: [mapDTO.mapType.toString()],
|
||||||
|
isMultiple: false,
|
||||||
|
values: map_types,
|
||||||
|
onChanged: (value) {
|
||||||
|
var tempOutput = new List<String>.from(value);
|
||||||
|
mapDTO.mapType = MapType.fromJson(tempOutput[0]);
|
||||||
|
widget.onChanged(jsonEncode(mapDTO).toString());
|
||||||
|
},
|
||||||
|
),
|
||||||
|
// Zoom
|
||||||
|
SliderInputContainer(
|
||||||
|
label: "Zoom:",
|
||||||
|
initialValue: mapDTO.zoom != null ? mapDTO.zoom.toDouble() : 18,
|
||||||
|
color: kPrimaryColor,
|
||||||
|
min: 0,
|
||||||
|
max: 30,
|
||||||
|
onChanged: (double value) {
|
||||||
|
mapDTO.zoom = value.toInt();
|
||||||
|
widget.onChanged(jsonEncode(mapDTO).toString());
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(25),
|
||||||
|
border: Border.all(width: 1.5, color: kSecond)
|
||||||
|
),
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 40, left: 10, right: 10, bottom: 10),
|
||||||
|
child: GridView.builder(
|
||||||
|
shrinkWrap: true,
|
||||||
|
gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 8),
|
||||||
|
itemCount: mapDTO.points.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return
|
||||||
|
Container(
|
||||||
|
decoration: boxDecoration(mapDTO.points[index], appContext),
|
||||||
|
padding: const EdgeInsets.all(5),
|
||||||
|
margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
|
||||||
|
child: getElement(index, mapDTO.points[index], size, appContext),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
top: 10,
|
||||||
|
left: 10,
|
||||||
|
child: Text(
|
||||||
|
"Points géographiques",
|
||||||
|
style: TextStyle(fontSize: 15),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
bottom: 10,
|
||||||
|
right: 10,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
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
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
getElement(int index, GeoPointDTO point, Size size, AppContext appContext) {
|
||||||
|
return Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height: double.infinity,
|
||||||
|
child: Stack(
|
||||||
|
children: [
|
||||||
|
Center(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: AutoSizeText(
|
||||||
|
point.title == null ? "" : point.title[0].value,
|
||||||
|
style: new TextStyle(fontSize: 20),
|
||||||
|
maxLines: 2,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
top: 0,
|
||||||
|
right: 0,
|
||||||
|
child: Icon(
|
||||||
|
getSectionIcon(SectionType.map),
|
||||||
|
color: kSecond,
|
||||||
|
size: 18.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
bottom: 0,
|
||||||
|
left: 0,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
showNewOrUpdateGeoPoint(
|
||||||
|
mapDTO.points[index],
|
||||||
|
(GeoPointDTO geoPoint) {
|
||||||
|
setState(() {
|
||||||
|
mapDTO.points[index] = geoPoint;
|
||||||
|
widget.onChanged(jsonEncode(mapDTO).toString());
|
||||||
|
});
|
||||||
|
},
|
||||||
|
appContext,
|
||||||
|
context);
|
||||||
|
},
|
||||||
|
child: Icon(
|
||||||
|
Icons.edit,
|
||||||
|
color: kPrimaryColor,
|
||||||
|
size: 20.0,
|
||||||
|
)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
bottom: 0,
|
||||||
|
right: 0,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
mapDTO.points.removeAt(index);
|
||||||
|
});
|
||||||
|
widget.onChanged(jsonEncode(mapDTO).toString());
|
||||||
|
},
|
||||||
|
child: Icon(
|
||||||
|
Icons.delete,
|
||||||
|
color: kPrimaryColor,
|
||||||
|
size: 20.0,
|
||||||
|
)
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
boxDecoration(GeoPointDTO geoPointDTO, appContext) {
|
||||||
|
return BoxDecoration(
|
||||||
|
color: geoPointDTO.title == null ? Colors.lightGreen : kBackgroundColor,
|
||||||
|
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
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -0,0 +1,194 @@
|
|||||||
|
import 'package:auto_size_text/auto_size_text.dart';
|
||||||
|
import 'package:manager_app/Components/image_input_container.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
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/app_context.dart';
|
||||||
|
import 'package:manager_app/constants.dart';
|
||||||
|
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 {
|
||||||
|
geoPointDTO.title = <TranslationDTO>[];
|
||||||
|
geoPointDTO.description = <TranslationDTO>[];
|
||||||
|
|
||||||
|
ManagerAppContext managerAppContext = appContext.getContext();
|
||||||
|
managerAppContext.selectedConfiguration.languages.forEach((element) {
|
||||||
|
var translationDTO = new TranslationDTO();
|
||||||
|
translationDTO.language = element;
|
||||||
|
translationDTO.value = "";
|
||||||
|
geoPointDTO.title.add(translationDTO);
|
||||||
|
geoPointDTO.description.add(translationDTO);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Size size = MediaQuery.of(context).size;
|
||||||
|
showDialog(
|
||||||
|
builder: (BuildContext context) => AlertDialog(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(20.0))
|
||||||
|
),
|
||||||
|
content: Container(
|
||||||
|
width: size.width *0.5,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Text("Point géographique", style: new TextStyle(fontSize: 25, fontWeight: FontWeight.w400)),
|
||||||
|
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(
|
||||||
|
children: [
|
||||||
|
StringInputContainer(
|
||||||
|
label: "Latitude :",
|
||||||
|
initialValue: geoPointDTO.latitude,
|
||||||
|
onChanged: (value) {
|
||||||
|
geoPointDTO.latitude = value;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
StringInputContainer(
|
||||||
|
label: "Longitude :",
|
||||||
|
initialValue: geoPointDTO.longitude,
|
||||||
|
onChanged: (value) {
|
||||||
|
geoPointDTO.longitude = value;
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: getTranslations(context, appContext, geoPointDTO),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
actions: <Widget>[
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
Align(
|
||||||
|
alignment: AlignmentDirectional.bottomEnd,
|
||||||
|
child: Container(
|
||||||
|
width: 175,
|
||||||
|
height: 70,
|
||||||
|
child: RoundedButton(
|
||||||
|
text: "Annuler",
|
||||||
|
icon: Icons.undo,
|
||||||
|
color: kSecond,
|
||||||
|
press: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
fontSize: 20,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment: AlignmentDirectional.bottomEnd,
|
||||||
|
child: Container(
|
||||||
|
width: geoPointDTO != null ? 220: 150,
|
||||||
|
height: 70,
|
||||||
|
child: RoundedButton(
|
||||||
|
text: geoPointDTO != null ? "Sauvegarder" : "Créer",
|
||||||
|
icon: Icons.check,
|
||||||
|
color: kPrimaryColor,
|
||||||
|
textColor: kWhite,
|
||||||
|
press: () {
|
||||||
|
getResult(geoPointDTO);
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
fontSize: 20,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
), context: context
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
getTranslations(BuildContext context, AppContext appContext, GeoPointDTO geoPointDTO) {
|
||||||
|
List<Widget> translations = <Widget>[];
|
||||||
|
ManagerAppContext managerAppContext = appContext.getContext();
|
||||||
|
for(var language in managerAppContext.selectedConfiguration.languages) {
|
||||||
|
translations.add(
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context).size.width *0.05,
|
||||||
|
height: MediaQuery.of(context).size.height *0.2,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border(
|
||||||
|
right: BorderSide(width: 1.5, color: kSecond),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Center(child: AutoSizeText(language.toUpperCase()))
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 8.0),
|
||||||
|
child: Container(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
TextFormInputContainer(
|
||||||
|
label: "Titre:",
|
||||||
|
color: kWhite,
|
||||||
|
isTitle: true,
|
||||||
|
initialValue: geoPointDTO.title.where((element) => element.language == language).first.value,
|
||||||
|
onChanged: (value) {
|
||||||
|
geoPointDTO.title.where((element) => element.language == language).first.value = value;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
TextFormInputContainer(
|
||||||
|
label: "Description:",
|
||||||
|
color: kWhite,
|
||||||
|
isTitle: false,
|
||||||
|
initialValue: geoPointDTO.description.where((element) => element.language == language).first.value,
|
||||||
|
onChanged: (value) {
|
||||||
|
geoPointDTO.description.where((element) => element.language == language).first.value = value;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return translations;
|
||||||
|
}
|
||||||
|
|
||||||
@ -1,7 +1,3 @@
|
|||||||
import 'package:auto_size_text/auto_size_text.dart';
|
|
||||||
import 'package:drag_and_drop_lists/drag_and_drop_item.dart';
|
|
||||||
import 'package:drag_and_drop_lists/drag_and_drop_list.dart';
|
|
||||||
import 'package:drag_and_drop_lists/drag_and_drop_lists.dart';
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:manager_app/Screens/Configurations/Section/SubSection/listViewcard.dart';
|
import 'package:manager_app/Screens/Configurations/Section/SubSection/listViewcard.dart';
|
||||||
|
|||||||
@ -17,6 +17,8 @@ import 'package:managerapi/api.dart';
|
|||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:intl/intl.dart';
|
import 'package:intl/intl.dart';
|
||||||
|
|
||||||
|
import 'SubSection/map_config.dart';
|
||||||
|
|
||||||
class SectionDetailScreen extends StatefulWidget {
|
class SectionDetailScreen extends StatefulWidget {
|
||||||
final String id;
|
final String id;
|
||||||
SectionDetailScreen({Key key, @required this.id}) : super(key: key);
|
SectionDetailScreen({Key key, @required this.id}) : super(key: key);
|
||||||
@ -67,7 +69,6 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
|
|||||||
Row(
|
Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(sectionDTO.label, style: TextStyle(fontSize: 30, fontWeight: FontWeight.w400)),
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
@ -75,7 +76,8 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
|
|||||||
color: kPrimaryColor,
|
color: kPrimaryColor,
|
||||||
size: 25,
|
size: 25,
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
|
Text(sectionDTO.label, style: TextStyle(fontSize: 30, fontWeight: FontWeight.w400)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
@ -110,6 +112,8 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
|
|||||||
),
|
),
|
||||||
), // TITLE
|
), // TITLE
|
||||||
Container(
|
Container(
|
||||||
|
/*height: size.height*0.4,
|
||||||
|
color: Colors.lightBlue,*/
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(10.0),
|
padding: const EdgeInsets.all(10.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
@ -132,17 +136,6 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
|
|||||||
sectionDTO.label = value;
|
sectionDTO.label = value;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
MultiSelectContainer(
|
|
||||||
label: "Type :",
|
|
||||||
initialValue: [sectionDTO.type.toString()],
|
|
||||||
isMultiple: false,
|
|
||||||
values: section_types,
|
|
||||||
onChanged: (value) {
|
|
||||||
var tempOutput = new List<String>.from(value);
|
|
||||||
sectionDTO.type = SectionType.fromJson(tempOutput[0]);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
|
|
||||||
ImageInputContainer(
|
ImageInputContainer(
|
||||||
label: "Image :",
|
label: "Image :",
|
||||||
initialValue: sectionDTO.imageId,
|
initialValue: sectionDTO.imageId,
|
||||||
@ -160,6 +153,7 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
|
|||||||
children: [
|
children: [
|
||||||
MultiStringContainer(
|
MultiStringContainer(
|
||||||
label: "Titre :",
|
label: "Titre :",
|
||||||
|
modalLabel: "Titre",
|
||||||
color: kPrimaryColor,
|
color: kPrimaryColor,
|
||||||
initialValue: sectionDTO.title,
|
initialValue: sectionDTO.title,
|
||||||
onGetResult: (value) {
|
onGetResult: (value) {
|
||||||
@ -172,6 +166,7 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
|
|||||||
),
|
),
|
||||||
MultiStringContainer(
|
MultiStringContainer(
|
||||||
label: "Description :",
|
label: "Description :",
|
||||||
|
modalLabel: "Description",
|
||||||
color: kPrimaryColor,
|
color: kPrimaryColor,
|
||||||
initialValue: sectionDTO.description,
|
initialValue: sectionDTO.description,
|
||||||
onGetResult: (value) {
|
onGetResult: (value) {
|
||||||
@ -193,7 +188,7 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
|
|||||||
),
|
),
|
||||||
),// FIELDS SECTION
|
),// FIELDS SECTION
|
||||||
Container(
|
Container(
|
||||||
height: size.height * 0.4,
|
height: size.height * 0.45,
|
||||||
width: size.width * 0.8,
|
width: size.width * 0.8,
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(10.0),
|
padding: const EdgeInsets.all(10.0),
|
||||||
@ -298,7 +293,14 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
|
|||||||
getSpecificData(SectionDTO sectionDTO, AppContext appContext) {
|
getSpecificData(SectionDTO sectionDTO, AppContext appContext) {
|
||||||
switch(sectionDTO.type) {
|
switch(sectionDTO.type) {
|
||||||
case SectionType.map:
|
case SectionType.map:
|
||||||
return Text("map");
|
return MapConfig(
|
||||||
|
initialValue: sectionDTO.data,
|
||||||
|
onChanged: (String data) {
|
||||||
|
print("Received info in parent");
|
||||||
|
print(data);
|
||||||
|
sectionDTO.data = data;
|
||||||
|
},
|
||||||
|
);
|
||||||
case SectionType.slider:
|
case SectionType.slider:
|
||||||
return SliderConfig(
|
return SliderConfig(
|
||||||
initialValue: sectionDTO.data,
|
initialValue: sectionDTO.data,
|
||||||
|
|||||||
@ -35,23 +35,19 @@ class _ConfigurationsScreenState extends State<ConfigurationsScreen> {
|
|||||||
return ConfigurationDetailScreen(id: managerAppContext.selectedConfiguration.id);
|
return ConfigurationDetailScreen(id: managerAppContext.selectedConfiguration.id);
|
||||||
} else {
|
} else {
|
||||||
return Container(
|
return Container(
|
||||||
child: Column(
|
child: FutureBuilder(
|
||||||
children: [
|
future: getConfigurations(appContext),
|
||||||
FutureBuilder(
|
builder: (context, AsyncSnapshot<dynamic> snapshot) {
|
||||||
future: getConfigurations(appContext),
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
builder: (context, AsyncSnapshot<dynamic> snapshot) {
|
var tempOutput = new List<ConfigurationDTO>.from(snapshot.data);
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
tempOutput.add(ConfigurationDTO(id: null));
|
||||||
var tempOutput = new List<ConfigurationDTO>.from(snapshot.data);
|
return bodyGrid(tempOutput, size, appContext);
|
||||||
tempOutput.add(ConfigurationDTO(id: null));
|
} else if (snapshot.connectionState == ConnectionState.none) {
|
||||||
return bodyGrid(tempOutput, size, appContext);
|
return Text("No data");
|
||||||
} else if (snapshot.connectionState == ConnectionState.none) {
|
} else {
|
||||||
return Text("No data");
|
return Center(child: Container(height: size.height * 0.2, child: Text('LOADING TODO FRAISE')));
|
||||||
} else {
|
}
|
||||||
return Center(child: Container(height: size.height * 0.2, child: Text('LOADING TODO FRAISE')));
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
),
|
|
||||||
]
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,23 +29,19 @@ class _ResourcesScreenState extends State<ResourcesScreen> {
|
|||||||
Size size = MediaQuery.of(context).size;
|
Size size = MediaQuery.of(context).size;
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
child: Column(
|
child: FutureBuilder(
|
||||||
children: [
|
future: getResources(widget.onGetResult, widget.isImage, appContext),
|
||||||
FutureBuilder(
|
builder: (context, AsyncSnapshot<dynamic> snapshot) {
|
||||||
future: getResources(widget.onGetResult, widget.isImage, appContext),
|
if (snapshot.connectionState == ConnectionState.done) {
|
||||||
builder: (context, AsyncSnapshot<dynamic> snapshot) {
|
var tempOutput = new List<ResourceDTO>.from(snapshot.data);
|
||||||
if (snapshot.connectionState == ConnectionState.done) {
|
tempOutput.add(ResourceDTO(id: null));
|
||||||
var tempOutput = new List<ResourceDTO>.from(snapshot.data);
|
return bodyGrid(tempOutput, size, appContext);
|
||||||
tempOutput.add(ResourceDTO(id: null));
|
} else if (snapshot.connectionState == ConnectionState.none) {
|
||||||
return bodyGrid(tempOutput, size, appContext);
|
return Text("No data");
|
||||||
} else if (snapshot.connectionState == ConnectionState.none) {
|
} else {
|
||||||
return Text("No data");
|
return Center(child: Container(height: size.height * 0.2, child: Text('LOADING TODO FRAISE')));
|
||||||
} else {
|
}
|
||||||
return Center(child: Container(height: size.height * 0.2, child: Text('LOADING TODO FRAISE')));
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
),
|
|
||||||
]
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,6 @@ import 'package:flutter/material.dart';
|
|||||||
const kTitleTextColor = Color(0xFF303030);
|
const kTitleTextColor = Color(0xFF303030);
|
||||||
const kBodyTextColor = Color(0xFF4B4B4B); // TODO
|
const kBodyTextColor = Color(0xFF4B4B4B); // TODO
|
||||||
|
|
||||||
|
|
||||||
const kBackgroundColor = Color(0xFFf5f5f7);
|
const kBackgroundColor = Color(0xFFf5f5f7);
|
||||||
const kPrimaryColor = Color(0xFFCA413F);
|
const kPrimaryColor = Color(0xFFCA413F);
|
||||||
const kTextLightColor = Color(0xFFFCFDFD);
|
const kTextLightColor = Color(0xFFFCFDFD);
|
||||||
@ -14,6 +13,7 @@ const kWhite = Color(0xFFFFFFFF);
|
|||||||
const kBlack = Color(0xFF000000);
|
const kBlack = Color(0xFF000000);
|
||||||
|
|
||||||
const List<String> section_types = ["Map", "Slider", "Video", "Web", "Menu"];
|
const List<String> section_types = ["Map", "Slider", "Video", "Web", "Menu"];
|
||||||
|
const List<String> map_types = ["none", "normal", "satellite", "terrain", "hybrid"];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
const kTextStyle = TextStyle(
|
const kTextStyle = TextStyle(
|
||||||
|
|||||||
@ -11,9 +11,8 @@ Name | Type | Description | Notes
|
|||||||
**id** | **int** | | [optional]
|
**id** | **int** | | [optional]
|
||||||
**title** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
|
**title** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
|
||||||
**description** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
|
**description** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
|
||||||
**image** | **String** | | [optional]
|
**imageResourceId** | **String** | | [optional]
|
||||||
**imageType** | **String** | | [optional]
|
**imageSource** | **String** | | [optional]
|
||||||
**text** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
|
|
||||||
**latitude** | **String** | | [optional]
|
**latitude** | **String** | | [optional]
|
||||||
**longitude** | **String** | | [optional]
|
**longitude** | **String** | | [optional]
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,8 @@ Name | Type | Description | Notes
|
|||||||
**zoom** | **int** | | [optional]
|
**zoom** | **int** | | [optional]
|
||||||
**mapType** | [**MapType**](MapType.md) | | [optional]
|
**mapType** | [**MapType**](MapType.md) | | [optional]
|
||||||
**points** | [**List<GeoPointDTO>**](GeoPointDTO.md) | | [optional] [default to const []]
|
**points** | [**List<GeoPointDTO>**](GeoPointDTO.md) | | [optional] [default to const []]
|
||||||
**icon** | **String** | | [optional]
|
**iconResourceId** | **String** | | [optional]
|
||||||
|
**iconSource** | **String** | | [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)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|||||||
@ -15,9 +15,8 @@ class GeoPointDTO {
|
|||||||
this.id,
|
this.id,
|
||||||
this.title,
|
this.title,
|
||||||
this.description,
|
this.description,
|
||||||
this.image,
|
this.imageResourceId,
|
||||||
this.imageType,
|
this.imageSource,
|
||||||
this.text,
|
|
||||||
this.latitude,
|
this.latitude,
|
||||||
this.longitude,
|
this.longitude,
|
||||||
});
|
});
|
||||||
@ -28,11 +27,9 @@ class GeoPointDTO {
|
|||||||
|
|
||||||
List<TranslationDTO> description;
|
List<TranslationDTO> description;
|
||||||
|
|
||||||
String image;
|
String imageResourceId;
|
||||||
|
|
||||||
String imageType;
|
String imageSource;
|
||||||
|
|
||||||
List<TranslationDTO> text;
|
|
||||||
|
|
||||||
String latitude;
|
String latitude;
|
||||||
|
|
||||||
@ -43,9 +40,8 @@ class GeoPointDTO {
|
|||||||
other.id == id &&
|
other.id == id &&
|
||||||
other.title == title &&
|
other.title == title &&
|
||||||
other.description == description &&
|
other.description == description &&
|
||||||
other.image == image &&
|
other.imageResourceId == imageResourceId &&
|
||||||
other.imageType == imageType &&
|
other.imageSource == imageSource &&
|
||||||
other.text == text &&
|
|
||||||
other.latitude == latitude &&
|
other.latitude == latitude &&
|
||||||
other.longitude == longitude;
|
other.longitude == longitude;
|
||||||
|
|
||||||
@ -54,14 +50,13 @@ class GeoPointDTO {
|
|||||||
(id == null ? 0 : id.hashCode) +
|
(id == null ? 0 : id.hashCode) +
|
||||||
(title == null ? 0 : title.hashCode) +
|
(title == null ? 0 : title.hashCode) +
|
||||||
(description == null ? 0 : description.hashCode) +
|
(description == null ? 0 : description.hashCode) +
|
||||||
(image == null ? 0 : image.hashCode) +
|
(imageResourceId == null ? 0 : imageResourceId.hashCode) +
|
||||||
(imageType == null ? 0 : imageType.hashCode) +
|
(imageSource == null ? 0 : imageSource.hashCode) +
|
||||||
(text == null ? 0 : text.hashCode) +
|
|
||||||
(latitude == null ? 0 : latitude.hashCode) +
|
(latitude == null ? 0 : latitude.hashCode) +
|
||||||
(longitude == null ? 0 : longitude.hashCode);
|
(longitude == null ? 0 : longitude.hashCode);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() => 'GeoPointDTO[id=$id, title=$title, description=$description, image=$image, imageType=$imageType, text=$text, latitude=$latitude, longitude=$longitude]';
|
String toString() => 'GeoPointDTO[id=$id, title=$title, description=$description, imageResourceId=$imageResourceId, imageSource=$imageSource, latitude=$latitude, longitude=$longitude]';
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final json = <String, dynamic>{};
|
final json = <String, dynamic>{};
|
||||||
@ -74,14 +69,11 @@ class GeoPointDTO {
|
|||||||
if (description != null) {
|
if (description != null) {
|
||||||
json[r'description'] = description;
|
json[r'description'] = description;
|
||||||
}
|
}
|
||||||
if (image != null) {
|
if (imageResourceId != null) {
|
||||||
json[r'image'] = image;
|
json[r'imageResourceId'] = imageResourceId;
|
||||||
}
|
}
|
||||||
if (imageType != null) {
|
if (imageSource != null) {
|
||||||
json[r'imageType'] = imageType;
|
json[r'imageSource'] = imageSource;
|
||||||
}
|
|
||||||
if (text != null) {
|
|
||||||
json[r'text'] = text;
|
|
||||||
}
|
}
|
||||||
if (latitude != null) {
|
if (latitude != null) {
|
||||||
json[r'latitude'] = latitude;
|
json[r'latitude'] = latitude;
|
||||||
@ -100,9 +92,8 @@ class GeoPointDTO {
|
|||||||
id: json[r'id'],
|
id: json[r'id'],
|
||||||
title: TranslationDTO.listFromJson(json[r'title']),
|
title: TranslationDTO.listFromJson(json[r'title']),
|
||||||
description: TranslationDTO.listFromJson(json[r'description']),
|
description: TranslationDTO.listFromJson(json[r'description']),
|
||||||
image: json[r'image'],
|
imageResourceId: json[r'imageResourceId'],
|
||||||
imageType: json[r'imageType'],
|
imageSource: json[r'imageSource'],
|
||||||
text: TranslationDTO.listFromJson(json[r'text']),
|
|
||||||
latitude: json[r'latitude'],
|
latitude: json[r'latitude'],
|
||||||
longitude: json[r'longitude'],
|
longitude: json[r'longitude'],
|
||||||
);
|
);
|
||||||
|
|||||||
@ -15,7 +15,8 @@ class MapDTO {
|
|||||||
this.zoom,
|
this.zoom,
|
||||||
this.mapType,
|
this.mapType,
|
||||||
this.points,
|
this.points,
|
||||||
this.icon,
|
this.iconResourceId,
|
||||||
|
this.iconSource,
|
||||||
});
|
});
|
||||||
|
|
||||||
int zoom;
|
int zoom;
|
||||||
@ -24,24 +25,28 @@ class MapDTO {
|
|||||||
|
|
||||||
List<GeoPointDTO> points;
|
List<GeoPointDTO> points;
|
||||||
|
|
||||||
String icon;
|
String iconResourceId;
|
||||||
|
|
||||||
|
String iconSource;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) => identical(this, other) || other is MapDTO &&
|
bool operator ==(Object other) => identical(this, other) || other is MapDTO &&
|
||||||
other.zoom == zoom &&
|
other.zoom == zoom &&
|
||||||
other.mapType == mapType &&
|
other.mapType == mapType &&
|
||||||
other.points == points &&
|
other.points == points &&
|
||||||
other.icon == icon;
|
other.iconResourceId == iconResourceId &&
|
||||||
|
other.iconSource == iconSource;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode =>
|
int get hashCode =>
|
||||||
(zoom == null ? 0 : zoom.hashCode) +
|
(zoom == null ? 0 : zoom.hashCode) +
|
||||||
(mapType == null ? 0 : mapType.hashCode) +
|
(mapType == null ? 0 : mapType.hashCode) +
|
||||||
(points == null ? 0 : points.hashCode) +
|
(points == null ? 0 : points.hashCode) +
|
||||||
(icon == null ? 0 : icon.hashCode);
|
(iconResourceId == null ? 0 : iconResourceId.hashCode) +
|
||||||
|
(iconSource == null ? 0 : iconSource.hashCode);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() => 'MapDTO[zoom=$zoom, mapType=$mapType, points=$points, icon=$icon]';
|
String toString() => 'MapDTO[zoom=$zoom, mapType=$mapType, points=$points, iconResourceId=$iconResourceId, iconSource=$iconSource]';
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final json = <String, dynamic>{};
|
final json = <String, dynamic>{};
|
||||||
@ -54,8 +59,11 @@ class MapDTO {
|
|||||||
if (points != null) {
|
if (points != null) {
|
||||||
json[r'points'] = points;
|
json[r'points'] = points;
|
||||||
}
|
}
|
||||||
if (icon != null) {
|
if (iconResourceId != null) {
|
||||||
json[r'icon'] = icon;
|
json[r'iconResourceId'] = iconResourceId;
|
||||||
|
}
|
||||||
|
if (iconSource != null) {
|
||||||
|
json[r'iconSource'] = iconSource;
|
||||||
}
|
}
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
@ -68,7 +76,8 @@ class MapDTO {
|
|||||||
zoom: json[r'zoom'],
|
zoom: json[r'zoom'],
|
||||||
mapType: MapType.fromJson(json[r'mapType']),
|
mapType: MapType.fromJson(json[r'mapType']),
|
||||||
points: GeoPointDTO.listFromJson(json[r'points']),
|
points: GeoPointDTO.listFromJson(json[r'points']),
|
||||||
icon: json[r'icon'],
|
iconResourceId: json[r'iconResourceId'],
|
||||||
|
iconSource: json[r'iconSource'],
|
||||||
);
|
);
|
||||||
|
|
||||||
static List<MapDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
|
static List<MapDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
|
||||||
|
|||||||
@ -1375,7 +1375,10 @@ components:
|
|||||||
nullable: true
|
nullable: true
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/GeoPointDTO'
|
$ref: '#/components/schemas/GeoPointDTO'
|
||||||
icon:
|
iconResourceId:
|
||||||
|
type: string
|
||||||
|
nullable: true
|
||||||
|
iconSource:
|
||||||
type: string
|
type: string
|
||||||
nullable: true
|
nullable: true
|
||||||
MapType:
|
MapType:
|
||||||
@ -1410,17 +1413,12 @@ components:
|
|||||||
nullable: true
|
nullable: true
|
||||||
items:
|
items:
|
||||||
$ref: '#/components/schemas/TranslationDTO'
|
$ref: '#/components/schemas/TranslationDTO'
|
||||||
image:
|
imageResourceId:
|
||||||
type: string
|
type: string
|
||||||
nullable: true
|
nullable: true
|
||||||
imageType:
|
imageSource:
|
||||||
type: string
|
type: string
|
||||||
nullable: true
|
nullable: true
|
||||||
text:
|
|
||||||
type: array
|
|
||||||
nullable: true
|
|
||||||
items:
|
|
||||||
$ref: '#/components/schemas/TranslationDTO'
|
|
||||||
latitude:
|
latitude:
|
||||||
type: string
|
type: string
|
||||||
nullable: true
|
nullable: true
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user