Added JsonUrl (to test)
This commit is contained in:
parent
0f325605e5
commit
09c8cc7cfd
@ -17,6 +17,8 @@ IconData getResourceIcon(elementType) {
|
|||||||
return Icons.picture_as_pdf_outlined;
|
return Icons.picture_as_pdf_outlined;
|
||||||
case ResourceType.Json:
|
case ResourceType.Json:
|
||||||
return Icons.file_present_outlined;
|
return Icons.file_present_outlined;
|
||||||
|
case ResourceType.JsonUrl:
|
||||||
|
return Icons.file_present_rounded;
|
||||||
}
|
}
|
||||||
return Icons.announcement;
|
return Icons.announcement;
|
||||||
}
|
}
|
||||||
@ -105,12 +105,12 @@ class _UploadOnlineResourceContainerState extends State<UploadOnlineResourceCont
|
|||||||
child: Container(
|
child: Container(
|
||||||
width: size.width *0.35, // TODO GET SIZE
|
width: size.width *0.35, // TODO GET SIZE
|
||||||
child: RoundedInputField(
|
child: RoundedInputField(
|
||||||
hintText: "Url de l'image ou de la vidéo youtube",
|
hintText: "Url de l'image, de la vidéo youtube ou du fichier json",
|
||||||
//icon: widget.resourceDTO.type == ResourceType.ImageUrl ? Icons.image : Icons.ondemand_video, // TODO: TBD
|
//icon: widget.resourceDTO.type == ResourceType.ImageUrl ? Icons.image : Icons.ondemand_video, // TODO: TBD
|
||||||
onChanged: (String text) {
|
onChanged: (String text) {
|
||||||
widget.resourceDTO.url = text; // TODO check if ok
|
widget.resourceDTO.url = text; // TODO check if ok
|
||||||
widget.onChanged(widget.resourceDTO);
|
widget.onChanged(widget.resourceDTO);
|
||||||
widget.resourceDTO.type = _isYouTubeVideo(widget.resourceDTO.url!) ? ResourceType.VideoUrl : ResourceType.ImageUrl; // ou VideoUrl
|
widget.resourceDTO.type = _isYouTubeVideo(widget.resourceDTO.url!) ? ResourceType.VideoUrl : widget.resourceDTO.url!.endsWith("json") || widget.resourceDTO.url!.endsWith("php") ? ResourceType.JsonUrl : ResourceType.ImageUrl; // ou VideoUrl
|
||||||
print("URL OR NOOOOT ?");
|
print("URL OR NOOOOT ?");
|
||||||
print(widget.resourceDTO.type);
|
print(widget.resourceDTO.type);
|
||||||
},
|
},
|
||||||
|
|||||||
@ -36,7 +36,7 @@ class _AgendaConfigState extends State<AgendaConfig> {
|
|||||||
return ResourceInputContainer(
|
return ResourceInputContainer(
|
||||||
label: "Fichier JSON :",
|
label: "Fichier JSON :",
|
||||||
initialValue: agendaDTO.resourceId == null ? '': agendaDTO.resourceId,
|
initialValue: agendaDTO.resourceId == null ? '': agendaDTO.resourceId,
|
||||||
inResourceTypes: [ResourceType.Json],
|
inResourceTypes: [ResourceType.Json, ResourceType.JsonUrl],
|
||||||
onChanged: (ResourceDTO resourceDTO) {
|
onChanged: (ResourceDTO resourceDTO) {
|
||||||
agendaDTO.resourceUrl = resourceDTO.url;
|
agendaDTO.resourceUrl = resourceDTO.url;
|
||||||
agendaDTO.resourceId = resourceDTO.id;
|
agendaDTO.resourceId = resourceDTO.id;
|
||||||
|
|||||||
@ -221,7 +221,8 @@ class _BodyState extends State<Body> {
|
|||||||
ResourceType.Video,
|
ResourceType.Video,
|
||||||
ResourceType.VideoUrl,
|
ResourceType.VideoUrl,
|
||||||
ResourceType.Pdf,
|
ResourceType.Pdf,
|
||||||
ResourceType.Json
|
ResourceType.Json,
|
||||||
|
ResourceType.JsonUrl
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -101,6 +101,9 @@ getElementForResource(dynamic resourceDTO, AppContext appContext) {
|
|||||||
|
|
||||||
case ResourceType.Json:
|
case ResourceType.Json:
|
||||||
return Text("Fichier json - aucune visualisation possible");
|
return Text("Fichier json - aucune visualisation possible");
|
||||||
|
|
||||||
|
case ResourceType.JsonUrl:
|
||||||
|
return SelectableText(resourceDTO.url!);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -9,6 +9,18 @@ import 'package:openapi_generator_annotations/openapi_generator_annotations.dart
|
|||||||
outputDirectory: 'manager_api_new')
|
outputDirectory: 'manager_api_new')
|
||||||
class Example extends OpenapiGeneratorConfig {}
|
class Example extends OpenapiGeneratorConfig {}
|
||||||
|
|
||||||
|
|
||||||
|
/*@Openapi(
|
||||||
|
additionalProperties:
|
||||||
|
DioProperties(pubName: 'manager_api_new', pubAuthor: 'Fransolet Thomas'),
|
||||||
|
inputSpec:
|
||||||
|
InputSpec(path: 'lib/api/swagger.yaml'),
|
||||||
|
generatorName: Generator.dart,
|
||||||
|
runSourceGenOnOutput: true,
|
||||||
|
outputDirectory: 'manager_api_new',
|
||||||
|
)
|
||||||
|
class Example {}*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
RUN
|
RUN
|
||||||
>flutter pub run build_runner build --delete-conflicting-outputs
|
>flutter pub run build_runner build --delete-conflicting-outputs
|
||||||
|
|||||||
@ -1814,6 +1814,15 @@ components:
|
|||||||
weatherCity:
|
weatherCity:
|
||||||
type: string
|
type: string
|
||||||
nullable: true
|
nullable: true
|
||||||
|
weatherUpdatedDate:
|
||||||
|
type: string
|
||||||
|
format: date-time
|
||||||
|
nullable: true
|
||||||
|
weatherResult:
|
||||||
|
type: string
|
||||||
|
nullable: true
|
||||||
|
isWeather:
|
||||||
|
type: boolean
|
||||||
isDate:
|
isDate:
|
||||||
type: boolean
|
type: boolean
|
||||||
isHour:
|
isHour:
|
||||||
@ -1975,6 +1984,7 @@ components:
|
|||||||
4 = Audio
|
4 = Audio
|
||||||
5 = PDF
|
5 = PDF
|
||||||
6 = JSON
|
6 = JSON
|
||||||
|
7 = JSONUrl
|
||||||
x-enumNames:
|
x-enumNames:
|
||||||
- Image
|
- Image
|
||||||
- Video
|
- Video
|
||||||
@ -1983,6 +1993,7 @@ components:
|
|||||||
- Audio
|
- Audio
|
||||||
- PDF
|
- PDF
|
||||||
- JSON
|
- JSON
|
||||||
|
- JSONUrl
|
||||||
enum:
|
enum:
|
||||||
- 0
|
- 0
|
||||||
- 1
|
- 1
|
||||||
@ -1991,6 +2002,7 @@ components:
|
|||||||
- 4
|
- 4
|
||||||
- 5
|
- 5
|
||||||
- 6
|
- 6
|
||||||
|
- 7
|
||||||
DeviceDTO:
|
DeviceDTO:
|
||||||
type: object
|
type: object
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
@ -2322,7 +2334,9 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
nullable: true
|
nullable: true
|
||||||
resourceType:
|
resourceType:
|
||||||
$ref: '#/components/schemas/ResourceType'
|
nullable: true
|
||||||
|
oneOf:
|
||||||
|
- $ref: '#/components/schemas/ResourceType'
|
||||||
resourceUrl:
|
resourceUrl:
|
||||||
type: string
|
type: string
|
||||||
nullable: true
|
nullable: true
|
||||||
|
|||||||
@ -26,7 +26,8 @@ List<ResourceTypeModel> resource_types = [
|
|||||||
ResourceTypeModel(label: "Vidéo url", type: ResourceType.VideoUrl),
|
ResourceTypeModel(label: "Vidéo url", type: ResourceType.VideoUrl),
|
||||||
ResourceTypeModel(label: "Audio", type: ResourceType.Audio),
|
ResourceTypeModel(label: "Audio", type: ResourceType.Audio),
|
||||||
ResourceTypeModel(label: "PDF", type: ResourceType.Pdf),
|
ResourceTypeModel(label: "PDF", type: ResourceType.Pdf),
|
||||||
ResourceTypeModel(label: "JSON", type: ResourceType.Json)
|
ResourceTypeModel(label: "JSON", type: ResourceType.Json),
|
||||||
|
ResourceTypeModel(label: "JSON url", type: ResourceType.JsonUrl)
|
||||||
]; // "video url" , "video", {"label": "image"}, "image url", "audio"
|
]; // "video url" , "video", {"label": "image"}, "image url", "audio"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -25,6 +25,9 @@ Name | Type | Description | Notes
|
|||||||
**loaderImageId** | **String** | | [optional]
|
**loaderImageId** | **String** | | [optional]
|
||||||
**loaderImageUrl** | **String** | | [optional]
|
**loaderImageUrl** | **String** | | [optional]
|
||||||
**weatherCity** | **String** | | [optional]
|
**weatherCity** | **String** | | [optional]
|
||||||
|
**weatherUpdatedDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
**weatherResult** | **String** | | [optional]
|
||||||
|
**isWeather** | **bool** | | [optional]
|
||||||
**isDate** | **bool** | | [optional]
|
**isDate** | **bool** | | [optional]
|
||||||
**isHour** | **bool** | | [optional]
|
**isHour** | **bool** | | [optional]
|
||||||
|
|
||||||
|
|||||||
@ -25,6 +25,9 @@ Name | Type | Description | Notes
|
|||||||
**loaderImageId** | **String** | | [optional]
|
**loaderImageId** | **String** | | [optional]
|
||||||
**loaderImageUrl** | **String** | | [optional]
|
**loaderImageUrl** | **String** | | [optional]
|
||||||
**weatherCity** | **String** | | [optional]
|
**weatherCity** | **String** | | [optional]
|
||||||
|
**weatherUpdatedDate** | [**DateTime**](DateTime.md) | | [optional]
|
||||||
|
**weatherResult** | **String** | | [optional]
|
||||||
|
**isWeather** | **bool** | | [optional]
|
||||||
**isDate** | **bool** | | [optional]
|
**isDate** | **bool** | | [optional]
|
||||||
**isHour** | **bool** | | [optional]
|
**isHour** | **bool** | | [optional]
|
||||||
**sections** | [**List<SectionDTO>**](SectionDTO.md) | | [optional] [default to const []]
|
**sections** | [**List<SectionDTO>**](SectionDTO.md) | | [optional] [default to const []]
|
||||||
|
|||||||
@ -30,6 +30,9 @@ class ConfigurationDTO {
|
|||||||
this.loaderImageId,
|
this.loaderImageId,
|
||||||
this.loaderImageUrl,
|
this.loaderImageUrl,
|
||||||
this.weatherCity,
|
this.weatherCity,
|
||||||
|
this.weatherUpdatedDate,
|
||||||
|
this.weatherResult,
|
||||||
|
this.isWeather,
|
||||||
this.isDate,
|
this.isDate,
|
||||||
this.isHour,
|
this.isHour,
|
||||||
});
|
});
|
||||||
@ -92,6 +95,18 @@ class ConfigurationDTO {
|
|||||||
|
|
||||||
String? weatherCity;
|
String? weatherCity;
|
||||||
|
|
||||||
|
DateTime? weatherUpdatedDate;
|
||||||
|
|
||||||
|
String? weatherResult;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// 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? isWeather;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Please note: This property should have been non-nullable! Since the specification file
|
/// 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
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
@ -127,6 +142,9 @@ class ConfigurationDTO {
|
|||||||
other.loaderImageId == loaderImageId &&
|
other.loaderImageId == loaderImageId &&
|
||||||
other.loaderImageUrl == loaderImageUrl &&
|
other.loaderImageUrl == loaderImageUrl &&
|
||||||
other.weatherCity == weatherCity &&
|
other.weatherCity == weatherCity &&
|
||||||
|
other.weatherUpdatedDate == weatherUpdatedDate &&
|
||||||
|
other.weatherResult == weatherResult &&
|
||||||
|
other.isWeather == isWeather &&
|
||||||
other.isDate == isDate &&
|
other.isDate == isDate &&
|
||||||
other.isHour == isHour;
|
other.isHour == isHour;
|
||||||
|
|
||||||
@ -150,11 +168,14 @@ class ConfigurationDTO {
|
|||||||
(loaderImageId == null ? 0 : loaderImageId!.hashCode) +
|
(loaderImageId == null ? 0 : loaderImageId!.hashCode) +
|
||||||
(loaderImageUrl == null ? 0 : loaderImageUrl!.hashCode) +
|
(loaderImageUrl == null ? 0 : loaderImageUrl!.hashCode) +
|
||||||
(weatherCity == null ? 0 : weatherCity!.hashCode) +
|
(weatherCity == null ? 0 : weatherCity!.hashCode) +
|
||||||
|
(weatherUpdatedDate == null ? 0 : weatherUpdatedDate!.hashCode) +
|
||||||
|
(weatherResult == null ? 0 : weatherResult!.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);
|
||||||
|
|
||||||
@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, 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]';
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final json = <String, dynamic>{};
|
final json = <String, dynamic>{};
|
||||||
@ -243,6 +264,21 @@ class ConfigurationDTO {
|
|||||||
} else {
|
} else {
|
||||||
json[r'weatherCity'] = null;
|
json[r'weatherCity'] = null;
|
||||||
}
|
}
|
||||||
|
if (this.weatherUpdatedDate != null) {
|
||||||
|
json[r'weatherUpdatedDate'] = this.weatherUpdatedDate!.toUtc().toIso8601String();
|
||||||
|
} else {
|
||||||
|
json[r'weatherUpdatedDate'] = null;
|
||||||
|
}
|
||||||
|
if (this.weatherResult != null) {
|
||||||
|
json[r'weatherResult'] = this.weatherResult;
|
||||||
|
} else {
|
||||||
|
json[r'weatherResult'] = null;
|
||||||
|
}
|
||||||
|
if (this.isWeather != null) {
|
||||||
|
json[r'isWeather'] = this.isWeather;
|
||||||
|
} else {
|
||||||
|
json[r'isWeather'] = null;
|
||||||
|
}
|
||||||
if (this.isDate != null) {
|
if (this.isDate != null) {
|
||||||
json[r'isDate'] = this.isDate;
|
json[r'isDate'] = this.isDate;
|
||||||
} else {
|
} else {
|
||||||
@ -296,6 +332,9 @@ class ConfigurationDTO {
|
|||||||
loaderImageId: mapValueOfType<String>(json, r'loaderImageId'),
|
loaderImageId: mapValueOfType<String>(json, r'loaderImageId'),
|
||||||
loaderImageUrl: mapValueOfType<String>(json, r'loaderImageUrl'),
|
loaderImageUrl: mapValueOfType<String>(json, r'loaderImageUrl'),
|
||||||
weatherCity: mapValueOfType<String>(json, r'weatherCity'),
|
weatherCity: mapValueOfType<String>(json, r'weatherCity'),
|
||||||
|
weatherUpdatedDate: mapDateTime(json, r'weatherUpdatedDate', ''),
|
||||||
|
weatherResult: mapValueOfType<String>(json, r'weatherResult'),
|
||||||
|
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'),
|
||||||
);
|
);
|
||||||
|
|||||||
@ -30,6 +30,9 @@ class ExportConfigurationDTO {
|
|||||||
this.loaderImageId,
|
this.loaderImageId,
|
||||||
this.loaderImageUrl,
|
this.loaderImageUrl,
|
||||||
this.weatherCity,
|
this.weatherCity,
|
||||||
|
this.weatherUpdatedDate,
|
||||||
|
this.weatherResult,
|
||||||
|
this.isWeather,
|
||||||
this.isDate,
|
this.isDate,
|
||||||
this.isHour,
|
this.isHour,
|
||||||
this.sections = const [],
|
this.sections = const [],
|
||||||
@ -94,6 +97,18 @@ class ExportConfigurationDTO {
|
|||||||
|
|
||||||
String? weatherCity;
|
String? weatherCity;
|
||||||
|
|
||||||
|
DateTime? weatherUpdatedDate;
|
||||||
|
|
||||||
|
String? weatherResult;
|
||||||
|
|
||||||
|
///
|
||||||
|
/// 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? isWeather;
|
||||||
|
|
||||||
///
|
///
|
||||||
/// Please note: This property should have been non-nullable! Since the specification file
|
/// 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
|
/// does not include a default value (using the "default:" property), however, the generated
|
||||||
@ -133,6 +148,9 @@ class ExportConfigurationDTO {
|
|||||||
other.loaderImageId == loaderImageId &&
|
other.loaderImageId == loaderImageId &&
|
||||||
other.loaderImageUrl == loaderImageUrl &&
|
other.loaderImageUrl == loaderImageUrl &&
|
||||||
other.weatherCity == weatherCity &&
|
other.weatherCity == weatherCity &&
|
||||||
|
other.weatherUpdatedDate == weatherUpdatedDate &&
|
||||||
|
other.weatherResult == weatherResult &&
|
||||||
|
other.isWeather == isWeather &&
|
||||||
other.isDate == isDate &&
|
other.isDate == isDate &&
|
||||||
other.isHour == isHour &&
|
other.isHour == isHour &&
|
||||||
other.sections == sections &&
|
other.sections == sections &&
|
||||||
@ -158,13 +176,16 @@ class ExportConfigurationDTO {
|
|||||||
(loaderImageId == null ? 0 : loaderImageId!.hashCode) +
|
(loaderImageId == null ? 0 : loaderImageId!.hashCode) +
|
||||||
(loaderImageUrl == null ? 0 : loaderImageUrl!.hashCode) +
|
(loaderImageUrl == null ? 0 : loaderImageUrl!.hashCode) +
|
||||||
(weatherCity == null ? 0 : weatherCity!.hashCode) +
|
(weatherCity == null ? 0 : weatherCity!.hashCode) +
|
||||||
|
(weatherUpdatedDate == null ? 0 : weatherUpdatedDate!.hashCode) +
|
||||||
|
(weatherResult == null ? 0 : weatherResult!.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) +
|
||||||
(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, 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, sections=$sections, resources=$resources]';
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final json = <String, dynamic>{};
|
final json = <String, dynamic>{};
|
||||||
@ -253,6 +274,21 @@ class ExportConfigurationDTO {
|
|||||||
} else {
|
} else {
|
||||||
json[r'weatherCity'] = null;
|
json[r'weatherCity'] = null;
|
||||||
}
|
}
|
||||||
|
if (this.weatherUpdatedDate != null) {
|
||||||
|
json[r'weatherUpdatedDate'] = this.weatherUpdatedDate!.toUtc().toIso8601String();
|
||||||
|
} else {
|
||||||
|
json[r'weatherUpdatedDate'] = null;
|
||||||
|
}
|
||||||
|
if (this.weatherResult != null) {
|
||||||
|
json[r'weatherResult'] = this.weatherResult;
|
||||||
|
} else {
|
||||||
|
json[r'weatherResult'] = null;
|
||||||
|
}
|
||||||
|
if (this.isWeather != null) {
|
||||||
|
json[r'isWeather'] = this.isWeather;
|
||||||
|
} else {
|
||||||
|
json[r'isWeather'] = null;
|
||||||
|
}
|
||||||
if (this.isDate != null) {
|
if (this.isDate != null) {
|
||||||
json[r'isDate'] = this.isDate;
|
json[r'isDate'] = this.isDate;
|
||||||
} else {
|
} else {
|
||||||
@ -316,6 +352,9 @@ class ExportConfigurationDTO {
|
|||||||
loaderImageId: mapValueOfType<String>(json, r'loaderImageId'),
|
loaderImageId: mapValueOfType<String>(json, r'loaderImageId'),
|
||||||
loaderImageUrl: mapValueOfType<String>(json, r'loaderImageUrl'),
|
loaderImageUrl: mapValueOfType<String>(json, r'loaderImageUrl'),
|
||||||
weatherCity: mapValueOfType<String>(json, r'weatherCity'),
|
weatherCity: mapValueOfType<String>(json, r'weatherCity'),
|
||||||
|
weatherUpdatedDate: mapDateTime(json, r'weatherUpdatedDate', ''),
|
||||||
|
weatherResult: mapValueOfType<String>(json, r'weatherResult'),
|
||||||
|
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'),
|
||||||
sections: SectionDTO.listFromJson(json[r'sections']),
|
sections: SectionDTO.listFromJson(json[r'sections']),
|
||||||
|
|||||||
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
part of openapi.api;
|
part of openapi.api;
|
||||||
|
|
||||||
/// 0 = Image 1 = Video 2 = ImageUrl 3 = VideoUrl 4 = Audio 5 = PDF 6 = JSON
|
/// 0 = Image 1 = Video 2 = ImageUrl 3 = VideoUrl 4 = Audio 5 = PDF 6 = JSON 7 = JSONUrl
|
||||||
class ResourceType {
|
class ResourceType {
|
||||||
/// Instantiate a new enum with the provided [value].
|
/// Instantiate a new enum with the provided [value].
|
||||||
const ResourceType._(this.value);
|
const ResourceType._(this.value);
|
||||||
@ -30,6 +30,7 @@ class ResourceType {
|
|||||||
static const Audio = ResourceType._(4);
|
static const Audio = ResourceType._(4);
|
||||||
static const Pdf = ResourceType._(5);
|
static const Pdf = ResourceType._(5);
|
||||||
static const Json = ResourceType._(6);
|
static const Json = ResourceType._(6);
|
||||||
|
static const JsonUrl = ResourceType._(7);
|
||||||
|
|
||||||
/// List of all possible values in this [enum][ResourceType].
|
/// List of all possible values in this [enum][ResourceType].
|
||||||
static const values = <ResourceType>[
|
static const values = <ResourceType>[
|
||||||
@ -39,7 +40,8 @@ class ResourceType {
|
|||||||
VideoUrl,
|
VideoUrl,
|
||||||
Audio,
|
Audio,
|
||||||
Pdf,
|
Pdf,
|
||||||
Json
|
Json,
|
||||||
|
JsonUrl
|
||||||
];
|
];
|
||||||
|
|
||||||
static ResourceType? fromJson(dynamic value) => ResourceTypeTypeTransformer().decode(value);
|
static ResourceType? fromJson(dynamic value) => ResourceTypeTypeTransformer().decode(value);
|
||||||
@ -86,6 +88,7 @@ class ResourceTypeTypeTransformer {
|
|||||||
case "Audio": return ResourceType.Audio;
|
case "Audio": return ResourceType.Audio;
|
||||||
case "PDF": return ResourceType.Pdf;
|
case "PDF": return ResourceType.Pdf;
|
||||||
case "JSON": return ResourceType.Json;
|
case "JSON": return ResourceType.Json;
|
||||||
|
case "JSONUrl": return ResourceType.JsonUrl;
|
||||||
default:
|
default:
|
||||||
if (!allowNull) {
|
if (!allowNull) {
|
||||||
throw ArgumentError('Unknown enum value to decode: $data');
|
throw ArgumentError('Unknown enum value to decode: $data');
|
||||||
@ -101,6 +104,7 @@ class ResourceTypeTypeTransformer {
|
|||||||
case 4: return ResourceType.Audio;
|
case 4: return ResourceType.Audio;
|
||||||
case 5: return ResourceType.Pdf;
|
case 5: return ResourceType.Pdf;
|
||||||
case 6: return ResourceType.Json;
|
case 6: return ResourceType.Json;
|
||||||
|
case 7: return ResourceType.JsonUrl;
|
||||||
default:
|
default:
|
||||||
if (!allowNull) {
|
if (!allowNull) {
|
||||||
throw ArgumentError('Unknown enum value to decode: $data');
|
throw ArgumentError('Unknown enum value to decode: $data');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user