Service generation + init new version + Add weather as a section + download resource + filter geoPoint + added new config params
This commit is contained in:
parent
fb0a8674d1
commit
649955044f
@ -23,6 +23,8 @@ IconData getSectionIcon(elementType) {
|
|||||||
return Icons.extension;
|
return Icons.extension;
|
||||||
case SectionType.Agenda:
|
case SectionType.Agenda:
|
||||||
return Icons.calendar_month_outlined;
|
return Icons.calendar_month_outlined;
|
||||||
|
case SectionType.Weather:
|
||||||
|
return Icons.sunny;
|
||||||
}
|
}
|
||||||
return Icons.question_mark;
|
return Icons.question_mark;
|
||||||
}
|
}
|
||||||
@ -1,15 +1,19 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:manager_app/constants.dart';
|
import 'package:manager_app/constants.dart';
|
||||||
|
import 'package:html/parser.dart' show parse;
|
||||||
|
|
||||||
import 'message_notification.dart';
|
import 'message_notification.dart';
|
||||||
|
|
||||||
class MultiSelectContainer extends StatelessWidget {
|
class MultiSelectContainer extends StatelessWidget {
|
||||||
final Color color;
|
final Color color;
|
||||||
final String label;
|
final String? label;
|
||||||
final List<String> values;
|
final List<String> values;
|
||||||
final List<String> initialValue;
|
final List<String> initialValue;
|
||||||
final bool isMultiple;
|
final bool isMultiple;
|
||||||
final bool isAtLeastOne;
|
final bool isAtLeastOne;
|
||||||
|
final bool isHTMLLabel;
|
||||||
|
final double? width;
|
||||||
|
final int maxLines;
|
||||||
final ValueChanged<List<dynamic>> onChanged;
|
final ValueChanged<List<dynamic>> onChanged;
|
||||||
const MultiSelectContainer({
|
const MultiSelectContainer({
|
||||||
Key? key,
|
Key? key,
|
||||||
@ -19,28 +23,37 @@ class MultiSelectContainer extends StatelessWidget {
|
|||||||
required this.initialValue,
|
required this.initialValue,
|
||||||
required this.isMultiple,
|
required this.isMultiple,
|
||||||
this.isAtLeastOne = false,
|
this.isAtLeastOne = false,
|
||||||
|
this.isHTMLLabel = false,
|
||||||
|
this.width,
|
||||||
|
this.maxLines = 2,
|
||||||
required this.onChanged,
|
required this.onChanged,
|
||||||
}) : super(key: key);
|
}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
Size size = MediaQuery.of(context).size;
|
Size size = MediaQuery.of(context).size;
|
||||||
return Container(
|
return SingleChildScrollView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
child: Row(
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Align(
|
if(label != null)
|
||||||
alignment: AlignmentDirectional.centerStart,
|
Align(
|
||||||
child: Text(label, style: TextStyle(fontSize: 25, fontWeight: FontWeight.w300))
|
alignment: AlignmentDirectional.centerStart,
|
||||||
),
|
child: Text(label!, style: TextStyle(fontSize: 25, fontWeight: FontWeight.w300))
|
||||||
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(10.0),
|
padding: const EdgeInsets.all(10.0),
|
||||||
child: Container(
|
child: Container(
|
||||||
width: size.width *0.25,
|
width: width ?? size.width *0.25,
|
||||||
|
//color: Colors.yellow,
|
||||||
child: MultiSelectChip(
|
child: MultiSelectChip(
|
||||||
values,
|
values,
|
||||||
initialValue,
|
initialValue,
|
||||||
isMultiple,
|
isMultiple,
|
||||||
isAtLeastOne,
|
isAtLeastOne,
|
||||||
|
isHTMLLabel,
|
||||||
|
maxLines,
|
||||||
onSelectionChanged: (selectedList) {
|
onSelectionChanged: (selectedList) {
|
||||||
onChanged(selectedList);
|
onChanged(selectedList);
|
||||||
},
|
},
|
||||||
@ -59,30 +72,36 @@ class MultiSelectChip extends StatefulWidget {
|
|||||||
final Function(List<String>) onSelectionChanged; // +added
|
final Function(List<String>) onSelectionChanged; // +added
|
||||||
final bool isMultiple;
|
final bool isMultiple;
|
||||||
final bool isAtLeastOne;
|
final bool isAtLeastOne;
|
||||||
|
final bool isHTMLLabel;
|
||||||
|
final int maxLines;
|
||||||
MultiSelectChip(
|
MultiSelectChip(
|
||||||
this.values,
|
this.values,
|
||||||
this.selectedValues,
|
this.selectedValues,
|
||||||
this.isMultiple,
|
this.isMultiple,
|
||||||
this.isAtLeastOne,
|
this.isAtLeastOne,
|
||||||
|
this.isHTMLLabel,
|
||||||
|
this.maxLines,
|
||||||
{required this.onSelectionChanged} // +added
|
{required this.onSelectionChanged} // +added
|
||||||
);
|
);
|
||||||
@override
|
@override
|
||||||
_MultiSelectChipState createState() => _MultiSelectChipState();
|
_MultiSelectChipState createState() => _MultiSelectChipState();
|
||||||
}
|
}
|
||||||
class _MultiSelectChipState extends State<MultiSelectChip> {
|
class _MultiSelectChipState extends State<MultiSelectChip> {
|
||||||
|
int maxLines = 1; // Définir le nombre maximum de lignes
|
||||||
|
|
||||||
_buildChoiceList() {
|
_buildChoiceList() {
|
||||||
List<Widget> choices = [];
|
List<Widget> choices = [];
|
||||||
widget.values.forEach((item) {
|
widget.values.forEach((item) {
|
||||||
choices.add(Container(
|
choices.add(Container(
|
||||||
padding: const EdgeInsets.all(2.0),
|
padding: const EdgeInsets.all(2.0),
|
||||||
child: ChoiceChip(
|
child: ChoiceChip(
|
||||||
label: Text(item, style: TextStyle(color: kBlack)),
|
label: Text(widget.isHTMLLabel ? parse(item).documentElement!.text : item, style: TextStyle(color: kBlack)),
|
||||||
selected: widget.selectedValues.contains(item),
|
selected: widget.selectedValues.contains(item),
|
||||||
selectedColor: kPrimaryColor,
|
selectedColor: kPrimaryColor,
|
||||||
onSelected: (selected) {
|
onSelected: (selected) {
|
||||||
setState(() {
|
setState(() {
|
||||||
if (widget.isAtLeastOne && widget.selectedValues.length == 1 && widget.selectedValues[0] == item) {
|
if (widget.isAtLeastOne && widget.selectedValues.length == 1 && widget.selectedValues[0] == item) {
|
||||||
showNotification(Colors.orange, kWhite, 'Au moins une valeur doit être sélectionnée', context, null);
|
showNotification(Colors.orange, kWhite, 'Au moins une valeur doit être sélectionnée', context, null);
|
||||||
} else {
|
} else {
|
||||||
if (widget.isMultiple) {
|
if (widget.isMultiple) {
|
||||||
widget.selectedValues.contains(item)
|
widget.selectedValues.contains(item)
|
||||||
@ -102,10 +121,17 @@ class _MultiSelectChipState extends State<MultiSelectChip> {
|
|||||||
});
|
});
|
||||||
return choices;
|
return choices;
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Wrap(
|
return Container(
|
||||||
children: _buildChoiceList(),
|
height: maxLines * 48.0, // Assuming each ChoiceChip is 48.0 height
|
||||||
|
child: ListView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
shrinkWrap: true,
|
||||||
|
children: _buildChoiceList(),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:diacritic/diacritic.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
|
import 'package:flutter_widget_from_html/flutter_widget_from_html.dart';
|
||||||
import 'package:manager_app/Components/category_input_container.dart';
|
import 'package:manager_app/Components/category_input_container.dart';
|
||||||
@ -6,7 +7,9 @@ import 'package:manager_app/Components/resource_input_container.dart';
|
|||||||
import 'package:manager_app/Components/multi_select_container.dart';
|
import 'package:manager_app/Components/multi_select_container.dart';
|
||||||
import 'package:manager_app/Components/single_select_container.dart';
|
import 'package:manager_app/Components/single_select_container.dart';
|
||||||
import 'package:manager_app/Components/slider_input_container.dart';
|
import 'package:manager_app/Components/slider_input_container.dart';
|
||||||
|
import 'package:manager_app/Components/string_input_container.dart';
|
||||||
import 'package:manager_app/Screens/Configurations/Section/SubSection/Map/showNewOrUpdateGeoPoint.dart';
|
import 'package:manager_app/Screens/Configurations/Section/SubSection/Map/showNewOrUpdateGeoPoint.dart';
|
||||||
|
import 'package:html/parser.dart' show parse;
|
||||||
import 'package:manager_app/app_context.dart';
|
import 'package:manager_app/app_context.dart';
|
||||||
import 'package:manager_app/constants.dart';
|
import 'package:manager_app/constants.dart';
|
||||||
import 'package:manager_api_new/api.dart';
|
import 'package:manager_api_new/api.dart';
|
||||||
@ -33,16 +36,22 @@ class MapConfig extends StatefulWidget {
|
|||||||
|
|
||||||
class _MapConfigState extends State<MapConfig> {
|
class _MapConfigState extends State<MapConfig> {
|
||||||
late MapDTO mapDTO;
|
late MapDTO mapDTO;
|
||||||
|
late List<GeoPointDTO> pointsToShow;
|
||||||
|
List<String>? selectedCategories = [];
|
||||||
String mapType= "hybrid";
|
String mapType= "hybrid";
|
||||||
String mapTypeMapBox= "standard";
|
String mapTypeMapBox= "standard";
|
||||||
|
|
||||||
|
String filterSearch = '';
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
mapDTO = MapDTO.fromJson(json.decode(widget.initialValue))!;
|
mapDTO = MapDTO.fromJson(json.decode(widget.initialValue))!;
|
||||||
List<GeoPointDTO> test = new List<GeoPointDTO>.from(mapDTO.points!);
|
pointsToShow = new List<GeoPointDTO>.from(mapDTO.points!);
|
||||||
mapDTO.points = test;
|
mapDTO.points = pointsToShow;
|
||||||
|
pointsToShow.sort((a, b) => a.title!.firstWhere((t) => t.language == 'FR').value!.toLowerCase().compareTo(b.title!.firstWhere((t) => t.language == 'FR').value!.toLowerCase()));
|
||||||
|
|
||||||
|
selectedCategories = mapDTO.categories!.map((categorie) => categorie.label!.firstWhere((element) => element.language == 'FR').value!).toList();
|
||||||
|
|
||||||
if(mapDTO.mapType != null) {
|
if(mapDTO.mapType != null) {
|
||||||
switch(mapDTO.mapType!.value) {
|
switch(mapDTO.mapType!.value) {
|
||||||
@ -239,18 +248,18 @@ class _MapConfigState extends State<MapConfig> {
|
|||||||
Container(
|
Container(
|
||||||
constraints: BoxConstraints(minHeight: 100),
|
constraints: BoxConstraints(minHeight: 100),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(top: 40, left: 10, right: 10, bottom: 10),
|
padding: const EdgeInsets.only(top: 95, left: 10, right: 10, bottom: 10),
|
||||||
child: GridView.builder(
|
child: GridView.builder(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 8),
|
gridDelegate: new SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 8),
|
||||||
itemCount: mapDTO.points!.length,
|
itemCount: pointsToShow.length,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
return
|
return
|
||||||
Container(
|
Container(
|
||||||
decoration: boxDecoration(mapDTO.points![index], appContext),
|
decoration: boxDecoration(pointsToShow[index], appContext),
|
||||||
padding: const EdgeInsets.all(5),
|
padding: const EdgeInsets.all(5),
|
||||||
margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
|
margin: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
|
||||||
child: getElement(index, mapDTO.points![index], size, appContext),
|
child: getElement(index, pointsToShow[index], size, appContext),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
@ -264,6 +273,49 @@ class _MapConfigState extends State<MapConfig> {
|
|||||||
style: TextStyle(fontSize: 15),
|
style: TextStyle(fontSize: 15),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Positioned(
|
||||||
|
top: 10,
|
||||||
|
left: 175,
|
||||||
|
child: MultiSelectContainer(
|
||||||
|
label: null,
|
||||||
|
color: kSecond,
|
||||||
|
width: size.width * 0.45,
|
||||||
|
initialValue: selectedCategories!,
|
||||||
|
isMultiple: true,
|
||||||
|
isHTMLLabel : true,
|
||||||
|
values: mapDTO.categories!.map((categorie) => categorie.label!.firstWhere((element) => element.language == 'FR').value!).toList(),
|
||||||
|
onChanged: (value) {
|
||||||
|
var tempOutput = new List<String>.from(value);
|
||||||
|
setState(() {
|
||||||
|
selectedCategories = tempOutput;
|
||||||
|
if(selectedCategories == null || selectedCategories!.length == 0) {
|
||||||
|
pointsToShow = mapDTO.points!.where((point) => point.categorie == null).toList();
|
||||||
|
} else {
|
||||||
|
pointsToShow = mapDTO.points!.where((point) => tempOutput.any((tps) => point.categorie == null || point.categorie?.label?.firstWhere((lab) => lab.language == 'FR').value == tps)).toList();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
)),
|
||||||
|
Positioned(
|
||||||
|
top: 0,
|
||||||
|
right: 150,
|
||||||
|
child: Container(
|
||||||
|
height: size.height*0.1,
|
||||||
|
constraints: BoxConstraints(minHeight: 85),
|
||||||
|
child: StringInputContainer(
|
||||||
|
label: "Recherche:",
|
||||||
|
isSmall: true,
|
||||||
|
fontSize: 15,
|
||||||
|
fontSizeText: 15,
|
||||||
|
onChanged: (String value) {
|
||||||
|
setState(() {
|
||||||
|
filterSearch = value;
|
||||||
|
filterPoints();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
Positioned(
|
Positioned(
|
||||||
top: 10,
|
top: 10,
|
||||||
right: 10,
|
right: 10,
|
||||||
@ -275,6 +327,7 @@ class _MapConfigState extends State<MapConfig> {
|
|||||||
(GeoPointDTO geoPoint) {
|
(GeoPointDTO geoPoint) {
|
||||||
setState(() {
|
setState(() {
|
||||||
mapDTO.points!.add(geoPoint);
|
mapDTO.points!.add(geoPoint);
|
||||||
|
mapDTO.points!.sort((a, b) => a.title!.firstWhere((t) => t.language == 'FR').value!.toLowerCase().compareTo(b.title!.firstWhere((t) => t.language == 'FR').value!.toLowerCase()));
|
||||||
widget.onChanged(jsonEncode(mapDTO).toString());
|
widget.onChanged(jsonEncode(mapDTO).toString());
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -352,6 +405,7 @@ class _MapConfigState extends State<MapConfig> {
|
|||||||
(GeoPointDTO geoPoint) {
|
(GeoPointDTO geoPoint) {
|
||||||
setState(() {
|
setState(() {
|
||||||
mapDTO.points![index] = geoPoint;
|
mapDTO.points![index] = geoPoint;
|
||||||
|
mapDTO.points!.sort((a, b) => a.title!.firstWhere((t) => t.language == 'FR').value!.toLowerCase().compareTo(b.title!.firstWhere((t) => t.language == 'FR').value!.toLowerCase()));
|
||||||
widget.onChanged(jsonEncode(mapDTO).toString());
|
widget.onChanged(jsonEncode(mapDTO).toString());
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -386,6 +440,10 @@ class _MapConfigState extends State<MapConfig> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void filterPoints() {
|
||||||
|
pointsToShow = filterSearch.isEmpty ? mapDTO.points! : mapDTO.points!.where((GeoPointDTO pointGeo) => removeDiacritics(pointGeo.title!.firstWhere((t) => t.language == "FR").value!.toUpperCase()).contains(removeDiacritics(filterSearch.toUpperCase()))).toList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -75,7 +75,7 @@ Future<CategorieDTO?> showNewOrUpdateCategory(CategorieDTO? inputCategorieDTO, A
|
|||||||
isHTML: true,
|
isHTML: true,
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
/*Container(
|
Container(
|
||||||
height: size.height * 0.2,
|
height: size.height * 0.2,
|
||||||
constraints: BoxConstraints(minHeight: 50, maxHeight: 80),
|
constraints: BoxConstraints(minHeight: 50, maxHeight: 80),
|
||||||
child: ResourceInputContainer(
|
child: ResourceInputContainer(
|
||||||
@ -95,7 +95,7 @@ Future<CategorieDTO?> showNewOrUpdateCategory(CategorieDTO? inputCategorieDTO, A
|
|||||||
},
|
},
|
||||||
isSmall: true
|
isSmall: true
|
||||||
),
|
),
|
||||||
),*/
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -51,7 +51,7 @@ void showNewOrUpdateGeoPoint(MapDTO mapDTO, GeoPointDTO? inputGeoPointDTO, Funct
|
|||||||
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: geoPointDTO.latitude == null && geoPointDTO.longitude == null ? LatLong(50.429333, 4.891434) : LatLong(double.parse(geoPointDTO.latitude!), double.parse(geoPointDTO.longitude!)),
|
||||||
minZoomLevel: 5,
|
minZoomLevel: 0,
|
||||||
maxZoomLevel: 17,
|
maxZoomLevel: 17,
|
||||||
markerIcon: const Icon(
|
markerIcon: const Icon(
|
||||||
Icons.location_pin,
|
Icons.location_pin,
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import 'package:manager_app/Screens/Configurations/Section/SubSection/PDF/PDF_co
|
|||||||
import 'package:manager_app/Screens/Configurations/Section/SubSection/Puzzle/puzzle_config.dart';
|
import 'package:manager_app/Screens/Configurations/Section/SubSection/Puzzle/puzzle_config.dart';
|
||||||
import 'package:manager_app/Screens/Configurations/Section/SubSection/Quizz/quizz_config.dart';
|
import 'package:manager_app/Screens/Configurations/Section/SubSection/Quizz/quizz_config.dart';
|
||||||
import 'package:manager_app/Screens/Configurations/Section/SubSection/Slider/slider_config.dart';
|
import 'package:manager_app/Screens/Configurations/Section/SubSection/Slider/slider_config.dart';
|
||||||
|
import 'package:manager_app/Screens/Configurations/Section/SubSection/Weather/weather_config.dart';
|
||||||
import 'package:manager_app/Screens/Configurations/Section/SubSection/WebOrVideo/web_video_config.dart';
|
import 'package:manager_app/Screens/Configurations/Section/SubSection/WebOrVideo/web_video_config.dart';
|
||||||
import 'package:manager_app/app_context.dart';
|
import 'package:manager_app/app_context.dart';
|
||||||
import 'package:manager_app/constants.dart';
|
import 'package:manager_app/constants.dart';
|
||||||
@ -244,5 +245,12 @@ getSpecificData(SectionDTO sectionDTO, BuildContext context, AppContext appConte
|
|||||||
sectionDTO.data = data;
|
sectionDTO.data = data;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
case SectionType.Weather:
|
||||||
|
return WeatherConfig(
|
||||||
|
initialValue: sectionDTO.data!,
|
||||||
|
onChanged: (String data) {
|
||||||
|
sectionDTO.data = data;
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,44 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:manager_app/Components/string_input_container.dart';
|
||||||
|
import 'package:manager_api_new/api.dart';
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
class WeatherConfig extends StatefulWidget {
|
||||||
|
final String? color;
|
||||||
|
final String initialValue;
|
||||||
|
final ValueChanged<String> onChanged; // To return video or web url
|
||||||
|
const WeatherConfig({
|
||||||
|
Key? key,
|
||||||
|
this.color,
|
||||||
|
required this.initialValue,
|
||||||
|
required this.onChanged,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_WeatherConfigState createState() => _WeatherConfigState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _WeatherConfigState extends State<WeatherConfig> {
|
||||||
|
late WeatherDTO resourceSource;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
WeatherDTO test = WeatherDTO.fromJson(json.decode(widget.initialValue))!;
|
||||||
|
resourceSource = test;
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return StringInputContainer(
|
||||||
|
label: "Ville:",
|
||||||
|
initialValue: resourceSource.city == null ? '': resourceSource.city,
|
||||||
|
onChanged: (String city) {
|
||||||
|
resourceSource.city = city;
|
||||||
|
widget.onChanged(jsonEncode(resourceSource).toString());
|
||||||
|
},
|
||||||
|
isUrl: true,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -37,6 +37,8 @@ import 'package:pasteboard/pasteboard.dart';
|
|||||||
|
|
||||||
import 'dart:html' as html;
|
import 'dart:html' as html;
|
||||||
|
|
||||||
|
import 'SubSection/Weather/weather_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);
|
||||||
@ -472,6 +474,14 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
|
|||||||
save(false, sectionDTO, appContext);
|
save(false, sectionDTO, appContext);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
case SectionType.Weather:
|
||||||
|
return WeatherConfig(
|
||||||
|
initialValue: sectionDTO.data!,
|
||||||
|
onChanged: (String data) {
|
||||||
|
sectionDTO.data = data;
|
||||||
|
save(false, sectionDTO, appContext);
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:manager_app/Components/check_input_container.dart';
|
import 'package:manager_app/Components/check_input_container.dart';
|
||||||
import 'package:manager_app/Components/color_picker_input_container.dart';
|
import 'package:manager_app/Components/color_picker_input_container.dart';
|
||||||
import 'package:manager_app/Components/confirmation_dialog.dart';
|
import 'package:manager_app/Components/confirmation_dialog.dart';
|
||||||
|
import 'package:manager_app/Components/number_input_container.dart';
|
||||||
import 'package:manager_app/Components/resource_input_container.dart';
|
import 'package:manager_app/Components/resource_input_container.dart';
|
||||||
import 'package:manager_app/Components/loading_common.dart';
|
import 'package:manager_app/Components/loading_common.dart';
|
||||||
import 'package:manager_app/Components/message_notification.dart';
|
import 'package:manager_app/Components/message_notification.dart';
|
||||||
@ -204,6 +205,15 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
CheckInputContainer(
|
||||||
|
icon: Icons.image_not_supported_outlined,
|
||||||
|
label: "Background sur les images :",
|
||||||
|
fontSize: 20,
|
||||||
|
isChecked: configurationDTO.isSectionImageBackground,
|
||||||
|
onChanged: (value) {
|
||||||
|
configurationDTO.isSectionImageBackground = value;
|
||||||
|
},
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Column(
|
Column(
|
||||||
@ -324,7 +334,42 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
SizedBox(
|
Container(
|
||||||
|
height: 100,
|
||||||
|
child: NumberInputContainer(
|
||||||
|
label: "Pourcentage place des sections :",
|
||||||
|
initialValue: configurationDTO.screenPercentageSectionsMainPage ?? 0,
|
||||||
|
isSmall: true,
|
||||||
|
maxLength: 2,
|
||||||
|
onChanged: (value) {
|
||||||
|
try {
|
||||||
|
configurationDTO.screenPercentageSectionsMainPage = int.parse(value);
|
||||||
|
} catch (e) {
|
||||||
|
print('Screen percentage value not a number');
|
||||||
|
showNotification(Colors.orange, kWhite, 'Cela doit être un chiffre', context, null);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: 100,
|
||||||
|
child: NumberInputContainer(
|
||||||
|
label: "Pourcentage des arrondis (0-50) :",
|
||||||
|
initialValue: configurationDTO.roundedValue ?? 0,
|
||||||
|
isSmall: true,
|
||||||
|
maxLength: 2,
|
||||||
|
onChanged: (value) {
|
||||||
|
try {
|
||||||
|
configurationDTO.roundedValue = int.parse(value);
|
||||||
|
} catch (e) {
|
||||||
|
print('Rounded value not a number');
|
||||||
|
showNotification(Colors.orange, kWhite, 'Cela doit être un chiffre', context, null);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// It's a section now
|
||||||
|
/*SizedBox(
|
||||||
height: 100,
|
height: 100,
|
||||||
child: StringInputContainer(
|
child: StringInputContainer(
|
||||||
label: "Ville météo :",
|
label: "Ville météo :",
|
||||||
@ -334,7 +379,7 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
|
|||||||
configurationDTO.weatherCity = value;
|
configurationDTO.weatherCity = value;
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),*/
|
||||||
])
|
])
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -8,6 +8,7 @@ import 'package:manager_app/Models/managerContext.dart';
|
|||||||
import 'package:manager_app/app_context.dart';
|
import 'package:manager_app/app_context.dart';
|
||||||
import 'package:manager_app/constants.dart';
|
import 'package:manager_app/constants.dart';
|
||||||
import 'package:manager_api_new/api.dart';
|
import 'package:manager_api_new/api.dart';
|
||||||
|
import 'dart:html' as html;
|
||||||
|
|
||||||
import 'get_element_for_resource.dart';
|
import 'get_element_for_resource.dart';
|
||||||
|
|
||||||
@ -101,6 +102,30 @@ Future<ResourceDTO?> showResource(ResourceDTO resourceDTO, AppContext appContext
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Align(
|
||||||
|
alignment: AlignmentDirectional.bottomEnd,
|
||||||
|
child: Container(
|
||||||
|
width: 220,
|
||||||
|
height: 70,
|
||||||
|
child: RoundedButton(
|
||||||
|
text: "Télécharger",
|
||||||
|
icon: Icons.download,
|
||||||
|
color: kPrimaryColor,
|
||||||
|
press: () {
|
||||||
|
if(resourceDTO.url != null) {
|
||||||
|
html.AnchorElement anchorElement = html.AnchorElement(href: resourceDTO.url!);
|
||||||
|
anchorElement.download = '${resourceDTO.label}.json';
|
||||||
|
anchorElement.target = '_blank';
|
||||||
|
anchorElement.click();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
fontSize: 20,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
child: Align(
|
child: Align(
|
||||||
|
|||||||
@ -1505,6 +1505,20 @@ paths:
|
|||||||
$ref: '#/components/schemas/AgendaDTO'
|
$ref: '#/components/schemas/AgendaDTO'
|
||||||
security:
|
security:
|
||||||
- bearer: []
|
- bearer: []
|
||||||
|
/api/Section/WeatherDTO:
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- Section
|
||||||
|
operationId: Section_GetWeatherDTO
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: ''
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/WeatherDTO'
|
||||||
|
security:
|
||||||
|
- bearer: []
|
||||||
/api/User:
|
/api/User:
|
||||||
get:
|
get:
|
||||||
tags:
|
tags:
|
||||||
@ -1827,6 +1841,16 @@ components:
|
|||||||
type: boolean
|
type: boolean
|
||||||
isHour:
|
isHour:
|
||||||
type: boolean
|
type: boolean
|
||||||
|
isSectionImageBackground:
|
||||||
|
type: boolean
|
||||||
|
roundedValue:
|
||||||
|
type: integer
|
||||||
|
format: int32
|
||||||
|
nullable: true
|
||||||
|
screenPercentageSectionsMainPage:
|
||||||
|
type: integer
|
||||||
|
format: int32
|
||||||
|
nullable: true
|
||||||
TranslationDTO:
|
TranslationDTO:
|
||||||
type: object
|
type: object
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
@ -1931,6 +1955,7 @@ components:
|
|||||||
7 = PDF
|
7 = PDF
|
||||||
8 = Puzzle
|
8 = Puzzle
|
||||||
9 = Agenda
|
9 = Agenda
|
||||||
|
10 = Weather
|
||||||
x-enumNames:
|
x-enumNames:
|
||||||
- Map
|
- Map
|
||||||
- Slider
|
- Slider
|
||||||
@ -1942,6 +1967,7 @@ components:
|
|||||||
- PDF
|
- PDF
|
||||||
- Puzzle
|
- Puzzle
|
||||||
- Agenda
|
- Agenda
|
||||||
|
- Weather
|
||||||
enum:
|
enum:
|
||||||
- 0
|
- 0
|
||||||
- 1
|
- 1
|
||||||
@ -1953,6 +1979,7 @@ components:
|
|||||||
- 7
|
- 7
|
||||||
- 8
|
- 8
|
||||||
- 9
|
- 9
|
||||||
|
- 10
|
||||||
ResourceDTO:
|
ResourceDTO:
|
||||||
type: object
|
type: object
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
@ -2216,6 +2243,31 @@ components:
|
|||||||
longitude:
|
longitude:
|
||||||
type: string
|
type: string
|
||||||
nullable: true
|
nullable: true
|
||||||
|
schedules:
|
||||||
|
type: array
|
||||||
|
nullable: true
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/TranslationDTO'
|
||||||
|
prices:
|
||||||
|
type: array
|
||||||
|
nullable: true
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/TranslationDTO'
|
||||||
|
phone:
|
||||||
|
type: array
|
||||||
|
nullable: true
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/TranslationDTO'
|
||||||
|
email:
|
||||||
|
type: array
|
||||||
|
nullable: true
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/TranslationDTO'
|
||||||
|
site:
|
||||||
|
type: array
|
||||||
|
nullable: true
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/TranslationDTO'
|
||||||
ContentGeoPoint:
|
ContentGeoPoint:
|
||||||
type: object
|
type: object
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
@ -2495,6 +2547,20 @@ components:
|
|||||||
nullable: true
|
nullable: true
|
||||||
oneOf:
|
oneOf:
|
||||||
- $ref: '#/components/schemas/MapProvider'
|
- $ref: '#/components/schemas/MapProvider'
|
||||||
|
WeatherDTO:
|
||||||
|
type: object
|
||||||
|
additionalProperties: false
|
||||||
|
properties:
|
||||||
|
city:
|
||||||
|
type: string
|
||||||
|
nullable: true
|
||||||
|
updatedDate:
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
|
nullable: true
|
||||||
|
result:
|
||||||
|
type: string
|
||||||
|
nullable: true
|
||||||
User:
|
User:
|
||||||
type: object
|
type: object
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
|
|||||||
@ -16,7 +16,7 @@ const kWhite = Color(0xFFFFFFFF);
|
|||||||
const kBlack = Color(0xFF000000);
|
const kBlack = Color(0xFF000000);
|
||||||
const kSuccess = Color(0xFF8bc34a);
|
const kSuccess = Color(0xFF8bc34a);
|
||||||
|
|
||||||
const List<String> section_types = ["Map", "Slider", "Video", "Web", "Menu", "Quizz", "Article", "PDF", "Puzzle", "Agenda"];
|
const List<String> section_types = ["Map", "Slider", "Video", "Web", "Menu", "Quizz", "Article", "PDF", "Puzzle", "Agenda", "Weather"];
|
||||||
const List<String> map_types = ["none", "normal", "satellite", "terrain", "hybrid"];
|
const List<String> map_types = ["none", "normal", "satellite", "terrain", "hybrid"];
|
||||||
const List<String> languages = ["FR", "NL", "EN", "DE", "IT", "ES", "CN", "PL", "AR", "UK"];
|
const List<String> languages = ["FR", "NL", "EN", "DE", "IT", "ES", "CN", "PL", "AR", "UK"];
|
||||||
const List<String> map_types_mapBox = ["standard", "streets", "outdoors", "light", "dark", "satellite", "satellite_streets"];
|
const List<String> map_types_mapBox = ["standard", "streets", "outdoors", "light", "dark", "satellite", "satellite_streets"];
|
||||||
|
|||||||
@ -54,6 +54,7 @@ doc/User.md
|
|||||||
doc/UserApi.md
|
doc/UserApi.md
|
||||||
doc/UserDetailDTO.md
|
doc/UserDetailDTO.md
|
||||||
doc/VideoDTO.md
|
doc/VideoDTO.md
|
||||||
|
doc/WeatherDTO.md
|
||||||
doc/WebDTO.md
|
doc/WebDTO.md
|
||||||
git_push.sh
|
git_push.sh
|
||||||
lib/api.dart
|
lib/api.dart
|
||||||
@ -117,6 +118,8 @@ lib/model/translation_dto.dart
|
|||||||
lib/model/user.dart
|
lib/model/user.dart
|
||||||
lib/model/user_detail_dto.dart
|
lib/model/user_detail_dto.dart
|
||||||
lib/model/video_dto.dart
|
lib/model/video_dto.dart
|
||||||
|
lib/model/weather_dto.dart
|
||||||
lib/model/web_dto.dart
|
lib/model/web_dto.dart
|
||||||
pubspec.yaml
|
pubspec.yaml
|
||||||
test/pdf_file_dto_test.dart
|
test/pdf_file_dto_test.dart
|
||||||
|
test/weather_dto_test.dart
|
||||||
|
|||||||
@ -110,6 +110,7 @@ Class | Method | HTTP request | Description
|
|||||||
*SectionApi* | [**sectionGetQuizzDTO**](doc\/SectionApi.md#sectiongetquizzdto) | **GET** /api/Section/QuizzDTO |
|
*SectionApi* | [**sectionGetQuizzDTO**](doc\/SectionApi.md#sectiongetquizzdto) | **GET** /api/Section/QuizzDTO |
|
||||||
*SectionApi* | [**sectionGetSliderDTO**](doc\/SectionApi.md#sectiongetsliderdto) | **GET** /api/Section/SliderDTO |
|
*SectionApi* | [**sectionGetSliderDTO**](doc\/SectionApi.md#sectiongetsliderdto) | **GET** /api/Section/SliderDTO |
|
||||||
*SectionApi* | [**sectionGetVideoDTO**](doc\/SectionApi.md#sectiongetvideodto) | **GET** /api/Section/VideoDTO |
|
*SectionApi* | [**sectionGetVideoDTO**](doc\/SectionApi.md#sectiongetvideodto) | **GET** /api/Section/VideoDTO |
|
||||||
|
*SectionApi* | [**sectionGetWeatherDTO**](doc\/SectionApi.md#sectiongetweatherdto) | **GET** /api/Section/WeatherDTO |
|
||||||
*SectionApi* | [**sectionGetWebDTO**](doc\/SectionApi.md#sectiongetwebdto) | **GET** /api/Section/WebDTO |
|
*SectionApi* | [**sectionGetWebDTO**](doc\/SectionApi.md#sectiongetwebdto) | **GET** /api/Section/WebDTO |
|
||||||
*SectionApi* | [**sectionPlayerMessageDTO**](doc\/SectionApi.md#sectionplayermessagedto) | **GET** /api/Section/PlayerMessageDTO |
|
*SectionApi* | [**sectionPlayerMessageDTO**](doc\/SectionApi.md#sectionplayermessagedto) | **GET** /api/Section/PlayerMessageDTO |
|
||||||
*SectionApi* | [**sectionUpdate**](doc\/SectionApi.md#sectionupdate) | **PUT** /api/Section |
|
*SectionApi* | [**sectionUpdate**](doc\/SectionApi.md#sectionupdate) | **PUT** /api/Section |
|
||||||
@ -168,6 +169,7 @@ Class | Method | HTTP request | Description
|
|||||||
- [User](doc\/User.md)
|
- [User](doc\/User.md)
|
||||||
- [UserDetailDTO](doc\/UserDetailDTO.md)
|
- [UserDetailDTO](doc\/UserDetailDTO.md)
|
||||||
- [VideoDTO](doc\/VideoDTO.md)
|
- [VideoDTO](doc\/VideoDTO.md)
|
||||||
|
- [WeatherDTO](doc\/WeatherDTO.md)
|
||||||
- [WebDTO](doc\/WebDTO.md)
|
- [WebDTO](doc\/WebDTO.md)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -30,6 +30,9 @@ Name | Type | Description | Notes
|
|||||||
**isWeather** | **bool** | | [optional]
|
**isWeather** | **bool** | | [optional]
|
||||||
**isDate** | **bool** | | [optional]
|
**isDate** | **bool** | | [optional]
|
||||||
**isHour** | **bool** | | [optional]
|
**isHour** | **bool** | | [optional]
|
||||||
|
**isSectionImageBackground** | **bool** | | [optional]
|
||||||
|
**roundedValue** | **int** | | [optional]
|
||||||
|
**screenPercentageSectionsMainPage** | **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)
|
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|||||||
@ -30,6 +30,9 @@ Name | Type | Description | Notes
|
|||||||
**isWeather** | **bool** | | [optional]
|
**isWeather** | **bool** | | [optional]
|
||||||
**isDate** | **bool** | | [optional]
|
**isDate** | **bool** | | [optional]
|
||||||
**isHour** | **bool** | | [optional]
|
**isHour** | **bool** | | [optional]
|
||||||
|
**isSectionImageBackground** | **bool** | | [optional]
|
||||||
|
**roundedValue** | **int** | | [optional]
|
||||||
|
**screenPercentageSectionsMainPage** | **int** | | [optional]
|
||||||
**sections** | [**List<SectionDTO>**](SectionDTO.md) | | [optional] [default to const []]
|
**sections** | [**List<SectionDTO>**](SectionDTO.md) | | [optional] [default to const []]
|
||||||
**resources** | [**List<ResourceDTO>**](ResourceDTO.md) | | [optional] [default to const []]
|
**resources** | [**List<ResourceDTO>**](ResourceDTO.md) | | [optional] [default to const []]
|
||||||
|
|
||||||
|
|||||||
@ -15,6 +15,11 @@ Name | Type | Description | Notes
|
|||||||
**categorie** | [**GeoPointDTOCategorie**](GeoPointDTOCategorie.md) | | [optional]
|
**categorie** | [**GeoPointDTOCategorie**](GeoPointDTOCategorie.md) | | [optional]
|
||||||
**latitude** | **String** | | [optional]
|
**latitude** | **String** | | [optional]
|
||||||
**longitude** | **String** | | [optional]
|
**longitude** | **String** | | [optional]
|
||||||
|
**schedules** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
|
||||||
|
**prices** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
|
||||||
|
**phone** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
|
||||||
|
**email** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
|
||||||
|
**site** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
|
||||||
|
|
||||||
[[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)
|
||||||
|
|
||||||
|
|||||||
@ -26,6 +26,7 @@ Method | HTTP request | Description
|
|||||||
[**sectionGetQuizzDTO**](SectionApi.md#sectiongetquizzdto) | **GET** /api/Section/QuizzDTO |
|
[**sectionGetQuizzDTO**](SectionApi.md#sectiongetquizzdto) | **GET** /api/Section/QuizzDTO |
|
||||||
[**sectionGetSliderDTO**](SectionApi.md#sectiongetsliderdto) | **GET** /api/Section/SliderDTO |
|
[**sectionGetSliderDTO**](SectionApi.md#sectiongetsliderdto) | **GET** /api/Section/SliderDTO |
|
||||||
[**sectionGetVideoDTO**](SectionApi.md#sectiongetvideodto) | **GET** /api/Section/VideoDTO |
|
[**sectionGetVideoDTO**](SectionApi.md#sectiongetvideodto) | **GET** /api/Section/VideoDTO |
|
||||||
|
[**sectionGetWeatherDTO**](SectionApi.md#sectiongetweatherdto) | **GET** /api/Section/WeatherDTO |
|
||||||
[**sectionGetWebDTO**](SectionApi.md#sectiongetwebdto) | **GET** /api/Section/WebDTO |
|
[**sectionGetWebDTO**](SectionApi.md#sectiongetwebdto) | **GET** /api/Section/WebDTO |
|
||||||
[**sectionPlayerMessageDTO**](SectionApi.md#sectionplayermessagedto) | **GET** /api/Section/PlayerMessageDTO |
|
[**sectionPlayerMessageDTO**](SectionApi.md#sectionplayermessagedto) | **GET** /api/Section/PlayerMessageDTO |
|
||||||
[**sectionUpdate**](SectionApi.md#sectionupdate) | **PUT** /api/Section |
|
[**sectionUpdate**](SectionApi.md#sectionupdate) | **PUT** /api/Section |
|
||||||
@ -727,6 +728,45 @@ This endpoint does not need any parameter.
|
|||||||
|
|
||||||
[[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)
|
||||||
|
|
||||||
|
# **sectionGetWeatherDTO**
|
||||||
|
> WeatherDTO sectionGetWeatherDTO()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
```dart
|
||||||
|
import 'package:manager_api_new/api.dart';
|
||||||
|
// TODO Configure OAuth2 access token for authorization: bearer
|
||||||
|
//defaultApiClient.getAuthentication<OAuth>('bearer').accessToken = 'YOUR_ACCESS_TOKEN';
|
||||||
|
|
||||||
|
final api_instance = SectionApi();
|
||||||
|
|
||||||
|
try {
|
||||||
|
final result = api_instance.sectionGetWeatherDTO();
|
||||||
|
print(result);
|
||||||
|
} catch (e) {
|
||||||
|
print('Exception when calling SectionApi->sectionGetWeatherDTO: $e\n');
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Parameters
|
||||||
|
This endpoint does not need any parameter.
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
[**WeatherDTO**](WeatherDTO.md)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
[bearer](../README.md#bearer)
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: application/json
|
||||||
|
|
||||||
|
[[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)
|
||||||
|
|
||||||
# **sectionGetWebDTO**
|
# **sectionGetWebDTO**
|
||||||
> WebDTO sectionGetWebDTO()
|
> WebDTO sectionGetWebDTO()
|
||||||
|
|
||||||
|
|||||||
17
manager_api_new/doc/WeatherDTO.md
Normal file
17
manager_api_new/doc/WeatherDTO.md
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
# manager_api_new.model.WeatherDTO
|
||||||
|
|
||||||
|
## Load the model package
|
||||||
|
```dart
|
||||||
|
import 'package:manager_api_new/api.dart';
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------ | ------------- | ------------- | -------------
|
||||||
|
**city** | **String** | | [optional]
|
||||||
|
**updatedDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
**result** | **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)
|
||||||
|
|
||||||
|
|
||||||
@ -80,6 +80,7 @@ part 'model/translation_dto.dart';
|
|||||||
part 'model/user.dart';
|
part 'model/user.dart';
|
||||||
part 'model/user_detail_dto.dart';
|
part 'model/user_detail_dto.dart';
|
||||||
part 'model/video_dto.dart';
|
part 'model/video_dto.dart';
|
||||||
|
part 'model/weather_dto.dart';
|
||||||
part 'model/web_dto.dart';
|
part 'model/web_dto.dart';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -783,6 +783,47 @@ class SectionApi {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Performs an HTTP 'GET /api/Section/WeatherDTO' operation and returns the [Response].
|
||||||
|
Future<Response> sectionGetWeatherDTOWithHttpInfo() async {
|
||||||
|
// ignore: prefer_const_declarations
|
||||||
|
final path = r'/api/Section/WeatherDTO';
|
||||||
|
|
||||||
|
// ignore: prefer_final_locals
|
||||||
|
Object? postBody;
|
||||||
|
|
||||||
|
final queryParams = <QueryParam>[];
|
||||||
|
final headerParams = <String, String>{};
|
||||||
|
final formParams = <String, String>{};
|
||||||
|
|
||||||
|
const contentTypes = <String>[];
|
||||||
|
|
||||||
|
|
||||||
|
return apiClient.invokeAPI(
|
||||||
|
path,
|
||||||
|
'GET',
|
||||||
|
queryParams,
|
||||||
|
postBody,
|
||||||
|
headerParams,
|
||||||
|
formParams,
|
||||||
|
contentTypes.isEmpty ? null : contentTypes.first,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<WeatherDTO?> sectionGetWeatherDTO() async {
|
||||||
|
final response = await sectionGetWeatherDTOWithHttpInfo();
|
||||||
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||||
|
}
|
||||||
|
// When a remote server returns no body with a status of 204, we shall not decode it.
|
||||||
|
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
|
||||||
|
// FormatException when trying to decode an empty string.
|
||||||
|
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
|
||||||
|
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'WeatherDTO',) as WeatherDTO;
|
||||||
|
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/// Performs an HTTP 'GET /api/Section/WebDTO' operation and returns the [Response].
|
/// Performs an HTTP 'GET /api/Section/WebDTO' operation and returns the [Response].
|
||||||
Future<Response> sectionGetWebDTOWithHttpInfo() async {
|
Future<Response> sectionGetWebDTOWithHttpInfo() async {
|
||||||
// ignore: prefer_const_declarations
|
// ignore: prefer_const_declarations
|
||||||
|
|||||||
@ -271,6 +271,8 @@ class ApiClient {
|
|||||||
return UserDetailDTO.fromJson(value);
|
return UserDetailDTO.fromJson(value);
|
||||||
case 'VideoDTO':
|
case 'VideoDTO':
|
||||||
return VideoDTO.fromJson(value);
|
return VideoDTO.fromJson(value);
|
||||||
|
case 'WeatherDTO':
|
||||||
|
return WeatherDTO.fromJson(value);
|
||||||
case 'WebDTO':
|
case 'WebDTO':
|
||||||
return WebDTO.fromJson(value);
|
return WebDTO.fromJson(value);
|
||||||
default:
|
default:
|
||||||
|
|||||||
@ -35,6 +35,9 @@ class ConfigurationDTO {
|
|||||||
this.isWeather,
|
this.isWeather,
|
||||||
this.isDate,
|
this.isDate,
|
||||||
this.isHour,
|
this.isHour,
|
||||||
|
this.isSectionImageBackground,
|
||||||
|
this.roundedValue,
|
||||||
|
this.screenPercentageSectionsMainPage,
|
||||||
});
|
});
|
||||||
|
|
||||||
String? id;
|
String? id;
|
||||||
@ -123,6 +126,18 @@ class ConfigurationDTO {
|
|||||||
///
|
///
|
||||||
bool? isHour;
|
bool? isHour;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
bool? isSectionImageBackground;
|
||||||
|
|
||||||
|
int? roundedValue;
|
||||||
|
|
||||||
|
int? screenPercentageSectionsMainPage;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO &&
|
bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO &&
|
||||||
other.id == id &&
|
other.id == id &&
|
||||||
@ -146,7 +161,10 @@ class ConfigurationDTO {
|
|||||||
other.weatherResult == weatherResult &&
|
other.weatherResult == weatherResult &&
|
||||||
other.isWeather == isWeather &&
|
other.isWeather == isWeather &&
|
||||||
other.isDate == isDate &&
|
other.isDate == isDate &&
|
||||||
other.isHour == isHour;
|
other.isHour == isHour &&
|
||||||
|
other.isSectionImageBackground == isSectionImageBackground &&
|
||||||
|
other.roundedValue == roundedValue &&
|
||||||
|
other.screenPercentageSectionsMainPage == screenPercentageSectionsMainPage;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode =>
|
int get hashCode =>
|
||||||
@ -172,10 +190,13 @@ class ConfigurationDTO {
|
|||||||
(weatherResult == null ? 0 : weatherResult!.hashCode) +
|
(weatherResult == null ? 0 : weatherResult!.hashCode) +
|
||||||
(isWeather == null ? 0 : isWeather!.hashCode) +
|
(isWeather == null ? 0 : isWeather!.hashCode) +
|
||||||
(isDate == null ? 0 : isDate!.hashCode) +
|
(isDate == null ? 0 : isDate!.hashCode) +
|
||||||
(isHour == null ? 0 : isHour!.hashCode);
|
(isHour == null ? 0 : isHour!.hashCode) +
|
||||||
|
(isSectionImageBackground == null ? 0 : isSectionImageBackground!.hashCode) +
|
||||||
|
(roundedValue == null ? 0 : roundedValue!.hashCode) +
|
||||||
|
(screenPercentageSectionsMainPage == null ? 0 : screenPercentageSectionsMainPage!.hashCode);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() => 'ConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, instanceId=$instanceId, sectionIds=$sectionIds, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, weatherCity=$weatherCity, weatherUpdatedDate=$weatherUpdatedDate, weatherResult=$weatherResult, isWeather=$isWeather, isDate=$isDate, isHour=$isHour]';
|
String toString() => 'ConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, instanceId=$instanceId, sectionIds=$sectionIds, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, weatherCity=$weatherCity, weatherUpdatedDate=$weatherUpdatedDate, weatherResult=$weatherResult, isWeather=$isWeather, isDate=$isDate, isHour=$isHour, isSectionImageBackground=$isSectionImageBackground, roundedValue=$roundedValue, screenPercentageSectionsMainPage=$screenPercentageSectionsMainPage]';
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final json = <String, dynamic>{};
|
final json = <String, dynamic>{};
|
||||||
@ -289,6 +310,21 @@ class ConfigurationDTO {
|
|||||||
} else {
|
} else {
|
||||||
json[r'isHour'] = null;
|
json[r'isHour'] = null;
|
||||||
}
|
}
|
||||||
|
if (this.isSectionImageBackground != null) {
|
||||||
|
json[r'isSectionImageBackground'] = this.isSectionImageBackground;
|
||||||
|
} else {
|
||||||
|
json[r'isSectionImageBackground'] = null;
|
||||||
|
}
|
||||||
|
if (this.roundedValue != null) {
|
||||||
|
json[r'roundedValue'] = this.roundedValue;
|
||||||
|
} else {
|
||||||
|
json[r'roundedValue'] = null;
|
||||||
|
}
|
||||||
|
if (this.screenPercentageSectionsMainPage != null) {
|
||||||
|
json[r'screenPercentageSectionsMainPage'] = this.screenPercentageSectionsMainPage;
|
||||||
|
} else {
|
||||||
|
json[r'screenPercentageSectionsMainPage'] = null;
|
||||||
|
}
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -337,6 +373,9 @@ class ConfigurationDTO {
|
|||||||
isWeather: mapValueOfType<bool>(json, r'isWeather'),
|
isWeather: mapValueOfType<bool>(json, r'isWeather'),
|
||||||
isDate: mapValueOfType<bool>(json, r'isDate'),
|
isDate: mapValueOfType<bool>(json, r'isDate'),
|
||||||
isHour: mapValueOfType<bool>(json, r'isHour'),
|
isHour: mapValueOfType<bool>(json, r'isHour'),
|
||||||
|
isSectionImageBackground: mapValueOfType<bool>(json, r'isSectionImageBackground'),
|
||||||
|
roundedValue: mapValueOfType<int>(json, r'roundedValue'),
|
||||||
|
screenPercentageSectionsMainPage: mapValueOfType<int>(json, r'screenPercentageSectionsMainPage'),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -35,6 +35,9 @@ class ExportConfigurationDTO {
|
|||||||
this.isWeather,
|
this.isWeather,
|
||||||
this.isDate,
|
this.isDate,
|
||||||
this.isHour,
|
this.isHour,
|
||||||
|
this.isSectionImageBackground,
|
||||||
|
this.roundedValue,
|
||||||
|
this.screenPercentageSectionsMainPage,
|
||||||
this.sections = const [],
|
this.sections = const [],
|
||||||
this.resources = const [],
|
this.resources = const [],
|
||||||
});
|
});
|
||||||
@ -125,6 +128,18 @@ class ExportConfigurationDTO {
|
|||||||
///
|
///
|
||||||
bool? isHour;
|
bool? isHour;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// Please note: This property should have been non-nullable! Since the specification file
|
||||||
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
|
/// source code must fall back to having a nullable type.
|
||||||
|
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||||
|
///
|
||||||
|
bool? isSectionImageBackground;
|
||||||
|
|
||||||
|
int? roundedValue;
|
||||||
|
|
||||||
|
int? screenPercentageSectionsMainPage;
|
||||||
|
|
||||||
List<SectionDTO>? sections;
|
List<SectionDTO>? sections;
|
||||||
|
|
||||||
List<ResourceDTO>? resources;
|
List<ResourceDTO>? resources;
|
||||||
@ -153,6 +168,9 @@ class ExportConfigurationDTO {
|
|||||||
other.isWeather == isWeather &&
|
other.isWeather == isWeather &&
|
||||||
other.isDate == isDate &&
|
other.isDate == isDate &&
|
||||||
other.isHour == isHour &&
|
other.isHour == isHour &&
|
||||||
|
other.isSectionImageBackground == isSectionImageBackground &&
|
||||||
|
other.roundedValue == roundedValue &&
|
||||||
|
other.screenPercentageSectionsMainPage == screenPercentageSectionsMainPage &&
|
||||||
other.sections == sections &&
|
other.sections == sections &&
|
||||||
other.resources == resources;
|
other.resources == resources;
|
||||||
|
|
||||||
@ -181,11 +199,14 @@ class ExportConfigurationDTO {
|
|||||||
(isWeather == null ? 0 : isWeather!.hashCode) +
|
(isWeather == null ? 0 : isWeather!.hashCode) +
|
||||||
(isDate == null ? 0 : isDate!.hashCode) +
|
(isDate == null ? 0 : isDate!.hashCode) +
|
||||||
(isHour == null ? 0 : isHour!.hashCode) +
|
(isHour == null ? 0 : isHour!.hashCode) +
|
||||||
|
(isSectionImageBackground == null ? 0 : isSectionImageBackground!.hashCode) +
|
||||||
|
(roundedValue == null ? 0 : roundedValue!.hashCode) +
|
||||||
|
(screenPercentageSectionsMainPage == null ? 0 : screenPercentageSectionsMainPage!.hashCode) +
|
||||||
(sections == null ? 0 : sections!.hashCode) +
|
(sections == null ? 0 : sections!.hashCode) +
|
||||||
(resources == null ? 0 : resources!.hashCode);
|
(resources == null ? 0 : resources!.hashCode);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() => 'ExportConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, instanceId=$instanceId, sectionIds=$sectionIds, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, weatherCity=$weatherCity, weatherUpdatedDate=$weatherUpdatedDate, weatherResult=$weatherResult, isWeather=$isWeather, isDate=$isDate, isHour=$isHour, sections=$sections, resources=$resources]';
|
String toString() => 'ExportConfigurationDTO[id=$id, label=$label, title=$title, imageId=$imageId, imageSource=$imageSource, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, instanceId=$instanceId, sectionIds=$sectionIds, loaderImageId=$loaderImageId, loaderImageUrl=$loaderImageUrl, weatherCity=$weatherCity, weatherUpdatedDate=$weatherUpdatedDate, weatherResult=$weatherResult, isWeather=$isWeather, isDate=$isDate, isHour=$isHour, isSectionImageBackground=$isSectionImageBackground, roundedValue=$roundedValue, screenPercentageSectionsMainPage=$screenPercentageSectionsMainPage, sections=$sections, resources=$resources]';
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final json = <String, dynamic>{};
|
final json = <String, dynamic>{};
|
||||||
@ -299,6 +320,21 @@ class ExportConfigurationDTO {
|
|||||||
} else {
|
} else {
|
||||||
json[r'isHour'] = null;
|
json[r'isHour'] = null;
|
||||||
}
|
}
|
||||||
|
if (this.isSectionImageBackground != null) {
|
||||||
|
json[r'isSectionImageBackground'] = this.isSectionImageBackground;
|
||||||
|
} else {
|
||||||
|
json[r'isSectionImageBackground'] = null;
|
||||||
|
}
|
||||||
|
if (this.roundedValue != null) {
|
||||||
|
json[r'roundedValue'] = this.roundedValue;
|
||||||
|
} else {
|
||||||
|
json[r'roundedValue'] = null;
|
||||||
|
}
|
||||||
|
if (this.screenPercentageSectionsMainPage != null) {
|
||||||
|
json[r'screenPercentageSectionsMainPage'] = this.screenPercentageSectionsMainPage;
|
||||||
|
} else {
|
||||||
|
json[r'screenPercentageSectionsMainPage'] = null;
|
||||||
|
}
|
||||||
if (this.sections != null) {
|
if (this.sections != null) {
|
||||||
json[r'sections'] = this.sections;
|
json[r'sections'] = this.sections;
|
||||||
} else {
|
} else {
|
||||||
@ -357,6 +393,9 @@ class ExportConfigurationDTO {
|
|||||||
isWeather: mapValueOfType<bool>(json, r'isWeather'),
|
isWeather: mapValueOfType<bool>(json, r'isWeather'),
|
||||||
isDate: mapValueOfType<bool>(json, r'isDate'),
|
isDate: mapValueOfType<bool>(json, r'isDate'),
|
||||||
isHour: mapValueOfType<bool>(json, r'isHour'),
|
isHour: mapValueOfType<bool>(json, r'isHour'),
|
||||||
|
isSectionImageBackground: mapValueOfType<bool>(json, r'isSectionImageBackground'),
|
||||||
|
roundedValue: mapValueOfType<int>(json, r'roundedValue'),
|
||||||
|
screenPercentageSectionsMainPage: mapValueOfType<int>(json, r'screenPercentageSectionsMainPage'),
|
||||||
sections: SectionDTO.listFromJson(json[r'sections']),
|
sections: SectionDTO.listFromJson(json[r'sections']),
|
||||||
resources: ResourceDTO.listFromJson(json[r'resources']),
|
resources: ResourceDTO.listFromJson(json[r'resources']),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -20,14 +20,13 @@ class GeoPointDTO {
|
|||||||
this.categorie,
|
this.categorie,
|
||||||
this.latitude,
|
this.latitude,
|
||||||
this.longitude,
|
this.longitude,
|
||||||
|
this.schedules = const [],
|
||||||
|
this.prices = const [],
|
||||||
|
this.phone = const [],
|
||||||
|
this.email = const [],
|
||||||
|
this.site = const [],
|
||||||
});
|
});
|
||||||
|
|
||||||
///
|
|
||||||
/// Please note: This property should have been non-nullable! Since the specification file
|
|
||||||
/// does not include a default value (using the "default:" property), however, the generated
|
|
||||||
/// source code must fall back to having a nullable type.
|
|
||||||
/// Consider adding a "default:" property in the specification file to hide this note.
|
|
||||||
///
|
|
||||||
int? id;
|
int? id;
|
||||||
|
|
||||||
List<TranslationDTO>? title;
|
List<TranslationDTO>? title;
|
||||||
@ -42,6 +41,16 @@ class GeoPointDTO {
|
|||||||
|
|
||||||
String? longitude;
|
String? longitude;
|
||||||
|
|
||||||
|
List<TranslationDTO>? schedules;
|
||||||
|
|
||||||
|
List<TranslationDTO>? prices;
|
||||||
|
|
||||||
|
List<TranslationDTO>? phone;
|
||||||
|
|
||||||
|
List<TranslationDTO>? email;
|
||||||
|
|
||||||
|
List<TranslationDTO>? site;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) => identical(this, other) || other is GeoPointDTO &&
|
bool operator ==(Object other) => identical(this, other) || other is GeoPointDTO &&
|
||||||
other.id == id &&
|
other.id == id &&
|
||||||
@ -50,7 +59,12 @@ class GeoPointDTO {
|
|||||||
other.contents == contents &&
|
other.contents == contents &&
|
||||||
other.categorie == categorie &&
|
other.categorie == categorie &&
|
||||||
other.latitude == latitude &&
|
other.latitude == latitude &&
|
||||||
other.longitude == longitude;
|
other.longitude == longitude &&
|
||||||
|
other.schedules == schedules &&
|
||||||
|
other.prices == prices &&
|
||||||
|
other.phone == phone &&
|
||||||
|
other.email == email &&
|
||||||
|
other.site == site;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode =>
|
int get hashCode =>
|
||||||
@ -61,10 +75,15 @@ class GeoPointDTO {
|
|||||||
(contents == null ? 0 : contents!.hashCode) +
|
(contents == null ? 0 : contents!.hashCode) +
|
||||||
(categorie == null ? 0 : categorie!.hashCode) +
|
(categorie == null ? 0 : categorie!.hashCode) +
|
||||||
(latitude == null ? 0 : latitude!.hashCode) +
|
(latitude == null ? 0 : latitude!.hashCode) +
|
||||||
(longitude == null ? 0 : longitude!.hashCode);
|
(longitude == null ? 0 : longitude!.hashCode) +
|
||||||
|
(schedules == null ? 0 : schedules!.hashCode) +
|
||||||
|
(prices == null ? 0 : prices!.hashCode) +
|
||||||
|
(phone == null ? 0 : phone!.hashCode) +
|
||||||
|
(email == null ? 0 : email!.hashCode) +
|
||||||
|
(site == null ? 0 : site!.hashCode);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() => 'GeoPointDTO[id=$id, title=$title, description=$description, contents=$contents, categorie=$categorie, latitude=$latitude, longitude=$longitude]';
|
String toString() => 'GeoPointDTO[id=$id, title=$title, description=$description, contents=$contents, categorie=$categorie, latitude=$latitude, longitude=$longitude, schedules=$schedules, prices=$prices, phone=$phone, email=$email, site=$site]';
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final json = <String, dynamic>{};
|
final json = <String, dynamic>{};
|
||||||
@ -103,6 +122,31 @@ class GeoPointDTO {
|
|||||||
} else {
|
} else {
|
||||||
json[r'longitude'] = null;
|
json[r'longitude'] = null;
|
||||||
}
|
}
|
||||||
|
if (this.schedules != null) {
|
||||||
|
json[r'schedules'] = this.schedules;
|
||||||
|
} else {
|
||||||
|
json[r'schedules'] = null;
|
||||||
|
}
|
||||||
|
if (this.prices != null) {
|
||||||
|
json[r'prices'] = this.prices;
|
||||||
|
} else {
|
||||||
|
json[r'prices'] = null;
|
||||||
|
}
|
||||||
|
if (this.phone != null) {
|
||||||
|
json[r'phone'] = this.phone;
|
||||||
|
} else {
|
||||||
|
json[r'phone'] = null;
|
||||||
|
}
|
||||||
|
if (this.email != null) {
|
||||||
|
json[r'email'] = this.email;
|
||||||
|
} else {
|
||||||
|
json[r'email'] = null;
|
||||||
|
}
|
||||||
|
if (this.site != null) {
|
||||||
|
json[r'site'] = this.site;
|
||||||
|
} else {
|
||||||
|
json[r'site'] = null;
|
||||||
|
}
|
||||||
return json;
|
return json;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,6 +176,11 @@ class GeoPointDTO {
|
|||||||
categorie: CategorieDTO.fromJson(json[r'categorie']),
|
categorie: CategorieDTO.fromJson(json[r'categorie']),
|
||||||
latitude: mapValueOfType<String>(json, r'latitude'),
|
latitude: mapValueOfType<String>(json, r'latitude'),
|
||||||
longitude: mapValueOfType<String>(json, r'longitude'),
|
longitude: mapValueOfType<String>(json, r'longitude'),
|
||||||
|
schedules: TranslationDTO.listFromJson(json[r'schedules']),
|
||||||
|
prices: TranslationDTO.listFromJson(json[r'prices']),
|
||||||
|
phone: TranslationDTO.listFromJson(json[r'phone']),
|
||||||
|
email: TranslationDTO.listFromJson(json[r'email']),
|
||||||
|
site: TranslationDTO.listFromJson(json[r'site']),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@ -33,6 +33,7 @@ class SectionType {
|
|||||||
static const Pdf = SectionType._(7);
|
static const Pdf = SectionType._(7);
|
||||||
static const Puzzle = SectionType._(8);
|
static const Puzzle = SectionType._(8);
|
||||||
static const Agenda = SectionType._(9);
|
static const Agenda = SectionType._(9);
|
||||||
|
static const Weather = SectionType._(10);
|
||||||
|
|
||||||
/// List of all possible values in this [enum][SectionType].
|
/// List of all possible values in this [enum][SectionType].
|
||||||
static const values = <SectionType>[
|
static const values = <SectionType>[
|
||||||
@ -45,7 +46,8 @@ class SectionType {
|
|||||||
Article,
|
Article,
|
||||||
Pdf,
|
Pdf,
|
||||||
Puzzle,
|
Puzzle,
|
||||||
Agenda
|
Agenda,
|
||||||
|
Weather
|
||||||
];
|
];
|
||||||
|
|
||||||
static SectionType? fromJson(dynamic value) => SectionTypeTypeTransformer().decode(value);
|
static SectionType? fromJson(dynamic value) => SectionTypeTypeTransformer().decode(value);
|
||||||
@ -95,6 +97,7 @@ class SectionTypeTypeTransformer {
|
|||||||
case r'PDF': return SectionType.Pdf;
|
case r'PDF': return SectionType.Pdf;
|
||||||
case r'Puzzle': return SectionType.Puzzle;
|
case r'Puzzle': return SectionType.Puzzle;
|
||||||
case r'Agenda': return SectionType.Agenda;
|
case r'Agenda': return SectionType.Agenda;
|
||||||
|
case r'Weather': return SectionType.Weather;
|
||||||
default:
|
default:
|
||||||
if (!allowNull) {
|
if (!allowNull) {
|
||||||
throw ArgumentError('Unknown enum value to decode: $data');
|
throw ArgumentError('Unknown enum value to decode: $data');
|
||||||
@ -113,6 +116,7 @@ class SectionTypeTypeTransformer {
|
|||||||
case 7: return SectionType.Pdf;
|
case 7: return SectionType.Pdf;
|
||||||
case 8: return SectionType.Puzzle;
|
case 8: return SectionType.Puzzle;
|
||||||
case 9: return SectionType.Agenda;
|
case 9: return SectionType.Agenda;
|
||||||
|
case 10: return SectionType.Weather;
|
||||||
default:
|
default:
|
||||||
if (!allowNull) {
|
if (!allowNull) {
|
||||||
throw ArgumentError('Unknown enum value to decode: $data');
|
throw ArgumentError('Unknown enum value to decode: $data');
|
||||||
|
|||||||
134
manager_api_new/lib/model/weather_dto.dart
Normal file
134
manager_api_new/lib/model/weather_dto.dart
Normal file
@ -0,0 +1,134 @@
|
|||||||
|
//
|
||||||
|
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||||
|
//
|
||||||
|
// @dart=2.12
|
||||||
|
|
||||||
|
// ignore_for_file: unused_element, unused_import
|
||||||
|
// ignore_for_file: always_put_required_named_parameters_first
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: lines_longer_than_80_chars
|
||||||
|
|
||||||
|
part of openapi.api;
|
||||||
|
|
||||||
|
class WeatherDTO {
|
||||||
|
/// Returns a new [WeatherDTO] instance.
|
||||||
|
WeatherDTO({
|
||||||
|
this.city,
|
||||||
|
this.updatedDate,
|
||||||
|
this.result,
|
||||||
|
});
|
||||||
|
|
||||||
|
String? city;
|
||||||
|
|
||||||
|
DateTime? updatedDate;
|
||||||
|
|
||||||
|
String? result;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) => identical(this, other) || other is WeatherDTO &&
|
||||||
|
other.city == city &&
|
||||||
|
other.updatedDate == updatedDate &&
|
||||||
|
other.result == result;
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode =>
|
||||||
|
// ignore: unnecessary_parenthesis
|
||||||
|
(city == null ? 0 : city!.hashCode) +
|
||||||
|
(updatedDate == null ? 0 : updatedDate!.hashCode) +
|
||||||
|
(result == null ? 0 : result!.hashCode);
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => 'WeatherDTO[city=$city, updatedDate=$updatedDate, result=$result]';
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final json = <String, dynamic>{};
|
||||||
|
if (this.city != null) {
|
||||||
|
json[r'city'] = this.city;
|
||||||
|
} else {
|
||||||
|
json[r'city'] = null;
|
||||||
|
}
|
||||||
|
if (this.updatedDate != null) {
|
||||||
|
json[r'updatedDate'] = this.updatedDate!.toUtc().toIso8601String();
|
||||||
|
} else {
|
||||||
|
json[r'updatedDate'] = null;
|
||||||
|
}
|
||||||
|
if (this.result != null) {
|
||||||
|
json[r'result'] = this.result;
|
||||||
|
} else {
|
||||||
|
json[r'result'] = null;
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns a new [WeatherDTO] instance and imports its values from
|
||||||
|
/// [value] if it's a [Map], null otherwise.
|
||||||
|
// ignore: prefer_constructors_over_static_methods
|
||||||
|
static WeatherDTO? fromJson(dynamic value) {
|
||||||
|
if (value is Map) {
|
||||||
|
final json = value.cast<String, dynamic>();
|
||||||
|
|
||||||
|
// Ensure that the map contains the required keys.
|
||||||
|
// Note 1: the values aren't checked for validity beyond being non-null.
|
||||||
|
// Note 2: this code is stripped in release mode!
|
||||||
|
assert(() {
|
||||||
|
requiredKeys.forEach((key) {
|
||||||
|
assert(json.containsKey(key), 'Required key "WeatherDTO[$key]" is missing from JSON.');
|
||||||
|
assert(json[key] != null, 'Required key "WeatherDTO[$key]" has a null value in JSON.');
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}());
|
||||||
|
|
||||||
|
return WeatherDTO(
|
||||||
|
city: mapValueOfType<String>(json, r'city'),
|
||||||
|
updatedDate: mapDateTime(json, r'updatedDate', ''),
|
||||||
|
result: mapValueOfType<String>(json, r'result'),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
static List<WeatherDTO> listFromJson(dynamic json, {bool growable = false,}) {
|
||||||
|
final result = <WeatherDTO>[];
|
||||||
|
if (json is List && json.isNotEmpty) {
|
||||||
|
for (final row in json) {
|
||||||
|
final value = WeatherDTO.fromJson(row);
|
||||||
|
if (value != null) {
|
||||||
|
result.add(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.toList(growable: growable);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Map<String, WeatherDTO> mapFromJson(dynamic json) {
|
||||||
|
final map = <String, WeatherDTO>{};
|
||||||
|
if (json is Map && json.isNotEmpty) {
|
||||||
|
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||||
|
for (final entry in json.entries) {
|
||||||
|
final value = WeatherDTO.fromJson(entry.value);
|
||||||
|
if (value != null) {
|
||||||
|
map[entry.key] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
// maps a json object with a list of WeatherDTO-objects as value to a dart map
|
||||||
|
static Map<String, List<WeatherDTO>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||||
|
final map = <String, List<WeatherDTO>>{};
|
||||||
|
if (json is Map && json.isNotEmpty) {
|
||||||
|
// ignore: parameter_assignments
|
||||||
|
json = json.cast<String, dynamic>();
|
||||||
|
for (final entry in json.entries) {
|
||||||
|
map[entry.key] = WeatherDTO.listFromJson(entry.value, growable: growable,);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The list of required keys that must be present in a JSON.
|
||||||
|
static const requiredKeys = <String>{
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
37
manager_api_new/test/weather_dto_test.dart
Normal file
37
manager_api_new/test/weather_dto_test.dart
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
//
|
||||||
|
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||||
|
//
|
||||||
|
// @dart=2.12
|
||||||
|
|
||||||
|
// ignore_for_file: unused_element, unused_import
|
||||||
|
// ignore_for_file: always_put_required_named_parameters_first
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: lines_longer_than_80_chars
|
||||||
|
|
||||||
|
import 'package:manager_api_new/api.dart';
|
||||||
|
import 'package:test/test.dart';
|
||||||
|
|
||||||
|
// tests for WeatherDTO
|
||||||
|
void main() {
|
||||||
|
// final instance = WeatherDTO();
|
||||||
|
|
||||||
|
group('test WeatherDTO', () {
|
||||||
|
// String city
|
||||||
|
test('to test the property `city`', () async {
|
||||||
|
// TODO
|
||||||
|
});
|
||||||
|
|
||||||
|
// DateTime updatedDate
|
||||||
|
test('to test the property `updatedDate`', () async {
|
||||||
|
// TODO
|
||||||
|
});
|
||||||
|
|
||||||
|
// String result
|
||||||
|
test('to test the property `result`', () async {
|
||||||
|
// TODO
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||||
# Read more about iOS versioning at
|
# Read more about iOS versioning at
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
version: 2.0.1+5
|
version: 2.0.2+6
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=3.1.0 <4.0.0"
|
sdk: ">=3.1.0 <4.0.0"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user