diff --git a/lib/Components/multi_string_input_html_modal.dart b/lib/Components/multi_string_input_html_modal.dart
index 53672d4..1297e8a 100644
--- a/lib/Components/multi_string_input_html_modal.dart
+++ b/lib/Components/multi_string_input_html_modal.dart
@@ -95,6 +95,23 @@ showMultiStringInputHTML (String label, String modalLabel, bool isTitle, List
newValues) {
List translations = [];
ManagerAppContext managerAppContext = appContext.getContext();
+ final customToolBarList = isTitle ? [
+ ToolBarStyle.bold,
+ ToolBarStyle.italic,
+ ToolBarStyle.color,
+ ToolBarStyle.background,
+ ToolBarStyle.clean
+ ] : [
+ ToolBarStyle.bold,
+ ToolBarStyle.italic,
+ ToolBarStyle.align,
+ ToolBarStyle.color,
+ ToolBarStyle.background,
+ ToolBarStyle.listBullet,
+ ToolBarStyle.listOrdered,
+ ToolBarStyle.clean
+ ];
+
var language = managerAppContext.selectedConfiguration!.languages![0];
//for(var language in managerAppContext.selectedConfiguration!.languages!) {
translations.add(
@@ -130,11 +147,9 @@ getTranslations(BuildContext context, AppContext appContext, QuillEditorControll
activeIconColor: Colors.green,
padding: const EdgeInsets.all(8),
iconSize: 20,
+ toolBarConfig: customToolBarList,
controller: controllerQuill,
- customButtons: [
- InkWell(onTap: () {}, child: const Icon(Icons.favorite)),
- InkWell(onTap: () {}, child: const Icon(Icons.add_circle)),
- ],
+ customButtons: [],
),
QuillHtmlEditor(
text: newValues.where((element) => element.language == language).first.value!,
@@ -157,7 +172,7 @@ getTranslations(BuildContext context, AppContext appContext, QuillEditorControll
onEditorResized: (height) =>
debugPrint('Editor resized $height'),
onSelectionChanged: (sel) =>
- debugPrint('${sel.index},${sel.length}')
+ debugPrint('${sel.index},${sel.length}'),
),
],
)
diff --git a/lib/Screens/Configurations/Section/section_detail_screen.dart b/lib/Screens/Configurations/Section/section_detail_screen.dart
index ec0657b..746a852 100644
--- a/lib/Screens/Configurations/Section/section_detail_screen.dart
+++ b/lib/Screens/Configurations/Section/section_detail_screen.dart
@@ -90,7 +90,7 @@ class _SectionDetailScreenState extends State {
children: [
Container(
//color: Colors.orangeAccent,
- height: 75,
+ height: 80,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
@@ -180,7 +180,7 @@ class _SectionDetailScreenState extends State {
height: 125,
child: RepaintBoundary(
key: globalKey,
- child: QrImage(
+ child: QrImageView(
padding: EdgeInsets.only(left: 5.0, top: 5.0, bottom: 5.0, right: 5.0),
data: sectionDTO!.id!,
version: QrVersions.auto,
@@ -189,7 +189,7 @@ class _SectionDetailScreenState extends State {
),
),
),
- SelectableText(sectionDTO.id!, style: new TextStyle(fontSize: 15))
+ SelectableText(sectionDTO!.id!, style: new TextStyle(fontSize: 15))
],
),
CheckInputContainer(
@@ -203,14 +203,14 @@ class _SectionDetailScreenState extends State {
});
},
),
- if(sectionDTO.isBeacon!)
+ if(sectionDTO!.isBeacon!)
NumberInputContainer(
label: "Identifiant Beacon :",
- initialValue: sectionDTO.beaconId != null ? sectionDTO.beaconId! : 0,
+ initialValue: sectionDTO!.beaconId != null ? sectionDTO.beaconId! : 0,
isSmall: true,
onChanged: (value) {
try {
- sectionDTO.beaconId = int.parse(value);
+ sectionDTO!.beaconId = int.parse(value);
} catch (e) {
print('BeaconId not a number');
showNotification(Colors.orange, kWhite, 'Cela doit ĂȘtre un chiffre', context, null);
diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift
index c88361f..9b15cc8 100644
--- a/macos/Flutter/GeneratedPluginRegistrant.swift
+++ b/macos/Flutter/GeneratedPluginRegistrant.swift
@@ -14,7 +14,7 @@ import path_provider_foundation
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AudioSessionPlugin.register(with: registry.registrar(forPlugin: "AudioSessionPlugin"))
JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin"))
- FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
+ FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PasteboardPlugin.register(with: registry.registrar(forPlugin: "PasteboardPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
}
diff --git a/manager_api_new/README.md b/manager_api_new/README.md
index 60866c3..978f7ba 100644
--- a/manager_api_new/README.md
+++ b/manager_api_new/README.md
@@ -156,7 +156,8 @@ Class | Method | HTTP request | Description
## Documentation For Authorization
-## bearer
+Authentication schemes defined for the API:
+### bearer
- **Type**: OAuth
- **Flow**: password
diff --git a/manager_api_new/lib/api_client.dart b/manager_api_new/lib/api_client.dart
index 70d5cce..007b008 100644
--- a/manager_api_new/lib/api_client.dart
+++ b/manager_api_new/lib/api_client.dart
@@ -11,11 +11,13 @@
part of openapi.api;
class ApiClient {
- ApiClient({this.basePath = 'https://api.mymuseum.be', this.authentication});
+ ApiClient({this.basePath = 'https://api.mymuseum.be', this.authentication,});
final String basePath;
+ final Authentication? authentication;
var _client = Client();
+ final _defaultHeaderMap = {};
/// Returns the current HTTP [Client] instance to use in this class.
///
@@ -27,15 +29,12 @@ class ApiClient {
_client = newClient;
}
- final _defaultHeaderMap = {};
- final Authentication? authentication;
+ Map get defaultHeaderMap => _defaultHeaderMap;
void addDefaultHeader(String key, String value) {
_defaultHeaderMap[key] = value;
}
- Map get defaultHeaderMap => _defaultHeaderMap;
-
// We don't use a Map for queryParams.
// If collectionFormat is 'multi', a key might appear multiple times.
Future invokeAPI(
@@ -47,7 +46,7 @@ class ApiClient {
Map formParams,
String? contentType,
) async {
- _updateParamsForAuth(queryParams, headerParams);
+ await authentication?.applyToParams(queryParams, headerParams);
headerParams.addAll(_defaultHeaderMap);
if (contentType != null) {
@@ -165,16 +164,6 @@ class ApiClient {
@Deprecated('Scheduled for removal in OpenAPI Generator 6.x. Use serializeAsync() instead.')
String serialize(Object? value) => value == null ? '' : json.encode(value);
- /// Update query and header parameters based on authentication settings.
- void _updateParamsForAuth(
- List queryParams,
- Map headerParams,
- ) {
- if (authentication != null) {
- authentication!.applyToParams(queryParams, headerParams);
- }
- }
-
static dynamic _deserialize(dynamic value, String targetType, {bool growable = false}) {
try {
switch (targetType) {
@@ -190,6 +179,8 @@ class ApiClient {
}
final valueString = '$value'.toLowerCase();
return valueString == 'true' || valueString == '1';
+ case 'DateTime':
+ return value is DateTime ? value : DateTime.tryParse(value);
case 'ArticleDTO':
return ArticleDTO.fromJson(value);
case 'ConfigurationDTO':
diff --git a/manager_api_new/lib/auth/api_key_auth.dart b/manager_api_new/lib/auth/api_key_auth.dart
index e304eda..84dc295 100644
--- a/manager_api_new/lib/auth/api_key_auth.dart
+++ b/manager_api_new/lib/auth/api_key_auth.dart
@@ -20,7 +20,7 @@ class ApiKeyAuth implements Authentication {
String apiKey = '';
@override
- void applyToParams(List queryParams, Map headerParams) {
+ Future applyToParams(List queryParams, Map headerParams,) async {
final paramValue = apiKeyPrefix.isEmpty ? apiKey : '$apiKeyPrefix $apiKey';
if (paramValue.isNotEmpty) {
diff --git a/manager_api_new/lib/auth/authentication.dart b/manager_api_new/lib/auth/authentication.dart
index 49baf7c..1b1b8ae 100644
--- a/manager_api_new/lib/auth/authentication.dart
+++ b/manager_api_new/lib/auth/authentication.dart
@@ -13,5 +13,5 @@ part of openapi.api;
// ignore: one_member_abstracts
abstract class Authentication {
/// Apply authentication settings to header and query params.
- void applyToParams(List queryParams, Map headerParams);
+ Future applyToParams(List queryParams, Map headerParams);
}
diff --git a/manager_api_new/lib/auth/http_basic_auth.dart b/manager_api_new/lib/auth/http_basic_auth.dart
index 81abd71..dfedaa5 100644
--- a/manager_api_new/lib/auth/http_basic_auth.dart
+++ b/manager_api_new/lib/auth/http_basic_auth.dart
@@ -17,7 +17,7 @@ class HttpBasicAuth implements Authentication {
String password;
@override
- void applyToParams(List queryParams, Map headerParams) {
+ Future applyToParams(List queryParams, Map headerParams,) async {
if (username.isNotEmpty && password.isNotEmpty) {
final credentials = '$username:$password';
headerParams['Authorization'] = 'Basic ${base64.encode(utf8.encode(credentials))}';
diff --git a/manager_api_new/lib/auth/http_bearer_auth.dart b/manager_api_new/lib/auth/http_bearer_auth.dart
index 213f348..eddf3a5 100644
--- a/manager_api_new/lib/auth/http_bearer_auth.dart
+++ b/manager_api_new/lib/auth/http_bearer_auth.dart
@@ -27,7 +27,7 @@ class HttpBearerAuth implements Authentication {
}
@override
- void applyToParams(List queryParams, Map headerParams) {
+ Future applyToParams(List queryParams, Map headerParams,) async {
if (_accessToken == null) {
return;
}
diff --git a/manager_api_new/lib/auth/oauth.dart b/manager_api_new/lib/auth/oauth.dart
index e9b87cf..e9e7d78 100644
--- a/manager_api_new/lib/auth/oauth.dart
+++ b/manager_api_new/lib/auth/oauth.dart
@@ -16,7 +16,7 @@ class OAuth implements Authentication {
String accessToken;
@override
- void applyToParams(List queryParams, Map headerParams) {
+ Future applyToParams(List queryParams, Map headerParams,) async {
if (accessToken.isNotEmpty) {
headerParams['Authorization'] = 'Bearer $accessToken';
}
diff --git a/manager_api_new/lib/model/article_dto.dart b/manager_api_new/lib/model/article_dto.dart
index 5e6cd8f..3b72137 100644
--- a/manager_api_new/lib/model/article_dto.dart
+++ b/manager_api_new/lib/model/article_dto.dart
@@ -63,23 +63,33 @@ class ArticleDTO {
String toString() => 'ArticleDTO[content=$content, isContentTop=$isContentTop, audioIds=$audioIds, isReadAudioAuto=$isReadAudioAuto, images=$images]';
Map toJson() {
- final _json = {};
- if (content != null) {
- _json[r'content'] = content;
+ final json = {};
+ if (this.content != null) {
+ json[r'content'] = this.content;
+ } else {
+ json[r'content'] = null;
}
- if (isContentTop != null) {
- _json[r'isContentTop'] = isContentTop;
+ if (this.isContentTop != null) {
+ json[r'isContentTop'] = this.isContentTop;
+ } else {
+ json[r'isContentTop'] = null;
}
- if (audioIds != null) {
- _json[r'audioIds'] = audioIds;
+ if (this.audioIds != null) {
+ json[r'audioIds'] = this.audioIds;
+ } else {
+ json[r'audioIds'] = null;
}
- if (isReadAudioAuto != null) {
- _json[r'isReadAudioAuto'] = isReadAudioAuto;
+ if (this.isReadAudioAuto != null) {
+ json[r'isReadAudioAuto'] = this.isReadAudioAuto;
+ } else {
+ json[r'isReadAudioAuto'] = null;
}
- if (images != null) {
- _json[r'images'] = images;
+ if (this.images != null) {
+ json[r'images'] = this.images;
+ } else {
+ json[r'images'] = null;
}
- return _json;
+ return json;
}
/// Returns a new [ArticleDTO] instance and imports its values from
@@ -101,17 +111,17 @@ class ArticleDTO {
}());
return ArticleDTO(
- content: TranslationDTO.listFromJson(json[r'content']) ?? const [],
+ content: TranslationDTO.listFromJson(json[r'content']),
isContentTop: mapValueOfType(json, r'isContentTop'),
- audioIds: TranslationDTO.listFromJson(json[r'audioIds']) ?? const [],
+ audioIds: TranslationDTO.listFromJson(json[r'audioIds']),
isReadAudioAuto: mapValueOfType(json, r'isReadAudioAuto'),
- images: ImageDTO.listFromJson(json[r'images']) ?? const [],
+ images: ImageDTO.listFromJson(json[r'images']),
);
}
return null;
}
- static List? listFromJson(dynamic json, {bool growable = false,}) {
+ static List listFromJson(dynamic json, {bool growable = false,}) {
final result = [];
if (json is List && json.isNotEmpty) {
for (final row in json) {
@@ -142,12 +152,10 @@ class ArticleDTO {
static Map> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = >{};
if (json is Map && json.isNotEmpty) {
- json = json.cast(); // ignore: parameter_assignments
+ // ignore: parameter_assignments
+ json = json.cast();
for (final entry in json.entries) {
- final value = ArticleDTO.listFromJson(entry.value, growable: growable,);
- if (value != null) {
- map[entry.key] = value;
- }
+ map[entry.key] = ArticleDTO.listFromJson(entry.value, growable: growable,);
}
}
return map;
diff --git a/manager_api_new/lib/model/configuration_dto.dart b/manager_api_new/lib/model/configuration_dto.dart
index fae5f68..e0d7e9c 100644
--- a/manager_api_new/lib/model/configuration_dto.dart
+++ b/manager_api_new/lib/model/configuration_dto.dart
@@ -120,50 +120,78 @@ class ConfigurationDTO {
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]';
Map toJson() {
- final _json = {};
- if (id != null) {
- _json[r'id'] = id;
+ final json = {};
+ if (this.id != null) {
+ json[r'id'] = this.id;
+ } else {
+ json[r'id'] = null;
}
- if (label != null) {
- _json[r'label'] = label;
+ if (this.label != null) {
+ json[r'label'] = this.label;
+ } else {
+ json[r'label'] = null;
}
- if (title != null) {
- _json[r'title'] = title;
+ if (this.title != null) {
+ json[r'title'] = this.title;
+ } else {
+ json[r'title'] = null;
}
- if (imageId != null) {
- _json[r'imageId'] = imageId;
+ if (this.imageId != null) {
+ json[r'imageId'] = this.imageId;
+ } else {
+ json[r'imageId'] = null;
}
- if (imageSource != null) {
- _json[r'imageSource'] = imageSource;
+ if (this.imageSource != null) {
+ json[r'imageSource'] = this.imageSource;
+ } else {
+ json[r'imageSource'] = null;
}
- if (primaryColor != null) {
- _json[r'primaryColor'] = primaryColor;
+ if (this.primaryColor != null) {
+ json[r'primaryColor'] = this.primaryColor;
+ } else {
+ json[r'primaryColor'] = null;
}
- if (secondaryColor != null) {
- _json[r'secondaryColor'] = secondaryColor;
+ if (this.secondaryColor != null) {
+ json[r'secondaryColor'] = this.secondaryColor;
+ } else {
+ json[r'secondaryColor'] = null;
}
- if (languages != null) {
- _json[r'languages'] = languages;
+ if (this.languages != null) {
+ json[r'languages'] = this.languages;
+ } else {
+ json[r'languages'] = null;
}
- if (dateCreation != null) {
- _json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String();
+ if (this.dateCreation != null) {
+ json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
+ } else {
+ json[r'dateCreation'] = null;
}
- if (isMobile != null) {
- _json[r'isMobile'] = isMobile;
+ if (this.isMobile != null) {
+ json[r'isMobile'] = this.isMobile;
+ } else {
+ json[r'isMobile'] = null;
}
- if (isTablet != null) {
- _json[r'isTablet'] = isTablet;
+ if (this.isTablet != null) {
+ json[r'isTablet'] = this.isTablet;
+ } else {
+ json[r'isTablet'] = null;
}
- if (isOffline != null) {
- _json[r'isOffline'] = isOffline;
+ if (this.isOffline != null) {
+ json[r'isOffline'] = this.isOffline;
+ } else {
+ json[r'isOffline'] = null;
}
- if (instanceId != null) {
- _json[r'instanceId'] = instanceId;
+ if (this.instanceId != null) {
+ json[r'instanceId'] = this.instanceId;
+ } else {
+ json[r'instanceId'] = null;
}
- if (sectionIds != null) {
- _json[r'sectionIds'] = sectionIds;
+ if (this.sectionIds != null) {
+ json[r'sectionIds'] = this.sectionIds;
+ } else {
+ json[r'sectionIds'] = null;
}
- return _json;
+ return json;
}
/// Returns a new [ConfigurationDTO] instance and imports its values from
@@ -187,7 +215,7 @@ class ConfigurationDTO {
return ConfigurationDTO(
id: mapValueOfType(json, r'id'),
label: mapValueOfType(json, r'label'),
- title: TranslationDTO.listFromJson(json[r'title']) ?? const [],
+ title: TranslationDTO.listFromJson(json[r'title']),
imageId: mapValueOfType(json, r'imageId'),
imageSource: mapValueOfType(json, r'imageSource'),
primaryColor: mapValueOfType(json, r'primaryColor'),
@@ -208,7 +236,7 @@ class ConfigurationDTO {
return null;
}
- static List? listFromJson(dynamic json, {bool growable = false,}) {
+ static List listFromJson(dynamic json, {bool growable = false,}) {
final result = [];
if (json is List && json.isNotEmpty) {
for (final row in json) {
@@ -239,12 +267,10 @@ class ConfigurationDTO {
static Map> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = >{};
if (json is Map && json.isNotEmpty) {
- json = json.cast(); // ignore: parameter_assignments
+ // ignore: parameter_assignments
+ json = json.cast();
for (final entry in json.entries) {
- final value = ConfigurationDTO.listFromJson(entry.value, growable: growable,);
- if (value != null) {
- map[entry.key] = value;
- }
+ map[entry.key] = ConfigurationDTO.listFromJson(entry.value, growable: growable,);
}
}
return map;
diff --git a/manager_api_new/lib/model/device_detail_dto.dart b/manager_api_new/lib/model/device_detail_dto.dart
index 88ec18f..8c645d6 100644
--- a/manager_api_new/lib/model/device_detail_dto.dart
+++ b/manager_api_new/lib/model/device_detail_dto.dart
@@ -131,53 +131,83 @@ class DeviceDetailDTO {
String toString() => 'DeviceDetailDTO[id=$id, identifier=$identifier, name=$name, ipAddressWLAN=$ipAddressWLAN, ipAddressETH=$ipAddressETH, configurationId=$configurationId, configuration=$configuration, connected=$connected, dateCreation=$dateCreation, dateUpdate=$dateUpdate, instanceId=$instanceId, connectionLevel=$connectionLevel, lastConnectionLevel=$lastConnectionLevel, batteryLevel=$batteryLevel, lastBatteryLevel=$lastBatteryLevel]';
Map toJson() {
- final _json = {};
- if (id != null) {
- _json[r'id'] = id;
+ final json = {};
+ if (this.id != null) {
+ json[r'id'] = this.id;
+ } else {
+ json[r'id'] = null;
}
- if (identifier != null) {
- _json[r'identifier'] = identifier;
+ if (this.identifier != null) {
+ json[r'identifier'] = this.identifier;
+ } else {
+ json[r'identifier'] = null;
}
- if (name != null) {
- _json[r'name'] = name;
+ if (this.name != null) {
+ json[r'name'] = this.name;
+ } else {
+ json[r'name'] = null;
}
- if (ipAddressWLAN != null) {
- _json[r'ipAddressWLAN'] = ipAddressWLAN;
+ if (this.ipAddressWLAN != null) {
+ json[r'ipAddressWLAN'] = this.ipAddressWLAN;
+ } else {
+ json[r'ipAddressWLAN'] = null;
}
- if (ipAddressETH != null) {
- _json[r'ipAddressETH'] = ipAddressETH;
+ if (this.ipAddressETH != null) {
+ json[r'ipAddressETH'] = this.ipAddressETH;
+ } else {
+ json[r'ipAddressETH'] = null;
}
- if (configurationId != null) {
- _json[r'configurationId'] = configurationId;
+ if (this.configurationId != null) {
+ json[r'configurationId'] = this.configurationId;
+ } else {
+ json[r'configurationId'] = null;
}
- if (configuration != null) {
- _json[r'configuration'] = configuration;
+ if (this.configuration != null) {
+ json[r'configuration'] = this.configuration;
+ } else {
+ json[r'configuration'] = null;
}
- if (connected != null) {
- _json[r'connected'] = connected;
+ if (this.connected != null) {
+ json[r'connected'] = this.connected;
+ } else {
+ json[r'connected'] = null;
}
- if (dateCreation != null) {
- _json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String();
+ if (this.dateCreation != null) {
+ json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
+ } else {
+ json[r'dateCreation'] = null;
}
- if (dateUpdate != null) {
- _json[r'dateUpdate'] = dateUpdate!.toUtc().toIso8601String();
+ if (this.dateUpdate != null) {
+ json[r'dateUpdate'] = this.dateUpdate!.toUtc().toIso8601String();
+ } else {
+ json[r'dateUpdate'] = null;
}
- if (instanceId != null) {
- _json[r'instanceId'] = instanceId;
+ if (this.instanceId != null) {
+ json[r'instanceId'] = this.instanceId;
+ } else {
+ json[r'instanceId'] = null;
}
- if (connectionLevel != null) {
- _json[r'connectionLevel'] = connectionLevel;
+ if (this.connectionLevel != null) {
+ json[r'connectionLevel'] = this.connectionLevel;
+ } else {
+ json[r'connectionLevel'] = null;
}
- if (lastConnectionLevel != null) {
- _json[r'lastConnectionLevel'] = lastConnectionLevel!.toUtc().toIso8601String();
+ if (this.lastConnectionLevel != null) {
+ json[r'lastConnectionLevel'] = this.lastConnectionLevel!.toUtc().toIso8601String();
+ } else {
+ json[r'lastConnectionLevel'] = null;
}
- if (batteryLevel != null) {
- _json[r'batteryLevel'] = batteryLevel;
+ if (this.batteryLevel != null) {
+ json[r'batteryLevel'] = this.batteryLevel;
+ } else {
+ json[r'batteryLevel'] = null;
}
- if (lastBatteryLevel != null) {
- _json[r'lastBatteryLevel'] = lastBatteryLevel!.toUtc().toIso8601String();
+ if (this.lastBatteryLevel != null) {
+ json[r'lastBatteryLevel'] = this.lastBatteryLevel!.toUtc().toIso8601String();
+ } else {
+ json[r'lastBatteryLevel'] = null;
}
- return _json;
+ return json;
}
/// Returns a new [DeviceDetailDTO] instance and imports its values from
@@ -219,7 +249,7 @@ class DeviceDetailDTO {
return null;
}
- static List? listFromJson(dynamic json, {bool growable = false,}) {
+ static List listFromJson(dynamic json, {bool growable = false,}) {
final result = [];
if (json is List && json.isNotEmpty) {
for (final row in json) {
@@ -250,12 +280,10 @@ class DeviceDetailDTO {
static Map> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = >{};
if (json is Map && json.isNotEmpty) {
- json = json.cast(); // ignore: parameter_assignments
+ // ignore: parameter_assignments
+ json = json.cast();
for (final entry in json.entries) {
- final value = DeviceDetailDTO.listFromJson(entry.value, growable: growable,);
- if (value != null) {
- map[entry.key] = value;
- }
+ map[entry.key] = DeviceDetailDTO.listFromJson(entry.value, growable: growable,);
}
}
return map;
diff --git a/manager_api_new/lib/model/device_detail_dto_all_of.dart b/manager_api_new/lib/model/device_detail_dto_all_of.dart
index cc7cfb6..2e990db 100644
--- a/manager_api_new/lib/model/device_detail_dto_all_of.dart
+++ b/manager_api_new/lib/model/device_detail_dto_all_of.dart
@@ -58,20 +58,28 @@ class DeviceDetailDTOAllOf {
String toString() => 'DeviceDetailDTOAllOf[connectionLevel=$connectionLevel, lastConnectionLevel=$lastConnectionLevel, batteryLevel=$batteryLevel, lastBatteryLevel=$lastBatteryLevel]';
Map toJson() {
- final _json = {};
- if (connectionLevel != null) {
- _json[r'connectionLevel'] = connectionLevel;
+ final json = {};
+ if (this.connectionLevel != null) {
+ json[r'connectionLevel'] = this.connectionLevel;
+ } else {
+ json[r'connectionLevel'] = null;
}
- if (lastConnectionLevel != null) {
- _json[r'lastConnectionLevel'] = lastConnectionLevel!.toUtc().toIso8601String();
+ if (this.lastConnectionLevel != null) {
+ json[r'lastConnectionLevel'] = this.lastConnectionLevel!.toUtc().toIso8601String();
+ } else {
+ json[r'lastConnectionLevel'] = null;
}
- if (batteryLevel != null) {
- _json[r'batteryLevel'] = batteryLevel;
+ if (this.batteryLevel != null) {
+ json[r'batteryLevel'] = this.batteryLevel;
+ } else {
+ json[r'batteryLevel'] = null;
}
- if (lastBatteryLevel != null) {
- _json[r'lastBatteryLevel'] = lastBatteryLevel!.toUtc().toIso8601String();
+ if (this.lastBatteryLevel != null) {
+ json[r'lastBatteryLevel'] = this.lastBatteryLevel!.toUtc().toIso8601String();
+ } else {
+ json[r'lastBatteryLevel'] = null;
}
- return _json;
+ return json;
}
/// Returns a new [DeviceDetailDTOAllOf] instance and imports its values from
@@ -102,7 +110,7 @@ class DeviceDetailDTOAllOf {
return null;
}
- static List? listFromJson(dynamic json, {bool growable = false,}) {
+ static List listFromJson(dynamic json, {bool growable = false,}) {
final result = [];
if (json is List && json.isNotEmpty) {
for (final row in json) {
@@ -133,12 +141,10 @@ class DeviceDetailDTOAllOf {
static Map> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = >{};
if (json is Map && json.isNotEmpty) {
- json = json.cast(); // ignore: parameter_assignments
+ // ignore: parameter_assignments
+ json = json.cast();
for (final entry in json.entries) {
- final value = DeviceDetailDTOAllOf.listFromJson(entry.value, growable: growable,);
- if (value != null) {
- map[entry.key] = value;
- }
+ map[entry.key] = DeviceDetailDTOAllOf.listFromJson(entry.value, growable: growable,);
}
}
return map;
diff --git a/manager_api_new/lib/model/device_dto.dart b/manager_api_new/lib/model/device_dto.dart
index 7915fb8..7d8ea3a 100644
--- a/manager_api_new/lib/model/device_dto.dart
+++ b/manager_api_new/lib/model/device_dto.dart
@@ -99,41 +99,63 @@ class DeviceDTO {
String toString() => 'DeviceDTO[id=$id, identifier=$identifier, name=$name, ipAddressWLAN=$ipAddressWLAN, ipAddressETH=$ipAddressETH, configurationId=$configurationId, configuration=$configuration, connected=$connected, dateCreation=$dateCreation, dateUpdate=$dateUpdate, instanceId=$instanceId]';
Map toJson() {
- final _json = {};
- if (id != null) {
- _json[r'id'] = id;
+ final json = {};
+ if (this.id != null) {
+ json[r'id'] = this.id;
+ } else {
+ json[r'id'] = null;
}
- if (identifier != null) {
- _json[r'identifier'] = identifier;
+ if (this.identifier != null) {
+ json[r'identifier'] = this.identifier;
+ } else {
+ json[r'identifier'] = null;
}
- if (name != null) {
- _json[r'name'] = name;
+ if (this.name != null) {
+ json[r'name'] = this.name;
+ } else {
+ json[r'name'] = null;
}
- if (ipAddressWLAN != null) {
- _json[r'ipAddressWLAN'] = ipAddressWLAN;
+ if (this.ipAddressWLAN != null) {
+ json[r'ipAddressWLAN'] = this.ipAddressWLAN;
+ } else {
+ json[r'ipAddressWLAN'] = null;
}
- if (ipAddressETH != null) {
- _json[r'ipAddressETH'] = ipAddressETH;
+ if (this.ipAddressETH != null) {
+ json[r'ipAddressETH'] = this.ipAddressETH;
+ } else {
+ json[r'ipAddressETH'] = null;
}
- if (configurationId != null) {
- _json[r'configurationId'] = configurationId;
+ if (this.configurationId != null) {
+ json[r'configurationId'] = this.configurationId;
+ } else {
+ json[r'configurationId'] = null;
}
- if (configuration != null) {
- _json[r'configuration'] = configuration;
+ if (this.configuration != null) {
+ json[r'configuration'] = this.configuration;
+ } else {
+ json[r'configuration'] = null;
}
- if (connected != null) {
- _json[r'connected'] = connected;
+ if (this.connected != null) {
+ json[r'connected'] = this.connected;
+ } else {
+ json[r'connected'] = null;
}
- if (dateCreation != null) {
- _json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String();
+ if (this.dateCreation != null) {
+ json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
+ } else {
+ json[r'dateCreation'] = null;
}
- if (dateUpdate != null) {
- _json[r'dateUpdate'] = dateUpdate!.toUtc().toIso8601String();
+ if (this.dateUpdate != null) {
+ json[r'dateUpdate'] = this.dateUpdate!.toUtc().toIso8601String();
+ } else {
+ json[r'dateUpdate'] = null;
}
- if (instanceId != null) {
- _json[r'instanceId'] = instanceId;
+ if (this.instanceId != null) {
+ json[r'instanceId'] = this.instanceId;
+ } else {
+ json[r'instanceId'] = null;
}
- return _json;
+ return json;
}
/// Returns a new [DeviceDTO] instance and imports its values from
@@ -171,7 +193,7 @@ class DeviceDTO {
return null;
}
- static List? listFromJson(dynamic json, {bool growable = false,}) {
+ static List listFromJson(dynamic json, {bool growable = false,}) {
final result = [];
if (json is List && json.isNotEmpty) {
for (final row in json) {
@@ -202,12 +224,10 @@ class DeviceDTO {
static Map> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = >{};
if (json is Map && json.isNotEmpty) {
- json = json.cast(); // ignore: parameter_assignments
+ // ignore: parameter_assignments
+ json = json.cast();
for (final entry in json.entries) {
- final value = DeviceDTO.listFromJson(entry.value, growable: growable,);
- if (value != null) {
- map[entry.key] = value;
- }
+ map[entry.key] = DeviceDTO.listFromJson(entry.value, growable: growable,);
}
}
return map;
diff --git a/manager_api_new/lib/model/export_configuration_dto.dart b/manager_api_new/lib/model/export_configuration_dto.dart
index 04543ca..1b24580 100644
--- a/manager_api_new/lib/model/export_configuration_dto.dart
+++ b/manager_api_new/lib/model/export_configuration_dto.dart
@@ -130,56 +130,88 @@ class ExportConfigurationDTO {
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, sections=$sections, resources=$resources]';
Map toJson() {
- final _json = {};
- if (id != null) {
- _json[r'id'] = id;
+ final json = {};
+ if (this.id != null) {
+ json[r'id'] = this.id;
+ } else {
+ json[r'id'] = null;
}
- if (label != null) {
- _json[r'label'] = label;
+ if (this.label != null) {
+ json[r'label'] = this.label;
+ } else {
+ json[r'label'] = null;
}
- if (title != null) {
- _json[r'title'] = title;
+ if (this.title != null) {
+ json[r'title'] = this.title;
+ } else {
+ json[r'title'] = null;
}
- if (imageId != null) {
- _json[r'imageId'] = imageId;
+ if (this.imageId != null) {
+ json[r'imageId'] = this.imageId;
+ } else {
+ json[r'imageId'] = null;
}
- if (imageSource != null) {
- _json[r'imageSource'] = imageSource;
+ if (this.imageSource != null) {
+ json[r'imageSource'] = this.imageSource;
+ } else {
+ json[r'imageSource'] = null;
}
- if (primaryColor != null) {
- _json[r'primaryColor'] = primaryColor;
+ if (this.primaryColor != null) {
+ json[r'primaryColor'] = this.primaryColor;
+ } else {
+ json[r'primaryColor'] = null;
}
- if (secondaryColor != null) {
- _json[r'secondaryColor'] = secondaryColor;
+ if (this.secondaryColor != null) {
+ json[r'secondaryColor'] = this.secondaryColor;
+ } else {
+ json[r'secondaryColor'] = null;
}
- if (languages != null) {
- _json[r'languages'] = languages;
+ if (this.languages != null) {
+ json[r'languages'] = this.languages;
+ } else {
+ json[r'languages'] = null;
}
- if (dateCreation != null) {
- _json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String();
+ if (this.dateCreation != null) {
+ json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
+ } else {
+ json[r'dateCreation'] = null;
}
- if (isMobile != null) {
- _json[r'isMobile'] = isMobile;
+ if (this.isMobile != null) {
+ json[r'isMobile'] = this.isMobile;
+ } else {
+ json[r'isMobile'] = null;
}
- if (isTablet != null) {
- _json[r'isTablet'] = isTablet;
+ if (this.isTablet != null) {
+ json[r'isTablet'] = this.isTablet;
+ } else {
+ json[r'isTablet'] = null;
}
- if (isOffline != null) {
- _json[r'isOffline'] = isOffline;
+ if (this.isOffline != null) {
+ json[r'isOffline'] = this.isOffline;
+ } else {
+ json[r'isOffline'] = null;
}
- if (instanceId != null) {
- _json[r'instanceId'] = instanceId;
+ if (this.instanceId != null) {
+ json[r'instanceId'] = this.instanceId;
+ } else {
+ json[r'instanceId'] = null;
}
- if (sectionIds != null) {
- _json[r'sectionIds'] = sectionIds;
+ if (this.sectionIds != null) {
+ json[r'sectionIds'] = this.sectionIds;
+ } else {
+ json[r'sectionIds'] = null;
}
- if (sections != null) {
- _json[r'sections'] = sections;
+ if (this.sections != null) {
+ json[r'sections'] = this.sections;
+ } else {
+ json[r'sections'] = null;
}
- if (resources != null) {
- _json[r'resources'] = resources;
+ if (this.resources != null) {
+ json[r'resources'] = this.resources;
+ } else {
+ json[r'resources'] = null;
}
- return _json;
+ return json;
}
/// Returns a new [ExportConfigurationDTO] instance and imports its values from
@@ -203,7 +235,7 @@ class ExportConfigurationDTO {
return ExportConfigurationDTO(
id: mapValueOfType(json, r'id'),
label: mapValueOfType(json, r'label'),
- title: TranslationDTO.listFromJson(json[r'title']) ?? const [],
+ title: TranslationDTO.listFromJson(json[r'title']),
imageId: mapValueOfType(json, r'imageId'),
imageSource: mapValueOfType(json, r'imageSource'),
primaryColor: mapValueOfType(json, r'primaryColor'),
@@ -219,14 +251,14 @@ class ExportConfigurationDTO {
sectionIds: json[r'sectionIds'] is List
? (json[r'sectionIds'] as List).cast()
: const [],
- sections: SectionDTO.listFromJson(json[r'sections']) ?? const [],
- resources: ResourceDTO.listFromJson(json[r'resources']) ?? const [],
+ sections: SectionDTO.listFromJson(json[r'sections']),
+ resources: ResourceDTO.listFromJson(json[r'resources']),
);
}
return null;
}
- static List? listFromJson(dynamic json, {bool growable = false,}) {
+ static List listFromJson(dynamic json, {bool growable = false,}) {
final result = [];
if (json is List && json.isNotEmpty) {
for (final row in json) {
@@ -257,12 +289,10 @@ class ExportConfigurationDTO {
static Map> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = >{};
if (json is Map && json.isNotEmpty) {
- json = json.cast(); // ignore: parameter_assignments
+ // ignore: parameter_assignments
+ json = json.cast();
for (final entry in json.entries) {
- final value = ExportConfigurationDTO.listFromJson(entry.value, growable: growable,);
- if (value != null) {
- map[entry.key] = value;
- }
+ map[entry.key] = ExportConfigurationDTO.listFromJson(entry.value, growable: growable,);
}
}
return map;
diff --git a/manager_api_new/lib/model/export_configuration_dto_all_of.dart b/manager_api_new/lib/model/export_configuration_dto_all_of.dart
index 28c86a7..89650d1 100644
--- a/manager_api_new/lib/model/export_configuration_dto_all_of.dart
+++ b/manager_api_new/lib/model/export_configuration_dto_all_of.dart
@@ -36,14 +36,18 @@ class ExportConfigurationDTOAllOf {
String toString() => 'ExportConfigurationDTOAllOf[sections=$sections, resources=$resources]';
Map toJson() {
- final _json = {};
- if (sections != null) {
- _json[r'sections'] = sections;
+ final json = {};
+ if (this.sections != null) {
+ json[r'sections'] = this.sections;
+ } else {
+ json[r'sections'] = null;
}
- if (resources != null) {
- _json[r'resources'] = resources;
+ if (this.resources != null) {
+ json[r'resources'] = this.resources;
+ } else {
+ json[r'resources'] = null;
}
- return _json;
+ return json;
}
/// Returns a new [ExportConfigurationDTOAllOf] instance and imports its values from
@@ -65,14 +69,14 @@ class ExportConfigurationDTOAllOf {
}());
return ExportConfigurationDTOAllOf(
- sections: SectionDTO.listFromJson(json[r'sections']) ?? const [],
- resources: ResourceDTO.listFromJson(json[r'resources']) ?? const [],
+ sections: SectionDTO.listFromJson(json[r'sections']),
+ resources: ResourceDTO.listFromJson(json[r'resources']),
);
}
return null;
}
- static List? listFromJson(dynamic json, {bool growable = false,}) {
+ static List listFromJson(dynamic json, {bool growable = false,}) {
final result = [];
if (json is List && json.isNotEmpty) {
for (final row in json) {
@@ -103,12 +107,10 @@ class ExportConfigurationDTOAllOf {
static Map> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = >{};
if (json is Map && json.isNotEmpty) {
- json = json.cast(); // ignore: parameter_assignments
+ // ignore: parameter_assignments
+ json = json.cast();
for (final entry in json.entries) {
- final value = ExportConfigurationDTOAllOf.listFromJson(entry.value, growable: growable,);
- if (value != null) {
- map[entry.key] = value;
- }
+ map[entry.key] = ExportConfigurationDTOAllOf.listFromJson(entry.value, growable: growable,);
}
}
return map;
diff --git a/manager_api_new/lib/model/geo_point_dto.dart b/manager_api_new/lib/model/geo_point_dto.dart
index 28600c5..e03a69c 100644
--- a/manager_api_new/lib/model/geo_point_dto.dart
+++ b/manager_api_new/lib/model/geo_point_dto.dart
@@ -62,26 +62,38 @@ class GeoPointDTO {
String toString() => 'GeoPointDTO[id=$id, title=$title, description=$description, images=$images, latitude=$latitude, longitude=$longitude]';
Map toJson() {
- final _json = {};
- if (id != null) {
- _json[r'id'] = id;
+ final json = {};
+ if (this.id != null) {
+ json[r'id'] = this.id;
+ } else {
+ json[r'id'] = null;
}
- if (title != null) {
- _json[r'title'] = title;
+ if (this.title != null) {
+ json[r'title'] = this.title;
+ } else {
+ json[r'title'] = null;
}
- if (description != null) {
- _json[r'description'] = description;
+ if (this.description != null) {
+ json[r'description'] = this.description;
+ } else {
+ json[r'description'] = null;
}
- if (images != null) {
- _json[r'images'] = images;
+ if (this.images != null) {
+ json[r'images'] = this.images;
+ } else {
+ json[r'images'] = null;
}
- if (latitude != null) {
- _json[r'latitude'] = latitude;
+ if (this.latitude != null) {
+ json[r'latitude'] = this.latitude;
+ } else {
+ json[r'latitude'] = null;
}
- if (longitude != null) {
- _json[r'longitude'] = longitude;
+ if (this.longitude != null) {
+ json[r'longitude'] = this.longitude;
+ } else {
+ json[r'longitude'] = null;
}
- return _json;
+ return json;
}
/// Returns a new [GeoPointDTO] instance and imports its values from
@@ -104,9 +116,9 @@ class GeoPointDTO {
return GeoPointDTO(
id: mapValueOfType(json, r'id'),
- title: TranslationDTO.listFromJson(json[r'title']) ?? const [],
- description: TranslationDTO.listFromJson(json[r'description']) ?? const [],
- images: ImageGeoPoint.listFromJson(json[r'images']) ?? const [],
+ title: TranslationDTO.listFromJson(json[r'title']),
+ description: TranslationDTO.listFromJson(json[r'description']),
+ images: ImageGeoPoint.listFromJson(json[r'images']),
latitude: mapValueOfType(json, r'latitude'),
longitude: mapValueOfType(json, r'longitude'),
);
@@ -114,7 +126,7 @@ class GeoPointDTO {
return null;
}
- static List? listFromJson(dynamic json, {bool growable = false,}) {
+ static List listFromJson(dynamic json, {bool growable = false,}) {
final result = [];
if (json is List && json.isNotEmpty) {
for (final row in json) {
@@ -145,12 +157,10 @@ class GeoPointDTO {
static Map> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = >{};
if (json is Map && json.isNotEmpty) {
- json = json.cast(); // ignore: parameter_assignments
+ // ignore: parameter_assignments
+ json = json.cast();
for (final entry in json.entries) {
- final value = GeoPointDTO.listFromJson(entry.value, growable: growable,);
- if (value != null) {
- map[entry.key] = value;
- }
+ map[entry.key] = GeoPointDTO.listFromJson(entry.value, growable: growable,);
}
}
return map;
diff --git a/manager_api_new/lib/model/image_dto.dart b/manager_api_new/lib/model/image_dto.dart
index b72c787..0a55eed 100644
--- a/manager_api_new/lib/model/image_dto.dart
+++ b/manager_api_new/lib/model/image_dto.dart
@@ -57,23 +57,33 @@ class ImageDTO {
String toString() => 'ImageDTO[title=$title, description=$description, resourceId=$resourceId, source_=$source_, order=$order]';
Map toJson() {
- final _json = {};
- if (title != null) {
- _json[r'title'] = title;
+ final json = {};
+ if (this.title != null) {
+ json[r'title'] = this.title;
+ } else {
+ json[r'title'] = null;
}
- if (description != null) {
- _json[r'description'] = description;
+ if (this.description != null) {
+ json[r'description'] = this.description;
+ } else {
+ json[r'description'] = null;
}
- if (resourceId != null) {
- _json[r'resourceId'] = resourceId;
+ if (this.resourceId != null) {
+ json[r'resourceId'] = this.resourceId;
+ } else {
+ json[r'resourceId'] = null;
}
- if (source_ != null) {
- _json[r'source'] = source_;
+ if (this.source_ != null) {
+ json[r'source'] = this.source_;
+ } else {
+ json[r'source'] = null;
}
- if (order != null) {
- _json[r'order'] = order;
+ if (this.order != null) {
+ json[r'order'] = this.order;
+ } else {
+ json[r'order'] = null;
}
- return _json;
+ return json;
}
/// Returns a new [ImageDTO] instance and imports its values from
@@ -95,8 +105,8 @@ class ImageDTO {
}());
return ImageDTO(
- title: TranslationDTO.listFromJson(json[r'title']) ?? const [],
- description: TranslationDTO.listFromJson(json[r'description']) ?? const [],
+ title: TranslationDTO.listFromJson(json[r'title']),
+ description: TranslationDTO.listFromJson(json[r'description']),
resourceId: mapValueOfType(json, r'resourceId'),
source_: mapValueOfType(json, r'source'),
order: mapValueOfType(json, r'order'),
@@ -105,7 +115,7 @@ class ImageDTO {
return null;
}
- static List? listFromJson(dynamic json, {bool growable = false,}) {
+ static List listFromJson(dynamic json, {bool growable = false,}) {
final result = [];
if (json is List && json.isNotEmpty) {
for (final row in json) {
@@ -136,12 +146,10 @@ class ImageDTO {
static Map> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = >{};
if (json is Map && json.isNotEmpty) {
- json = json.cast(); // ignore: parameter_assignments
+ // ignore: parameter_assignments
+ json = json.cast();
for (final entry in json.entries) {
- final value = ImageDTO.listFromJson(entry.value, growable: growable,);
- if (value != null) {
- map[entry.key] = value;
- }
+ map[entry.key] = ImageDTO.listFromJson(entry.value, growable: growable,);
}
}
return map;
diff --git a/manager_api_new/lib/model/image_geo_point.dart b/manager_api_new/lib/model/image_geo_point.dart
index 8291c85..4ecb68c 100644
--- a/manager_api_new/lib/model/image_geo_point.dart
+++ b/manager_api_new/lib/model/image_geo_point.dart
@@ -36,14 +36,18 @@ class ImageGeoPoint {
String toString() => 'ImageGeoPoint[imageResourceId=$imageResourceId, imageSource=$imageSource]';
Map toJson() {
- final _json = {};
- if (imageResourceId != null) {
- _json[r'imageResourceId'] = imageResourceId;
+ final json = {};
+ if (this.imageResourceId != null) {
+ json[r'imageResourceId'] = this.imageResourceId;
+ } else {
+ json[r'imageResourceId'] = null;
}
- if (imageSource != null) {
- _json[r'imageSource'] = imageSource;
+ if (this.imageSource != null) {
+ json[r'imageSource'] = this.imageSource;
+ } else {
+ json[r'imageSource'] = null;
}
- return _json;
+ return json;
}
/// Returns a new [ImageGeoPoint] instance and imports its values from
@@ -72,7 +76,7 @@ class ImageGeoPoint {
return null;
}
- static List? listFromJson(dynamic json, {bool growable = false,}) {
+ static List listFromJson(dynamic json, {bool growable = false,}) {
final result = [];
if (json is List && json.isNotEmpty) {
for (final row in json) {
@@ -103,12 +107,10 @@ class ImageGeoPoint {
static Map> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = >{};
if (json is Map && json.isNotEmpty) {
- json = json.cast(); // ignore: parameter_assignments
+ // ignore: parameter_assignments
+ json = json.cast();
for (final entry in json.entries) {
- final value = ImageGeoPoint.listFromJson(entry.value, growable: growable,);
- if (value != null) {
- map[entry.key] = value;
- }
+ map[entry.key] = ImageGeoPoint.listFromJson(entry.value, growable: growable,);
}
}
return map;
diff --git a/manager_api_new/lib/model/instance.dart b/manager_api_new/lib/model/instance.dart
index 74e7ca8..01261b9 100644
--- a/manager_api_new/lib/model/instance.dart
+++ b/manager_api_new/lib/model/instance.dart
@@ -47,17 +47,23 @@ class Instance {
String toString() => 'Instance[id=$id, name=$name, dateCreation=$dateCreation]';
Map toJson() {
- final _json = {};
- if (id != null) {
- _json[r'id'] = id;
+ final json = {};
+ if (this.id != null) {
+ json[r'id'] = this.id;
+ } else {
+ json[r'id'] = null;
}
- if (name != null) {
- _json[r'name'] = name;
+ if (this.name != null) {
+ json[r'name'] = this.name;
+ } else {
+ json[r'name'] = null;
}
- if (dateCreation != null) {
- _json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String();
+ if (this.dateCreation != null) {
+ json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
+ } else {
+ json[r'dateCreation'] = null;
}
- return _json;
+ return json;
}
/// Returns a new [Instance] instance and imports its values from
@@ -87,7 +93,7 @@ class Instance {
return null;
}
- static List? listFromJson(dynamic json, {bool growable = false,}) {
+ static List listFromJson(dynamic json, {bool growable = false,}) {
final result = [];
if (json is List && json.isNotEmpty) {
for (final row in json) {
@@ -118,12 +124,10 @@ class Instance {
static Map> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = >{};
if (json is Map && json.isNotEmpty) {
- json = json.cast(); // ignore: parameter_assignments
+ // ignore: parameter_assignments
+ json = json.cast();
for (final entry in json.entries) {
- final value = Instance.listFromJson(entry.value, growable: growable,);
- if (value != null) {
- map[entry.key] = value;
- }
+ map[entry.key] = Instance.listFromJson(entry.value, growable: growable,);
}
}
return map;
diff --git a/manager_api_new/lib/model/instance_dto.dart b/manager_api_new/lib/model/instance_dto.dart
index a1d77a7..fda91b1 100644
--- a/manager_api_new/lib/model/instance_dto.dart
+++ b/manager_api_new/lib/model/instance_dto.dart
@@ -47,17 +47,23 @@ class InstanceDTO {
String toString() => 'InstanceDTO[id=$id, name=$name, dateCreation=$dateCreation]';
Map toJson() {
- final _json = {};
- if (id != null) {
- _json[r'id'] = id;
+ final json = {};
+ if (this.id != null) {
+ json[r'id'] = this.id;
+ } else {
+ json[r'id'] = null;
}
- if (name != null) {
- _json[r'name'] = name;
+ if (this.name != null) {
+ json[r'name'] = this.name;
+ } else {
+ json[r'name'] = null;
}
- if (dateCreation != null) {
- _json[r'dateCreation'] = dateCreation!.toUtc().toIso8601String();
+ if (this.dateCreation != null) {
+ json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String();
+ } else {
+ json[r'dateCreation'] = null;
}
- return _json;
+ return json;
}
/// Returns a new [InstanceDTO] instance and imports its values from
@@ -87,7 +93,7 @@ class InstanceDTO {
return null;
}
- static List? listFromJson(dynamic json, {bool growable = false,}) {
+ static List listFromJson(dynamic json, {bool growable = false,}) {
final result = [];
if (json is List && json.isNotEmpty) {
for (final row in json) {
@@ -118,12 +124,10 @@ class InstanceDTO {
static Map> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = >{};
if (json is Map && json.isNotEmpty) {
- json = json.cast(); // ignore: parameter_assignments
+ // ignore: parameter_assignments
+ json = json.cast();
for (final entry in json.entries) {
- final value = InstanceDTO.listFromJson(entry.value, growable: growable,);
- if (value != null) {
- map[entry.key] = value;
- }
+ map[entry.key] = InstanceDTO.listFromJson(entry.value, growable: growable,);
}
}
return map;
diff --git a/manager_api_new/lib/model/level_dto.dart b/manager_api_new/lib/model/level_dto.dart
index 58cfe04..3332644 100644
--- a/manager_api_new/lib/model/level_dto.dart
+++ b/manager_api_new/lib/model/level_dto.dart
@@ -41,17 +41,23 @@ class LevelDTO {
String toString() => 'LevelDTO[label=$label, resourceId=$resourceId, source_=$source_]';
Map toJson() {
- final _json = {};
- if (label != null) {
- _json[r'label'] = label;
+ final json = {};
+ if (this.label != null) {
+ json[r'label'] = this.label;
+ } else {
+ json[r'label'] = null;
}
- if (resourceId != null) {
- _json[r'resourceId'] = resourceId;
+ if (this.resourceId != null) {
+ json[r'resourceId'] = this.resourceId;
+ } else {
+ json[r'resourceId'] = null;
}
- if (source_ != null) {
- _json[r'source'] = source_;
+ if (this.source_ != null) {
+ json[r'source'] = this.source_;
+ } else {
+ json[r'source'] = null;
}
- return _json;
+ return json;
}
/// Returns a new [LevelDTO] instance and imports its values from
@@ -73,7 +79,7 @@ class LevelDTO {
}());
return LevelDTO(
- label: TranslationDTO.listFromJson(json[r'label']) ?? const [],
+ label: TranslationDTO.listFromJson(json[r'label']),
resourceId: mapValueOfType(json, r'resourceId'),
source_: mapValueOfType(json, r'source'),
);
@@ -81,7 +87,7 @@ class LevelDTO {
return null;
}
- static List? listFromJson(dynamic json, {bool growable = false,}) {
+ static List listFromJson(dynamic json, {bool growable = false,}) {
final result = [];
if (json is List && json.isNotEmpty) {
for (final row in json) {
@@ -112,12 +118,10 @@ class LevelDTO {
static Map> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = >{};
if (json is Map && json.isNotEmpty) {
- json = json.cast(); // ignore: parameter_assignments
+ // ignore: parameter_assignments
+ json = json.cast();
for (final entry in json.entries) {
- final value = LevelDTO.listFromJson(entry.value, growable: growable,);
- if (value != null) {
- map[entry.key] = value;
- }
+ map[entry.key] = LevelDTO.listFromJson(entry.value, growable: growable,);
}
}
return map;
diff --git a/manager_api_new/lib/model/login_dto.dart b/manager_api_new/lib/model/login_dto.dart
index e5543ec..a8e6b90 100644
--- a/manager_api_new/lib/model/login_dto.dart
+++ b/manager_api_new/lib/model/login_dto.dart
@@ -36,14 +36,18 @@ class LoginDTO {
String toString() => 'LoginDTO[email=$email, password=$password]';
Map toJson() {
- final _json = {};
- if (email != null) {
- _json[r'email'] = email;
+ final json = {};
+ if (this.email != null) {
+ json[r'email'] = this.email;
+ } else {
+ json[r'email'] = null;
}
- if (password != null) {
- _json[r'password'] = password;
+ if (this.password != null) {
+ json[r'password'] = this.password;
+ } else {
+ json[r'password'] = null;
}
- return _json;
+ return json;
}
/// Returns a new [LoginDTO] instance and imports its values from
@@ -72,7 +76,7 @@ class LoginDTO {
return null;
}
- static List? listFromJson(dynamic json, {bool growable = false,}) {
+ static List listFromJson(dynamic json, {bool growable = false,}) {
final result = [];
if (json is List && json.isNotEmpty) {
for (final row in json) {
@@ -103,12 +107,10 @@ class LoginDTO {
static Map> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = >{};
if (json is Map && json.isNotEmpty) {
- json = json.cast(); // ignore: parameter_assignments
+ // ignore: parameter_assignments
+ json = json.cast();
for (final entry in json.entries) {
- final value = LoginDTO.listFromJson(entry.value, growable: growable,);
- if (value != null) {
- map[entry.key] = value;
- }
+ map[entry.key] = LoginDTO.listFromJson(entry.value, growable: growable,);
}
}
return map;
diff --git a/manager_api_new/lib/model/map_dto.dart b/manager_api_new/lib/model/map_dto.dart
index 8a283e6..b193330 100644
--- a/manager_api_new/lib/model/map_dto.dart
+++ b/manager_api_new/lib/model/map_dto.dart
@@ -63,23 +63,33 @@ class MapDTO {
String toString() => 'MapDTO[zoom=$zoom, mapType=$mapType, points=$points, iconResourceId=$iconResourceId, iconSource=$iconSource]';
Map toJson() {
- final _json = {};
- if (zoom != null) {
- _json[r'zoom'] = zoom;
+ final json = {};
+ if (this.zoom != null) {
+ json[r'zoom'] = this.zoom;
+ } else {
+ json[r'zoom'] = null;
}
- if (mapType != null) {
- _json[r'mapType'] = mapType;
+ if (this.mapType != null) {
+ json[r'mapType'] = this.mapType;
+ } else {
+ json[r'mapType'] = null;
}
- if (points != null) {
- _json[r'points'] = points;
+ if (this.points != null) {
+ json[r'points'] = this.points;
+ } else {
+ json[r'points'] = null;
}
- if (iconResourceId != null) {
- _json[r'iconResourceId'] = iconResourceId;
+ if (this.iconResourceId != null) {
+ json[r'iconResourceId'] = this.iconResourceId;
+ } else {
+ json[r'iconResourceId'] = null;
}
- if (iconSource != null) {
- _json[r'iconSource'] = iconSource;
+ if (this.iconSource != null) {
+ json[r'iconSource'] = this.iconSource;
+ } else {
+ json[r'iconSource'] = null;
}
- return _json;
+ return json;
}
/// Returns a new [MapDTO] instance and imports its values from
@@ -103,7 +113,7 @@ class MapDTO {
return MapDTO(
zoom: mapValueOfType(json, r'zoom'),
mapType: MapTypeApp.fromJson(json[r'mapType']),
- points: GeoPointDTO.listFromJson(json[r'points']) ?? const [],
+ points: GeoPointDTO.listFromJson(json[r'points']),
iconResourceId: mapValueOfType(json, r'iconResourceId'),
iconSource: mapValueOfType(json, r'iconSource'),
);
@@ -111,7 +121,7 @@ class MapDTO {
return null;
}
- static List? listFromJson(dynamic json, {bool growable = false,}) {
+ static List listFromJson(dynamic json, {bool growable = false,}) {
final result = [];
if (json is List && json.isNotEmpty) {
for (final row in json) {
@@ -142,12 +152,10 @@ class MapDTO {
static Map> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = >{};
if (json is Map && json.isNotEmpty) {
- json = json.cast(); // ignore: parameter_assignments
+ // ignore: parameter_assignments
+ json = json.cast();
for (final entry in json.entries) {
- final value = MapDTO.listFromJson(entry.value, growable: growable,);
- if (value != null) {
- map[entry.key] = value;
- }
+ map[entry.key] = MapDTO.listFromJson(entry.value, growable: growable,);
}
}
return map;
diff --git a/manager_api_new/lib/model/menu_dto.dart b/manager_api_new/lib/model/menu_dto.dart
index feb29a8..0f47549 100644
--- a/manager_api_new/lib/model/menu_dto.dart
+++ b/manager_api_new/lib/model/menu_dto.dart
@@ -31,11 +31,13 @@ class MenuDTO {
String toString() => 'MenuDTO[sections=$sections]';
Map toJson() {
- final _json = {};
- if (sections != null) {
- _json[r'sections'] = sections;
+ final json = {};
+ if (this.sections != null) {
+ json[r'sections'] = this.sections;
+ } else {
+ json[r'sections'] = null;
}
- return _json;
+ return json;
}
/// Returns a new [MenuDTO] instance and imports its values from
@@ -57,13 +59,13 @@ class MenuDTO {
}());
return MenuDTO(
- sections: SectionDTO.listFromJson(json[r'sections']) ?? const [],
+ sections: SectionDTO.listFromJson(json[r'sections']),
);
}
return null;
}
- static List? listFromJson(dynamic json, {bool growable = false,}) {
+ static List listFromJson(dynamic json, {bool growable = false,}) {
final result = [];
if (json is List && json.isNotEmpty) {
for (final row in json) {
@@ -94,12 +96,10 @@ class MenuDTO {
static Map> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = >{};
if (json is Map && json.isNotEmpty) {
- json = json.cast(); // ignore: parameter_assignments
+ // ignore: parameter_assignments
+ json = json.cast();
for (final entry in json.entries) {
- final value = MenuDTO.listFromJson(entry.value, growable: growable,);
- if (value != null) {
- map[entry.key] = value;
- }
+ map[entry.key] = MenuDTO.listFromJson(entry.value, growable: growable,);
}
}
return map;
diff --git a/manager_api_new/lib/model/player_message_dto.dart b/manager_api_new/lib/model/player_message_dto.dart
index c51ce09..9e67106 100644
--- a/manager_api_new/lib/model/player_message_dto.dart
+++ b/manager_api_new/lib/model/player_message_dto.dart
@@ -48,14 +48,18 @@ class PlayerMessageDTO {
String toString() => 'PlayerMessageDTO[configChanged=$configChanged, isDeleted=$isDeleted]';
Map toJson() {
- final _json = {};
- if (configChanged != null) {
- _json[r'configChanged'] = configChanged;
+ final json = {};
+ if (this.configChanged != null) {
+ json[r'configChanged'] = this.configChanged;
+ } else {
+ json[r'configChanged'] = null;
}
- if (isDeleted != null) {
- _json[r'isDeleted'] = isDeleted;
+ if (this.isDeleted != null) {
+ json[r'isDeleted'] = this.isDeleted;
+ } else {
+ json[r'isDeleted'] = null;
}
- return _json;
+ return json;
}
/// Returns a new [PlayerMessageDTO] instance and imports its values from
@@ -84,7 +88,7 @@ class PlayerMessageDTO {
return null;
}
- static List? listFromJson(dynamic json, {bool growable = false,}) {
+ static List listFromJson(dynamic json, {bool growable = false,}) {
final result = [];
if (json is List && json.isNotEmpty) {
for (final row in json) {
@@ -115,12 +119,10 @@ class PlayerMessageDTO {
static Map> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = >{};
if (json is Map && json.isNotEmpty) {
- json = json.cast(); // ignore: parameter_assignments
+ // ignore: parameter_assignments
+ json = json.cast();
for (final entry in json.entries) {
- final value = PlayerMessageDTO.listFromJson(entry.value, growable: growable,);
- if (value != null) {
- map[entry.key] = value;
- }
+ map[entry.key] = PlayerMessageDTO.listFromJson(entry.value, growable: growable,);
}
}
return map;
diff --git a/manager_api_new/lib/model/question_dto.dart b/manager_api_new/lib/model/question_dto.dart
index 0e7f86b..9d52588 100644
--- a/manager_api_new/lib/model/question_dto.dart
+++ b/manager_api_new/lib/model/question_dto.dart
@@ -57,23 +57,33 @@ class QuestionDTO {
String toString() => 'QuestionDTO[label=$label, responses=$responses, resourceId=$resourceId, source_=$source_, order=$order]';
Map toJson() {
- final _json = {};
- if (label != null) {
- _json[r'label'] = label;
+ final json = {};
+ if (this.label != null) {
+ json[r'label'] = this.label;
+ } else {
+ json[r'label'] = null;
}
- if (responses != null) {
- _json[r'responses'] = responses;
+ if (this.responses != null) {
+ json[r'responses'] = this.responses;
+ } else {
+ json[r'responses'] = null;
}
- if (resourceId != null) {
- _json[r'resourceId'] = resourceId;
+ if (this.resourceId != null) {
+ json[r'resourceId'] = this.resourceId;
+ } else {
+ json[r'resourceId'] = null;
}
- if (source_ != null) {
- _json[r'source'] = source_;
+ if (this.source_ != null) {
+ json[r'source'] = this.source_;
+ } else {
+ json[r'source'] = null;
}
- if (order != null) {
- _json[r'order'] = order;
+ if (this.order != null) {
+ json[r'order'] = this.order;
+ } else {
+ json[r'order'] = null;
}
- return _json;
+ return json;
}
/// Returns a new [QuestionDTO] instance and imports its values from
@@ -95,8 +105,8 @@ class QuestionDTO {
}());
return QuestionDTO(
- label: TranslationDTO.listFromJson(json[r'label']) ?? const [],
- responses: ResponseDTO.listFromJson(json[r'responses']) ?? const [],
+ label: TranslationDTO.listFromJson(json[r'label']),
+ responses: ResponseDTO.listFromJson(json[r'responses']),
resourceId: mapValueOfType(json, r'resourceId'),
source_: mapValueOfType(json, r'source'),
order: mapValueOfType(json, r'order'),
@@ -105,7 +115,7 @@ class QuestionDTO {
return null;
}
- static List? listFromJson(dynamic json, {bool growable = false,}) {
+ static List listFromJson(dynamic json, {bool growable = false,}) {
final result = [];
if (json is List && json.isNotEmpty) {
for (final row in json) {
@@ -136,12 +146,10 @@ class QuestionDTO {
static Map> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = >{};
if (json is Map && json.isNotEmpty) {
- json = json.cast(); // ignore: parameter_assignments
+ // ignore: parameter_assignments
+ json = json.cast();
for (final entry in json.entries) {
- final value = QuestionDTO.listFromJson(entry.value, growable: growable,);
- if (value != null) {
- map[entry.key] = value;
- }
+ map[entry.key] = QuestionDTO.listFromJson(entry.value, growable: growable,);
}
}
return map;
diff --git a/manager_api_new/lib/model/quizz_dto.dart b/manager_api_new/lib/model/quizz_dto.dart
index e9e8ded..cf3c308 100644
--- a/manager_api_new/lib/model/quizz_dto.dart
+++ b/manager_api_new/lib/model/quizz_dto.dart
@@ -51,23 +51,33 @@ class QuizzDTO {
String toString() => 'QuizzDTO[questions=$questions, badLevel=$badLevel, mediumLevel=$mediumLevel, goodLevel=$goodLevel, greatLevel=$greatLevel]';
Map toJson() {
- final _json = {};
- if (questions != null) {
- _json[r'questions'] = questions;
+ final json = {};
+ if (this.questions != null) {
+ json[r'questions'] = this.questions;
+ } else {
+ json[r'questions'] = null;
}
- if (badLevel != null) {
- _json[r'bad_level'] = badLevel;
+ if (this.badLevel != null) {
+ json[r'bad_level'] = this.badLevel;
+ } else {
+ json[r'bad_level'] = null;
}
- if (mediumLevel != null) {
- _json[r'medium_level'] = mediumLevel;
+ if (this.mediumLevel != null) {
+ json[r'medium_level'] = this.mediumLevel;
+ } else {
+ json[r'medium_level'] = null;
}
- if (goodLevel != null) {
- _json[r'good_level'] = goodLevel;
+ if (this.goodLevel != null) {
+ json[r'good_level'] = this.goodLevel;
+ } else {
+ json[r'good_level'] = null;
}
- if (greatLevel != null) {
- _json[r'great_level'] = greatLevel;
+ if (this.greatLevel != null) {
+ json[r'great_level'] = this.greatLevel;
+ } else {
+ json[r'great_level'] = null;
}
- return _json;
+ return json;
}
/// Returns a new [QuizzDTO] instance and imports its values from
@@ -99,7 +109,7 @@ class QuizzDTO {
return null;
}
- static List? listFromJson(dynamic json, {bool growable = false,}) {
+ static List listFromJson(dynamic json, {bool growable = false,}) {
final result =