Add Pdf, puzzle and agenda config + adpat other elements + update service generation

This commit is contained in:
Thomas Fransolet 2023-12-26 15:48:36 +01:00
parent 4b7dac07a8
commit 0c526fe53e
30 changed files with 517 additions and 120 deletions

View File

@ -5,25 +5,24 @@ IconData getSectionIcon(elementType) {
switch(elementType) {
case SectionType.Map:
return Icons.location_on;
break;
case SectionType.Slider:
return Icons.collections; // art_track
break;
case SectionType.Video:
return Icons.ondemand_video_rounded;
break;
case SectionType.Web:
return Icons.web;
break;
case SectionType.Menu:
return Icons.apps_sharp;
break;
case SectionType.Quizz:
return Icons.question_answer;
break;
case SectionType.Article:
return Icons.article_outlined;
break;
case SectionType.Pdf:
return Icons.picture_as_pdf_outlined;
case SectionType.Puzzle:
return Icons.extension;
case SectionType.Agenda:
return Icons.calendar_month_outlined;
}
return Icons.menu;
return Icons.question_mark;
}

View File

@ -35,7 +35,7 @@ class MultiSelectContainer extends StatelessWidget {
Padding(
padding: const EdgeInsets.all(10.0),
child: Container(
width: size.width *0.2,
width: size.width *0.25,
child: MultiSelectChip(
values,
initialValue,

View File

@ -67,7 +67,7 @@ class MultiStringInputContainer extends StatelessWidget {
newValues.add(TranslationDTO.fromJson(jsonDecode(jsonEncode(initials.firstWhere((element) => element.language == value)))!)!);
} else {
// New language
newValues.add(TranslationDTO(language: value, value: null));
newValues.add(TranslationDTO(language: value, value: ""));
}
});

View File

@ -101,8 +101,15 @@ class _ResourceInputContainerState extends State<ResourceInputContainer> {
builder: (context, AsyncSnapshot<dynamic> snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
if (snapshot.data != null) {
ResourceDTO resourceDTO = snapshot.data!;
return Container(
decoration: boxDecoration(snapshot.data, appContext),
child: Center(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(resourceDTO.type == ResourceType.Image || resourceDTO.type == ResourceType.ImageUrl ? "" : resourceDTO.label!),
),
)
);
} else {
return Center(
@ -110,7 +117,7 @@ class _ResourceInputContainerState extends State<ResourceInputContainer> {
decoration: boxDecoration(null, appContext),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text("Aucune image"),
child: Text("Aucune ressource"),
)
)
);
@ -158,7 +165,7 @@ class _ResourceInputContainerState extends State<ResourceInputContainer> {
shape: BoxShape.rectangle,
color: kWhite,
borderRadius: BorderRadius.circular(30.0),
image: resourceDTO != null ? resourceDTO.type != null ? new DecorationImage(
image: resourceDTO != null ? resourceDTO.type != null && (resourceDTO.type == ResourceType.Image || resourceDTO.type == ResourceType.ImageUrl)? new DecorationImage(
fit: widget.imageFit,
image: new NetworkImage(
resourceDTO.url!, // TODO handle multiple type of content

View File

@ -44,7 +44,7 @@ class StringInputContainer extends StatelessWidget {
),
),
Padding(
padding: const EdgeInsets.all(10.0),
padding: const EdgeInsets.all(8.0),
child: Container(
width: isUrl ? size.width *0.6 : isSmall ? size.width *0.1 : size.width *0.25,
child: RoundedInputField(

View File

@ -83,7 +83,7 @@ class _TranslationInputContainerState extends State<TranslationInputContainer> w
height: widget.isTitle ? MediaQuery.of(context).size.height *0.13 : MediaQuery.of(context).size.height *0.35,
child: QuillHtmlEditor(
text: newValues.where((element) => element.language! == currentLanguage.value).first.value!,
//hintText: 'Hint text goes here',
hintText: '',
controller: controllerQuill,
minHeight: widget.isTitle ? 80 : 240,
/*textStyle: _editorTextStyle,

View File

@ -0,0 +1,47 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:manager_app/Components/resource_input_container.dart';
import 'package:manager_api_new/api.dart';
import 'dart:convert';
class AgendaConfig extends StatefulWidget {
final String? color;
final String? label;
final String initialValue;
final ValueChanged<String> onChanged;
const AgendaConfig({
Key? key,
this.color,
this.label,
required this.initialValue,
required this.onChanged,
}) : super(key: key);
@override
_AgendaConfigState createState() => _AgendaConfigState();
}
class _AgendaConfigState extends State<AgendaConfig> {
late AgendaDTO agendaDTO;
@override
void initState() {
AgendaDTO test = AgendaDTO.fromJson(json.decode(widget.initialValue))!;
agendaDTO = test;
super.initState();
}
@override
Widget build(BuildContext context) {
return ResourceInputContainer(
label: "Fichier JSON :",
initialValue: agendaDTO.resourceId == null ? '': agendaDTO.resourceId,
inResourceTypes: [ResourceType.Json],
onChanged: (ResourceDTO resourceDTO) {
agendaDTO.resourceUrl = resourceDTO.url;
agendaDTO.resourceId = resourceDTO.id;
widget.onChanged(jsonEncode(agendaDTO).toString());
}
);
}
}

View File

@ -171,7 +171,7 @@ class _MapConfigState extends State<MapConfig> {
),
),
Positioned(
bottom: 10,
top: 10,
right: 10,
child: InkWell(
onTap: () {

View File

@ -47,19 +47,27 @@ void showNewOrUpdateGeoPoint(GeoPointDTO? inputGeoPointDTO, Function getResult,
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
StringInputContainer(
label: "Latitude (#.#):",
initialValue: geoPointDTO.latitude,
onChanged: (value) {
geoPointDTO.latitude = value;
},
SizedBox(
height: 100,
child: StringInputContainer(
isSmall: true,
label: "Latitude (#.#):",
initialValue: geoPointDTO.latitude,
onChanged: (value) {
geoPointDTO.latitude = value;
},
),
),
StringInputContainer(
label: "Longitude (#.#):",
initialValue: geoPointDTO.longitude,
onChanged: (value) {
geoPointDTO.longitude = value;
},
SizedBox(
height: 100,
child: StringInputContainer(
isSmall: true,
label: "Longitude (#.#):",
initialValue: geoPointDTO.longitude,
onChanged: (value) {
geoPointDTO.longitude = value;
},
),
)
],
),

View File

@ -38,8 +38,8 @@ class _ListViewCardSubSection extends State<ListViewCardSubSection> {
child: Stack(
children: [
Container(
width: 200,
height: 250,
width: 150,
height: 200,
decoration: BoxDecoration(
color: kWhite,
border: Border.all(width: 0.5, color: kSecond),
@ -51,7 +51,7 @@ class _ListViewCardSubSection extends State<ListViewCardSubSection> {
),
Positioned(
right: 0,
bottom: 0,
bottom: 15,
child: Row(
children: [
InkWell(
@ -70,11 +70,11 @@ class _ListViewCardSubSection extends State<ListViewCardSubSection> {
);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.all(6.0),
child: Icon(
Icons.edit,
color: kPrimaryColor,
size: 25.0,
size: 22.0,
),
)
),
@ -84,11 +84,11 @@ class _ListViewCardSubSection extends State<ListViewCardSubSection> {
widget.onChanged(widget.listItems);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.all(6.0),
child: Icon(
Icons.delete,
color: kError,
size: 25.0,
size: 22.0,
),
)
),

View File

@ -74,13 +74,14 @@ class _MenuConfigState extends State<MenuConfig> {
child: Stack(
children: [
Container(
height: size.height *0.25,
height: size.height *0.35,
constraints: BoxConstraints(maxHeight: 300, minHeight: 250),
child: Padding(
padding: const EdgeInsets.all(8.0),
child : ReorderableListView(
onReorder: _onReorder,
scrollDirection: Axis.horizontal,
padding: const EdgeInsets.symmetric(vertical: 20.0),
padding: const EdgeInsets.symmetric(vertical: 15.0),
children: List.generate(
menuDTO.sections!.length,
(index) {
@ -103,7 +104,7 @@ class _MenuConfigState extends State<MenuConfig> {
),
),
Positioned(
bottom: 0,
top: 0,
right: 0,
child: InkWell(
onTap: () {

View File

@ -36,12 +36,15 @@ void showEditSubSection(SectionDTO subSectionDTO, Function getResult, AppContext
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
StringInputContainer(
label: "Nom :",
initialValue: subSectionDTO.label,
onChanged: (String name) {
subSectionDTO.label = name;
},
SizedBox(
height: 100,
child: StringInputContainer(
label: "Nom :",
initialValue: subSectionDTO.label,
onChanged: (String name) {
subSectionDTO.label = name;
},
),
),
ResourceInputContainer(
label: "Image :",

View File

@ -0,0 +1,49 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:manager_app/Components/resource_input_container.dart';
import 'package:manager_api_new/api.dart';
import 'dart:convert';
class PDFConfig extends StatefulWidget {
final String? color;
final String? label;
final String initialValue;
final ValueChanged<String> onChanged;
const PDFConfig({
Key? key,
this.color,
this.label,
required this.initialValue,
required this.onChanged,
}) : super(key: key);
@override
_PDFConfigState createState() => _PDFConfigState();
}
class _PDFConfigState extends State<PDFConfig> {
late PdfDTO pdfDTO;
@override
void initState() {
PdfDTO test = PdfDTO.fromJson(json.decode(widget.initialValue))!;
pdfDTO = test;
super.initState();
}
@override
Widget build(BuildContext context) {
return Center(
child: ResourceInputContainer(
label: "Fichier PDF :",
inResourceTypes: [ResourceType.Pdf],
initialValue: pdfDTO.resourceId == null ? '': pdfDTO.resourceId,
onChanged: (ResourceDTO resourceDTO) {
pdfDTO.resourceUrl = resourceDTO.url;
pdfDTO.resourceId = resourceDTO.id;
widget.onChanged(jsonEncode(pdfDTO).toString());
}
),
);
}
}

View File

@ -0,0 +1,105 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:manager_app/Components/multi_string_input_container.dart';
import 'package:manager_app/Components/resource_input_container.dart';
import 'package:manager_api_new/api.dart';
import 'dart:convert';
import 'package:manager_app/constants.dart';
class PuzzleConfig extends StatefulWidget {
final String? color;
final String? label;
final String initialValue;
final ValueChanged<String> onChanged;
const PuzzleConfig({
Key? key,
this.color,
this.label,
required this.initialValue,
required this.onChanged,
}) : super(key: key);
@override
_PuzzleConfigState createState() => _PuzzleConfigState();
}
class _PuzzleConfigState extends State<PuzzleConfig> {
late PuzzleDTO puzzleDTO;
@override
void initState() {
PuzzleDTO test = PuzzleDTO.fromJson(json.decode(widget.initialValue))!;
if(test.image == null) {
test.image = PuzzleDTOImage();
}
puzzleDTO = test;
super.initState();
}
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
ResourceInputContainer(
label: "Image du puzzle :",
initialValue: puzzleDTO.image!.resourceId == null ? '': puzzleDTO.image!.resourceId,
onChanged: (ResourceDTO resourceDTO) {
setState(() {
puzzleDTO.image!.resourceId = resourceDTO.id;
puzzleDTO.image!.resourceType = resourceDTO.type;
puzzleDTO.image!.resourceUrl = resourceDTO.url;
print(puzzleDTO.image);
widget.onChanged(jsonEncode(puzzleDTO).toString());
});
}
),
Container(
height: 100,
child: MultiStringInputContainer(
label: "Message départ :",
modalLabel: "Message départ",
fontSize: 20,
isHTML: true,
color: kPrimaryColor,
initialValue: puzzleDTO.messageDebut != null ? puzzleDTO.messageDebut! : [],
onGetResult: (value) {
print("Mess depart test");
print(value);
if (puzzleDTO.messageDebut != value) {
setState(() {
puzzleDTO.messageDebut = value;
widget.onChanged(jsonEncode(puzzleDTO).toString());
});
}
},
maxLines: 1,
isTitle: true
)
),
Container(
height: 100,
child: MultiStringInputContainer(
label: "Message fin :",
modalLabel: "Message fin",
fontSize: 20,
isHTML: true,
color: kPrimaryColor,
initialValue: puzzleDTO.messageFin != null ? puzzleDTO.messageFin! : [],
onGetResult: (value) {
if (puzzleDTO.messageFin != value) {
setState(() {
puzzleDTO.messageFin = value;
widget.onChanged(jsonEncode(puzzleDTO).toString());
});
}
},
maxLines: 1,
isTitle: true
)
),
],
);
}
}

View File

@ -98,8 +98,8 @@ class _SliderConfigState extends State<SliderConfig> {
),
),
Positioned(
bottom: 0,
right: 0,
top: 10,
right: 10,
child: InkWell(
onTap: () async {
var result = await showNewOrUpdateContentSlider(null, appContext, context, true, true);

View File

@ -25,10 +25,13 @@ import 'package:manager_api_new/api.dart';
import 'package:provider/provider.dart';
import 'package:intl/intl.dart';
import 'SubSection/Agenda/agenda_config.dart';
import 'SubSection/Article/article_config.dart';
import 'SubSection/Article/download_pdf.dart';
import 'SubSection/Map/map_config.dart';
import 'SubSection/Menu/menu_config.dart';
import 'SubSection/PDF/PDF_config.dart';
import 'SubSection/Puzzle/puzzle_config.dart';
import 'SubSection/Quizz/quizz_config.dart';
import 'SubSection/Slider/slider_config.dart';
import 'package:qr_flutter/qr_flutter.dart';
@ -223,12 +226,15 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
StringInputContainer(
label: "Identifiant :",
initialValue: sectionDTO != null ? sectionDTO.label : "",
onChanged: (String value) {
sectionDTO!.label = value;
},
SizedBox(
height: 100,
child: StringInputContainer(
label: "Identifiant :",
initialValue: sectionDTO != null ? sectionDTO.label : "",
onChanged: (String value) {
sectionDTO!.label = value;
},
),
),
MultiStringInputContainer(
label: "Titre affiché:",
@ -426,8 +432,6 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
return MenuConfig(
initialValue: sectionDTO.data!,
onChanged: (String data) {
//print("Received info in parent");
//print(data);
sectionDTO.data = data;
},
);
@ -435,8 +439,6 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
return QuizzConfig(
initialValue: sectionDTO.data!,
onChanged: (String data) {
//print("Received info in parent - quizz");
//print(data);
sectionDTO.data = data;
},
);
@ -444,8 +446,29 @@ class _SectionDetailScreenState extends State<SectionDetailScreen> {
return ArticleConfig(
initialValue: sectionDTO.data!,
onChanged: (String data) {
//print("Received info in parent - article");
//print(data);
sectionDTO.data = data;
save(false, sectionDTO, appContext);
},
);
case SectionType.Pdf:
return PDFConfig(
initialValue: sectionDTO.data!,
onChanged: (String data) {
sectionDTO.data = data;
save(false, sectionDTO, appContext);
},
);
case SectionType.Puzzle:
return PuzzleConfig(
initialValue: sectionDTO.data!,
onChanged: (String data) {
sectionDTO.data = data;
},
);
case SectionType.Agenda:
return AgendaConfig(
initialValue: sectionDTO.data!,
onChanged: (String data) {
sectionDTO.data = data;
save(false, sectionDTO, appContext);
},

View File

@ -163,13 +163,17 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
mainAxisAlignment: MainAxisAlignment.spaceAround,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
StringInputContainer(
label: "Identifiant :",
fontSize: 20,
initialValue: configurationDTO.label,
onChanged: (value) {
configurationDTO.label = value;
},
SizedBox(
height: 100,
child: StringInputContainer(
label: "Identifiant :",
fontSize: 20,
fontSizeText: 20,
initialValue: configurationDTO.label,
onChanged: (value) {
configurationDTO.label = value;
},
),
),
MultiSelectDropdownContainer(
label: "Langues :",
@ -249,7 +253,25 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
press: () {
PDFHelper.downloadPDF(sections!);
},
)
),
CheckInputContainer(
icon: Icons.date_range,
label: "Date :",
fontSize: 20,
isChecked: configurationDTO.isDate,
onChanged: (value) {
configurationDTO.isDate = value;
},
),
CheckInputContainer(
icon: Icons.watch_later_outlined,
label: "Heure :",
fontSize: 20,
isChecked: configurationDTO.isHour,
onChanged: (value) {
configurationDTO.isHour = value;
},
),
],
),
Column(
@ -299,13 +321,16 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
}
},
),
StringInputContainer(
label: "Ville météo :",
fontSize: 20,
initialValue: configurationDTO.weatherCity,
onChanged: (value) {
configurationDTO.weatherCity = value;
},
SizedBox(
height: 100,
child: StringInputContainer(
label: "Ville météo :",
fontSize: 20,
initialValue: configurationDTO.weatherCity,
onChanged: (value) {
configurationDTO.weatherCity = value;
},
),
),
])
],

View File

@ -30,12 +30,15 @@ void showNewConfiguration(AppContext appContext, ValueChanged<bool> isImport, Bu
children: [
Center(child: Text("Nouvelle configuration", style: new TextStyle(fontSize: 25, fontWeight: FontWeight.w400))),
Center(
child: StringInputContainer(
label: "Nom :",
initialValue: configurationDTO.label,
onChanged: (value) {
configurationDTO.label = value;
},
child: SizedBox(
height: 100,
child: StringInputContainer(
label: "Nom :",
initialValue: configurationDTO.label,
onChanged: (value) {
configurationDTO.label = value;
},
),
),
),
Text("ou"),

View File

@ -24,33 +24,39 @@ void showNewSection(String configurationId, AppContext appContext, BuildContext
),
content: SingleChildScrollView(
child: SizedBox(
width: size.width*0.3,
height: size.height*0.3,
child: Column(
children: [
Text(isSubSection? "Nouvelle sous section": "Nouvelle section", style: new TextStyle(fontSize: 25, fontWeight: FontWeight.w400)),
Column(
children: [
StringInputContainer(
label: "Nom :",
initialValue: sectionDTO.label,
onChanged: (value) {
sectionDTO.label = value;
},
),
MultiSelectContainer(
label: "Type:",
initialValue: isMobile ? ["Article"] : ["Map"],
isMultiple: false,
values: isMobile ? section_types.where((sectionType) => sectionType == "Article" || sectionType == "Quizz").toList(): isSubSection ? section_types.where((sectionType) => sectionType != "Menu" && sectionType != "Article").toList(): section_types.where((sectionType) => sectionType != "Article").toList(), // Todo get menu by enum type
onChanged: (value) {
var tempOutput = new List<String>.from(value);
sectionDTO.type = SectionType.fromJson(tempOutput[0]);
},
),
],
),
],
width: size.width*0.4,
height: size.height*0.4,
child: Container(
constraints: BoxConstraints(minHeight: 300, minWidth: 300),
child: Column(
children: [
Text(isSubSection? "Nouvelle sous section": "Nouvelle section", style: new TextStyle(fontSize: 25, fontWeight: FontWeight.w400)),
Column(
children: [
SizedBox(
height: 100,
child: StringInputContainer(
label: "Nom :",
initialValue: sectionDTO.label,
onChanged: (value) {
sectionDTO.label = value;
},
),
),
MultiSelectContainer(
label: "Type:",
initialValue: isMobile ? ["Article"] : ["Map"],
isMultiple: false,
values: isMobile ? section_types.where((sectionType) => sectionType == "Article" || sectionType == "Quizz").toList(): isSubSection ? section_types.where((sectionType) => sectionType != "Menu" && sectionType != "Article").toList(): section_types.where((sectionType) => sectionType != "Article").toList(), // Todo get menu by enum type
onChanged: (value) {
var tempOutput = new List<String>.from(value);
sectionDTO.type = SectionType.fromJson(tempOutput[0]);
},
),
],
),
],
),
),
),
),

View File

@ -124,6 +124,7 @@ class _SectionReorderListState extends State<SectionReorderList> {
left: 10,
child: Container(
height: size.height*0.1,
constraints: BoxConstraints(minHeight: 85),
child: StringInputContainer(
label: "Recherche:",
isSmall: true,
@ -139,7 +140,7 @@ class _SectionReorderListState extends State<SectionReorderList> {
),
),
Positioned(
bottom: 10,
top: 10,
right: 10,
child: InkWell(
onTap: () {

View File

@ -169,7 +169,7 @@ class _ResourceBodyGridState extends State<ResourceBodyGrid> {
child: Icon(
getResourceIcon(resource.type),
color: kPrimaryColor,
size: 25,
size: 15,
),
),
],
@ -178,7 +178,7 @@ class _ResourceBodyGridState extends State<ResourceBodyGrid> {
return Icon(
Icons.close,
color: kTextLightColor,
size: 80.0,
size: 50.0,
);
}
}

View File

@ -1814,6 +1814,10 @@ components:
weatherCity:
type: string
nullable: true
isDate:
type: boolean
isHour:
type: boolean
TranslationDTO:
type: object
additionalProperties: false
@ -2303,6 +2307,14 @@ components:
$ref: '#/components/schemas/TranslationDTO'
isGood:
type: boolean
resourceId:
type: string
nullable: true
resourceType:
$ref: '#/components/schemas/ResourceType'
resourceUrl:
type: string
nullable: true
order:
type: integer
format: int32

View File

@ -25,6 +25,8 @@ Name | Type | Description | Notes
**loaderImageId** | **String** | | [optional]
**loaderImageUrl** | **String** | | [optional]
**weatherCity** | **String** | | [optional]
**isDate** | **bool** | | [optional]
**isHour** | **bool** | | [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)

View File

@ -25,6 +25,8 @@ Name | Type | Description | Notes
**loaderImageId** | **String** | | [optional]
**loaderImageUrl** | **String** | | [optional]
**weatherCity** | **String** | | [optional]
**isDate** | **bool** | | [optional]
**isHour** | **bool** | | [optional]
**sections** | [**List<SectionDTO>**](SectionDTO.md) | | [optional] [default to const []]
**resources** | [**List<ResourceDTO>**](ResourceDTO.md) | | [optional] [default to const []]

View File

@ -10,6 +10,9 @@ Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**label** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
**isGood** | **bool** | | [optional]
**resourceId** | **String** | | [optional]
**resourceType** | [**ResourceType**](ResourceType.md) | | [optional]
**resourceUrl** | **String** | | [optional]
**order** | **int** | | [optional]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -30,6 +30,8 @@ class ConfigurationDTO {
this.loaderImageId,
this.loaderImageUrl,
this.weatherCity,
this.isDate,
this.isHour,
});
String? id;
@ -90,6 +92,22 @@ class ConfigurationDTO {
String? weatherCity;
///
/// 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? isDate;
///
/// 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? isHour;
@override
bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO &&
other.id == id &&
@ -108,7 +126,9 @@ class ConfigurationDTO {
other.sectionIds == sectionIds &&
other.loaderImageId == loaderImageId &&
other.loaderImageUrl == loaderImageUrl &&
other.weatherCity == weatherCity;
other.weatherCity == weatherCity &&
other.isDate == isDate &&
other.isHour == isHour;
@override
int get hashCode =>
@ -129,10 +149,12 @@ class ConfigurationDTO {
(sectionIds == null ? 0 : sectionIds!.hashCode) +
(loaderImageId == null ? 0 : loaderImageId!.hashCode) +
(loaderImageUrl == null ? 0 : loaderImageUrl!.hashCode) +
(weatherCity == null ? 0 : weatherCity!.hashCode);
(weatherCity == null ? 0 : weatherCity!.hashCode) +
(isDate == null ? 0 : isDate!.hashCode) +
(isHour == null ? 0 : isHour!.hashCode);
@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]';
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, isDate=$isDate, isHour=$isHour]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@ -221,6 +243,16 @@ class ConfigurationDTO {
} else {
json[r'weatherCity'] = null;
}
if (this.isDate != null) {
json[r'isDate'] = this.isDate;
} else {
json[r'isDate'] = null;
}
if (this.isHour != null) {
json[r'isHour'] = this.isHour;
} else {
json[r'isHour'] = null;
}
return json;
}
@ -264,6 +296,8 @@ class ConfigurationDTO {
loaderImageId: mapValueOfType<String>(json, r'loaderImageId'),
loaderImageUrl: mapValueOfType<String>(json, r'loaderImageUrl'),
weatherCity: mapValueOfType<String>(json, r'weatherCity'),
isDate: mapValueOfType<bool>(json, r'isDate'),
isHour: mapValueOfType<bool>(json, r'isHour'),
);
}
return null;

View File

@ -30,6 +30,8 @@ class ExportConfigurationDTO {
this.loaderImageId,
this.loaderImageUrl,
this.weatherCity,
this.isDate,
this.isHour,
this.sections = const [],
this.resources = const [],
});
@ -92,6 +94,22 @@ class ExportConfigurationDTO {
String? weatherCity;
///
/// 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? isDate;
///
/// 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? isHour;
List<SectionDTO>? sections;
List<ResourceDTO>? resources;
@ -115,6 +133,8 @@ class ExportConfigurationDTO {
other.loaderImageId == loaderImageId &&
other.loaderImageUrl == loaderImageUrl &&
other.weatherCity == weatherCity &&
other.isDate == isDate &&
other.isHour == isHour &&
other.sections == sections &&
other.resources == resources;
@ -138,11 +158,13 @@ class ExportConfigurationDTO {
(loaderImageId == null ? 0 : loaderImageId!.hashCode) +
(loaderImageUrl == null ? 0 : loaderImageUrl!.hashCode) +
(weatherCity == null ? 0 : weatherCity!.hashCode) +
(isDate == null ? 0 : isDate!.hashCode) +
(isHour == null ? 0 : isHour!.hashCode) +
(sections == null ? 0 : sections!.hashCode) +
(resources == null ? 0 : resources!.hashCode);
@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, 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, isDate=$isDate, isHour=$isHour, sections=$sections, resources=$resources]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@ -231,6 +253,16 @@ class ExportConfigurationDTO {
} else {
json[r'weatherCity'] = null;
}
if (this.isDate != null) {
json[r'isDate'] = this.isDate;
} else {
json[r'isDate'] = null;
}
if (this.isHour != null) {
json[r'isHour'] = this.isHour;
} else {
json[r'isHour'] = null;
}
if (this.sections != null) {
json[r'sections'] = this.sections;
} else {
@ -284,6 +316,8 @@ class ExportConfigurationDTO {
loaderImageId: mapValueOfType<String>(json, r'loaderImageId'),
loaderImageUrl: mapValueOfType<String>(json, r'loaderImageUrl'),
weatherCity: mapValueOfType<String>(json, r'weatherCity'),
isDate: mapValueOfType<bool>(json, r'isDate'),
isHour: mapValueOfType<bool>(json, r'isHour'),
sections: SectionDTO.listFromJson(json[r'sections']),
resources: ResourceDTO.listFromJson(json[r'resources']),
);

View File

@ -10,7 +10,7 @@
part of openapi.api;
/// 0 = Image 1 = Video 2 = ImageUrl 3 = VideoUrl
/// 0 = Image 1 = Video 2 = ImageUrl 3 = VideoUrl 4 = Audio 5 = PDF 6 = JSON
class ResourceType {
/// Instantiate a new enum with the provided [value].
const ResourceType._(this.value);

View File

@ -15,6 +15,9 @@ class ResponseDTO {
ResponseDTO({
this.label = const [],
this.isGood,
this.resourceId,
this.resourceType,
this.resourceUrl,
this.order,
});
@ -28,6 +31,18 @@ class ResponseDTO {
///
bool? isGood;
String? resourceId;
///
/// 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.
///
ResourceType? resourceType;
String? resourceUrl;
///
/// 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
@ -40,6 +55,9 @@ class ResponseDTO {
bool operator ==(Object other) => identical(this, other) || other is ResponseDTO &&
other.label == label &&
other.isGood == isGood &&
other.resourceId == resourceId &&
other.resourceType == resourceType &&
other.resourceUrl == resourceUrl &&
other.order == order;
@override
@ -47,10 +65,13 @@ class ResponseDTO {
// ignore: unnecessary_parenthesis
(label == null ? 0 : label!.hashCode) +
(isGood == null ? 0 : isGood!.hashCode) +
(resourceId == null ? 0 : resourceId!.hashCode) +
(resourceType == null ? 0 : resourceType!.hashCode) +
(resourceUrl == null ? 0 : resourceUrl!.hashCode) +
(order == null ? 0 : order!.hashCode);
@override
String toString() => 'ResponseDTO[label=$label, isGood=$isGood, order=$order]';
String toString() => 'ResponseDTO[label=$label, isGood=$isGood, resourceId=$resourceId, resourceType=$resourceType, resourceUrl=$resourceUrl, order=$order]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@ -64,6 +85,21 @@ class ResponseDTO {
} else {
json[r'isGood'] = null;
}
if (this.resourceId != null) {
json[r'resourceId'] = this.resourceId;
} else {
json[r'resourceId'] = null;
}
if (this.resourceType != null) {
json[r'resourceType'] = this.resourceType;
} else {
json[r'resourceType'] = null;
}
if (this.resourceUrl != null) {
json[r'resourceUrl'] = this.resourceUrl;
} else {
json[r'resourceUrl'] = null;
}
if (this.order != null) {
json[r'order'] = this.order;
} else {
@ -93,6 +129,9 @@ class ResponseDTO {
return ResponseDTO(
label: TranslationDTO.listFromJson(json[r'label']),
isGood: mapValueOfType<bool>(json, r'isGood'),
resourceId: mapValueOfType<String>(json, r'resourceId'),
resourceType: ResourceType.fromJson(json[r'resourceType']),
resourceUrl: mapValueOfType<String>(json, r'resourceUrl'),
order: mapValueOfType<int>(json, r'order'),
);
}

View File

@ -76,12 +76,6 @@ class SectionDTO {
///
DateTime? dateCreation;
///
/// 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? order;
String? instanceId;