Update api generation client code + update local db + update layout (just configuration title)
This commit is contained in:
parent
059728cb1c
commit
da2690cb65
@ -1 +1 @@
|
|||||||
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"qr_code_scanner","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\qr_code_scanner-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"qr_code_scanner","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\qr_code_scanner-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"qr_code_scanner","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2022-09-15 16:28:18.459550","version":"3.0.3"}
|
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"qr_code_scanner","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\qr_code_scanner-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"android":[{"name":"qr_code_scanner","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\qr_code_scanner-1.0.1\\\\","native_build":true,"dependencies":[]},{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"macos":[{"name":"sqflite","path":"C:\\\\Users\\\\thoma\\\\AppData\\\\Local\\\\Pub\\\\Cache\\\\hosted\\\\pub.dartlang.org\\\\sqflite-2.0.3+1\\\\","native_build":true,"dependencies":[]}],"linux":[],"windows":[],"web":[]},"dependencyGraph":[{"name":"qr_code_scanner","dependencies":[]},{"name":"sqflite","dependencies":[]}],"date_created":"2022-09-17 22:40:40.100790","version":"3.0.3"}
|
||||||
@ -17,6 +17,10 @@ This README would normally document whatever steps are necessary to get your app
|
|||||||
* How to run tests
|
* How to run tests
|
||||||
* Deployment instructions
|
* Deployment instructions
|
||||||
|
|
||||||
|
OPENAPI Generation cmd
|
||||||
|
|
||||||
|
flutter pub run build_runner build --delete-conflicting-outputs
|
||||||
|
|
||||||
### Contribution guidelines ###
|
### Contribution guidelines ###
|
||||||
|
|
||||||
* Writing tests
|
* Writing tests
|
||||||
|
|||||||
@ -71,6 +71,9 @@ class DatabaseHelper {
|
|||||||
CREATE TABLE $configurationsTable (
|
CREATE TABLE $configurationsTable (
|
||||||
$columnId TEXT NOT NULL PRIMARY KEY,
|
$columnId TEXT NOT NULL PRIMARY KEY,
|
||||||
$columnLabel TEXT NOT NULL,
|
$columnLabel TEXT NOT NULL,
|
||||||
|
$columnTitle TEXT NOT NULL,
|
||||||
|
$columnImageId TEXT,
|
||||||
|
$columnImageSource TEXT,
|
||||||
$columnLanguages TEXT NOT NULL,
|
$columnLanguages TEXT NOT NULL,
|
||||||
$columnDateCreation TEXT NOT NULL,
|
$columnDateCreation TEXT NOT NULL,
|
||||||
$columnPrimaryColor TEXT,
|
$columnPrimaryColor TEXT,
|
||||||
@ -235,9 +238,13 @@ class DatabaseHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ConfigurationDTO getConfigurationFromDB(dynamic element) {
|
ConfigurationDTO getConfigurationFromDB(dynamic element) {
|
||||||
|
var titles = List<TranslationDTO>.from(json.decode(element['title']).map<dynamic>((q) => TranslationDTO.fromJson(q)).toList());
|
||||||
return ConfigurationDTO(
|
return ConfigurationDTO(
|
||||||
id: element["id"],
|
id: element["id"],
|
||||||
label: element["label"],
|
label: element["label"],
|
||||||
|
title: titles,
|
||||||
|
imageId: element["imageId"],
|
||||||
|
imageSource: element["imageSource"],
|
||||||
primaryColor: element["primaryColor"],
|
primaryColor: element["primaryColor"],
|
||||||
secondaryColor: element["secondaryColor"],
|
secondaryColor: element["secondaryColor"],
|
||||||
languages: List<String>.from(jsonDecode(element["languages"])),
|
languages: List<String>.from(jsonDecode(element["languages"])),
|
||||||
|
|||||||
@ -97,7 +97,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(top: 20, left: 10),
|
padding: const EdgeInsets.only(top: 20, left: 10),
|
||||||
child: AutoSizeText(
|
child: AutoSizeText(
|
||||||
configurations[index].label!,
|
TranslationHelper.get(configurations[index].title, appContext),
|
||||||
style: const TextStyle(fontSize: kMenuTitleDetailSize),
|
style: const TextStyle(fontSize: kMenuTitleDetailSize),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
),
|
),
|
||||||
@ -119,6 +119,7 @@ class _HomePageState extends State<HomePage> {
|
|||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
downloadClicked(appContext, configurations[index]);
|
downloadClicked(appContext, configurations[index]);
|
||||||
|
setState(() {}); // Force refresh
|
||||||
},
|
},
|
||||||
child: configurations[index].isOffline! && !alreadyDownloaded.any((c) => c == configurations[index].id) ?
|
child: configurations[index].isOffline! && !alreadyDownloaded.any((c) => c == configurations[index].id) ?
|
||||||
const Icon(Icons.download, color: Colors.white) : const Icon(Icons.refresh, color: Colors.white),
|
const Icon(Icons.download, color: Colors.white) : const Icon(Icons.refresh, color: Colors.white),
|
||||||
@ -232,7 +233,12 @@ class _HomePageState extends State<HomePage> {
|
|||||||
// Display config only downloaded - TODO
|
// Display config only downloaded - TODO
|
||||||
|
|
||||||
// Update local DB - Configuration
|
// Update local DB - Configuration
|
||||||
await DatabaseHelper.instance.insert(DatabaseTableType.configurations, configuration.toJson());
|
await DatabaseHelper.instance.insert(DatabaseTableType.configurations, configurationToMap(configuration));
|
||||||
|
|
||||||
|
if(configuration.imageId != null) {
|
||||||
|
ImageDTO image = ImageDTO(resourceId: configuration.imageId, source_: configuration.imageSource);
|
||||||
|
await getAndDownloadImage(appContext.clientAPI, image);
|
||||||
|
}
|
||||||
|
|
||||||
List<SectionDTO>? sections = await getAllSections(appContext.clientAPI, configuration.id!);
|
List<SectionDTO>? sections = await getAllSections(appContext.clientAPI, configuration.id!);
|
||||||
|
|
||||||
@ -258,6 +264,23 @@ class _HomePageState extends State<HomePage> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> configurationToMap(ConfigurationDTO configuration) {
|
||||||
|
return {
|
||||||
|
'id': configuration.id,
|
||||||
|
'label': configuration.label,
|
||||||
|
'title': jsonEncode(configuration.title),
|
||||||
|
'imageId': configuration.imageId,
|
||||||
|
'imageSource': configuration.imageSource,
|
||||||
|
'primaryColor': configuration.primaryColor,
|
||||||
|
'secondaryColor': configuration.secondaryColor,
|
||||||
|
'languages': configuration.languages,
|
||||||
|
'dateCreation': configuration.dateCreation!.toUtc().toIso8601String(),
|
||||||
|
'isMobile': configuration.isMobile,
|
||||||
|
'isTablet': configuration.isTablet,
|
||||||
|
'isOffline': configuration.isOffline
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
Map<String, dynamic> sectionToMap(SectionDTO section) {
|
Map<String, dynamic> sectionToMap(SectionDTO section) {
|
||||||
return {
|
return {
|
||||||
'id': section.id,
|
'id': section.id,
|
||||||
|
|||||||
@ -1404,6 +1404,17 @@ components:
|
|||||||
label:
|
label:
|
||||||
type: string
|
type: string
|
||||||
nullable: true
|
nullable: true
|
||||||
|
title:
|
||||||
|
type: array
|
||||||
|
nullable: true
|
||||||
|
items:
|
||||||
|
$ref: '#/components/schemas/TranslationDTO'
|
||||||
|
imageId:
|
||||||
|
type: string
|
||||||
|
nullable: true
|
||||||
|
imageSource:
|
||||||
|
type: string
|
||||||
|
nullable: true
|
||||||
primaryColor:
|
primaryColor:
|
||||||
type: string
|
type: string
|
||||||
nullable: true
|
nullable: true
|
||||||
@ -1424,6 +1435,16 @@ components:
|
|||||||
type: boolean
|
type: boolean
|
||||||
isOffline:
|
isOffline:
|
||||||
type: boolean
|
type: boolean
|
||||||
|
TranslationDTO:
|
||||||
|
type: object
|
||||||
|
additionalProperties: false
|
||||||
|
properties:
|
||||||
|
language:
|
||||||
|
type: string
|
||||||
|
nullable: true
|
||||||
|
value:
|
||||||
|
type: string
|
||||||
|
nullable: true
|
||||||
ExportConfigurationDTO:
|
ExportConfigurationDTO:
|
||||||
allOf:
|
allOf:
|
||||||
- $ref: '#/components/schemas/ConfigurationDTO'
|
- $ref: '#/components/schemas/ConfigurationDTO'
|
||||||
@ -1485,26 +1506,9 @@ components:
|
|||||||
order:
|
order:
|
||||||
type: integer
|
type: integer
|
||||||
format: int32
|
format: int32
|
||||||
TranslationDTO:
|
|
||||||
type: object
|
|
||||||
additionalProperties: false
|
|
||||||
properties:
|
|
||||||
language:
|
|
||||||
type: string
|
|
||||||
nullable: true
|
|
||||||
value:
|
|
||||||
type: string
|
|
||||||
nullable: true
|
|
||||||
SectionType:
|
SectionType:
|
||||||
type: integer
|
type: string
|
||||||
description: |-
|
description: ''
|
||||||
0 = Map
|
|
||||||
1 = Slider
|
|
||||||
2 = Video
|
|
||||||
3 = Web
|
|
||||||
4 = Menu
|
|
||||||
5 = Quizz
|
|
||||||
6 = Article
|
|
||||||
x-enumNames:
|
x-enumNames:
|
||||||
- Map
|
- Map
|
||||||
- Slider
|
- Slider
|
||||||
@ -1514,13 +1518,13 @@ components:
|
|||||||
- Quizz
|
- Quizz
|
||||||
- Article
|
- Article
|
||||||
enum:
|
enum:
|
||||||
- 0
|
- Map
|
||||||
- 1
|
- Slider
|
||||||
- 2
|
- Video
|
||||||
- 3
|
- Web
|
||||||
- 4
|
- Menu
|
||||||
- 5
|
- Quizz
|
||||||
- 6
|
- Article
|
||||||
ResourceDTO:
|
ResourceDTO:
|
||||||
type: object
|
type: object
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
@ -1540,22 +1544,18 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
nullable: true
|
nullable: true
|
||||||
ResourceType:
|
ResourceType:
|
||||||
type: integer
|
type: string
|
||||||
description: |-
|
description: ''
|
||||||
0 = Image
|
|
||||||
1 = Video
|
|
||||||
2 = ImageUrl
|
|
||||||
3 = VideoUrl
|
|
||||||
x-enumNames:
|
x-enumNames:
|
||||||
- Image
|
- Image
|
||||||
- Video
|
- Video
|
||||||
- ImageUrl
|
- ImageUrl
|
||||||
- VideoUrl
|
- VideoUrl
|
||||||
enum:
|
enum:
|
||||||
- 0
|
- Image
|
||||||
- 1
|
- Video
|
||||||
- 2
|
- ImageUrl
|
||||||
- 3
|
- VideoUrl
|
||||||
DeviceDTO:
|
DeviceDTO:
|
||||||
type: object
|
type: object
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
@ -1628,13 +1628,8 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
nullable: true
|
nullable: true
|
||||||
MapTypeApp:
|
MapTypeApp:
|
||||||
type: integer
|
type: string
|
||||||
description: |-
|
description: ''
|
||||||
0 = none
|
|
||||||
1 = normal
|
|
||||||
2 = satellite
|
|
||||||
3 = terrain
|
|
||||||
4 = hybrid
|
|
||||||
x-enumNames:
|
x-enumNames:
|
||||||
- none
|
- none
|
||||||
- normal
|
- normal
|
||||||
@ -1642,11 +1637,11 @@ components:
|
|||||||
- terrain
|
- terrain
|
||||||
- hybrid
|
- hybrid
|
||||||
enum:
|
enum:
|
||||||
- 0
|
- none
|
||||||
- 1
|
- normal
|
||||||
- 2
|
- satellite
|
||||||
- 3
|
- terrain
|
||||||
- 4
|
- hybrid
|
||||||
GeoPointDTO:
|
GeoPointDTO:
|
||||||
type: object
|
type: object
|
||||||
additionalProperties: false
|
additionalProperties: false
|
||||||
|
|||||||
1949
lib/api/swagger.yaml.bak1
Normal file
1949
lib/api/swagger.yaml.bak1
Normal file
File diff suppressed because it is too large
Load Diff
@ -87,40 +87,3 @@ lib/model/user_detail_dto.dart
|
|||||||
lib/model/video_dto.dart
|
lib/model/video_dto.dart
|
||||||
lib/model/web_dto.dart
|
lib/model/web_dto.dart
|
||||||
pubspec.yaml
|
pubspec.yaml
|
||||||
test/article_dto_test.dart
|
|
||||||
test/authentication_api_test.dart
|
|
||||||
test/configuration_api_test.dart
|
|
||||||
test/configuration_dto_test.dart
|
|
||||||
test/device_api_test.dart
|
|
||||||
test/device_detail_dto_all_of_test.dart
|
|
||||||
test/device_detail_dto_test.dart
|
|
||||||
test/device_dto_test.dart
|
|
||||||
test/export_configuration_dto_all_of_test.dart
|
|
||||||
test/export_configuration_dto_test.dart
|
|
||||||
test/geo_point_dto_test.dart
|
|
||||||
test/image_dto_test.dart
|
|
||||||
test/image_geo_point_test.dart
|
|
||||||
test/level_dto_test.dart
|
|
||||||
test/login_dto_test.dart
|
|
||||||
test/map_dto_test.dart
|
|
||||||
test/map_type_app_test.dart
|
|
||||||
test/menu_dto_test.dart
|
|
||||||
test/player_message_dto_test.dart
|
|
||||||
test/question_dto_test.dart
|
|
||||||
test/quizz_dto_bad_level_test.dart
|
|
||||||
test/quizz_dto_test.dart
|
|
||||||
test/resource_api_test.dart
|
|
||||||
test/resource_dto_test.dart
|
|
||||||
test/resource_type_test.dart
|
|
||||||
test/response_dto_test.dart
|
|
||||||
test/section_api_test.dart
|
|
||||||
test/section_dto_test.dart
|
|
||||||
test/section_type_test.dart
|
|
||||||
test/slider_dto_test.dart
|
|
||||||
test/token_dto_test.dart
|
|
||||||
test/translation_dto_test.dart
|
|
||||||
test/user_api_test.dart
|
|
||||||
test/user_detail_dto_test.dart
|
|
||||||
test/user_test.dart
|
|
||||||
test/video_dto_test.dart
|
|
||||||
test/web_dto_test.dart
|
|
||||||
|
|||||||
@ -10,6 +10,9 @@ Name | Type | Description | Notes
|
|||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**id** | **String** | | [optional]
|
**id** | **String** | | [optional]
|
||||||
**label** | **String** | | [optional]
|
**label** | **String** | | [optional]
|
||||||
|
**title** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
|
||||||
|
**imageId** | **String** | | [optional]
|
||||||
|
**imageSource** | **String** | | [optional]
|
||||||
**primaryColor** | **String** | | [optional]
|
**primaryColor** | **String** | | [optional]
|
||||||
**secondaryColor** | **String** | | [optional]
|
**secondaryColor** | **String** | | [optional]
|
||||||
**languages** | **List<String>** | | [optional] [default to const []]
|
**languages** | **List<String>** | | [optional] [default to const []]
|
||||||
|
|||||||
@ -10,6 +10,9 @@ Name | Type | Description | Notes
|
|||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
**id** | **String** | | [optional]
|
**id** | **String** | | [optional]
|
||||||
**label** | **String** | | [optional]
|
**label** | **String** | | [optional]
|
||||||
|
**title** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
|
||||||
|
**imageId** | **String** | | [optional]
|
||||||
|
**imageSource** | **String** | | [optional]
|
||||||
**primaryColor** | **String** | | [optional]
|
**primaryColor** | **String** | | [optional]
|
||||||
**secondaryColor** | **String** | | [optional]
|
**secondaryColor** | **String** | | [optional]
|
||||||
**languages** | **List<String>** | | [optional] [default to const []]
|
**languages** | **List<String>** | | [optional] [default to const []]
|
||||||
|
|||||||
@ -15,6 +15,9 @@ class ConfigurationDTO {
|
|||||||
ConfigurationDTO({
|
ConfigurationDTO({
|
||||||
this.id,
|
this.id,
|
||||||
this.label,
|
this.label,
|
||||||
|
this.title = const [],
|
||||||
|
this.imageId,
|
||||||
|
this.imageSource,
|
||||||
this.primaryColor,
|
this.primaryColor,
|
||||||
this.secondaryColor,
|
this.secondaryColor,
|
||||||
this.languages = const [],
|
this.languages = const [],
|
||||||
@ -28,6 +31,12 @@ class ConfigurationDTO {
|
|||||||
|
|
||||||
String? label;
|
String? label;
|
||||||
|
|
||||||
|
List<TranslationDTO>? title;
|
||||||
|
|
||||||
|
String? imageId;
|
||||||
|
|
||||||
|
String? imageSource;
|
||||||
|
|
||||||
String? primaryColor;
|
String? primaryColor;
|
||||||
|
|
||||||
String? secondaryColor;
|
String? secondaryColor;
|
||||||
@ -70,6 +79,9 @@ class ConfigurationDTO {
|
|||||||
bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO &&
|
bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO &&
|
||||||
other.id == id &&
|
other.id == id &&
|
||||||
other.label == label &&
|
other.label == label &&
|
||||||
|
other.title == title &&
|
||||||
|
other.imageId == imageId &&
|
||||||
|
other.imageSource == imageSource &&
|
||||||
other.primaryColor == primaryColor &&
|
other.primaryColor == primaryColor &&
|
||||||
other.secondaryColor == secondaryColor &&
|
other.secondaryColor == secondaryColor &&
|
||||||
other.languages == languages &&
|
other.languages == languages &&
|
||||||
@ -83,6 +95,9 @@ class ConfigurationDTO {
|
|||||||
// ignore: unnecessary_parenthesis
|
// ignore: unnecessary_parenthesis
|
||||||
(id == null ? 0 : id!.hashCode) +
|
(id == null ? 0 : id!.hashCode) +
|
||||||
(label == null ? 0 : label!.hashCode) +
|
(label == null ? 0 : label!.hashCode) +
|
||||||
|
(title == null ? 0 : title!.hashCode) +
|
||||||
|
(imageId == null ? 0 : imageId!.hashCode) +
|
||||||
|
(imageSource == null ? 0 : imageSource!.hashCode) +
|
||||||
(primaryColor == null ? 0 : primaryColor!.hashCode) +
|
(primaryColor == null ? 0 : primaryColor!.hashCode) +
|
||||||
(secondaryColor == null ? 0 : secondaryColor!.hashCode) +
|
(secondaryColor == null ? 0 : secondaryColor!.hashCode) +
|
||||||
(languages == null ? 0 : languages!.hashCode) +
|
(languages == null ? 0 : languages!.hashCode) +
|
||||||
@ -92,7 +107,7 @@ class ConfigurationDTO {
|
|||||||
(isOffline == null ? 0 : isOffline!.hashCode);
|
(isOffline == null ? 0 : isOffline!.hashCode);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() => 'ConfigurationDTO[id=$id, label=$label, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline]';
|
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]';
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final _json = <String, dynamic>{};
|
final _json = <String, dynamic>{};
|
||||||
@ -102,6 +117,15 @@ class ConfigurationDTO {
|
|||||||
if (label != null) {
|
if (label != null) {
|
||||||
_json[r'label'] = label;
|
_json[r'label'] = label;
|
||||||
}
|
}
|
||||||
|
if (title != null) {
|
||||||
|
_json[r'title'] = title;
|
||||||
|
}
|
||||||
|
if (imageId != null) {
|
||||||
|
_json[r'imageId'] = imageId;
|
||||||
|
}
|
||||||
|
if (imageSource != null) {
|
||||||
|
_json[r'imageSource'] = imageSource;
|
||||||
|
}
|
||||||
if (primaryColor != null) {
|
if (primaryColor != null) {
|
||||||
_json[r'primaryColor'] = primaryColor;
|
_json[r'primaryColor'] = primaryColor;
|
||||||
}
|
}
|
||||||
@ -147,6 +171,9 @@ class ConfigurationDTO {
|
|||||||
return ConfigurationDTO(
|
return ConfigurationDTO(
|
||||||
id: mapValueOfType<String>(json, r'id'),
|
id: mapValueOfType<String>(json, r'id'),
|
||||||
label: mapValueOfType<String>(json, r'label'),
|
label: mapValueOfType<String>(json, r'label'),
|
||||||
|
title: TranslationDTO.listFromJson(json[r'title']) ?? const [],
|
||||||
|
imageId: mapValueOfType<String>(json, r'imageId'),
|
||||||
|
imageSource: mapValueOfType<String>(json, r'imageSource'),
|
||||||
primaryColor: mapValueOfType<String>(json, r'primaryColor'),
|
primaryColor: mapValueOfType<String>(json, r'primaryColor'),
|
||||||
secondaryColor: mapValueOfType<String>(json, r'secondaryColor'),
|
secondaryColor: mapValueOfType<String>(json, r'secondaryColor'),
|
||||||
languages: json[r'languages'] is List
|
languages: json[r'languages'] is List
|
||||||
|
|||||||
@ -15,6 +15,9 @@ class ExportConfigurationDTO {
|
|||||||
ExportConfigurationDTO({
|
ExportConfigurationDTO({
|
||||||
this.id,
|
this.id,
|
||||||
this.label,
|
this.label,
|
||||||
|
this.title = const [],
|
||||||
|
this.imageId,
|
||||||
|
this.imageSource,
|
||||||
this.primaryColor,
|
this.primaryColor,
|
||||||
this.secondaryColor,
|
this.secondaryColor,
|
||||||
this.languages = const [],
|
this.languages = const [],
|
||||||
@ -30,6 +33,12 @@ class ExportConfigurationDTO {
|
|||||||
|
|
||||||
String? label;
|
String? label;
|
||||||
|
|
||||||
|
List<TranslationDTO>? title;
|
||||||
|
|
||||||
|
String? imageId;
|
||||||
|
|
||||||
|
String? imageSource;
|
||||||
|
|
||||||
String? primaryColor;
|
String? primaryColor;
|
||||||
|
|
||||||
String? secondaryColor;
|
String? secondaryColor;
|
||||||
@ -76,6 +85,9 @@ class ExportConfigurationDTO {
|
|||||||
bool operator ==(Object other) => identical(this, other) || other is ExportConfigurationDTO &&
|
bool operator ==(Object other) => identical(this, other) || other is ExportConfigurationDTO &&
|
||||||
other.id == id &&
|
other.id == id &&
|
||||||
other.label == label &&
|
other.label == label &&
|
||||||
|
other.title == title &&
|
||||||
|
other.imageId == imageId &&
|
||||||
|
other.imageSource == imageSource &&
|
||||||
other.primaryColor == primaryColor &&
|
other.primaryColor == primaryColor &&
|
||||||
other.secondaryColor == secondaryColor &&
|
other.secondaryColor == secondaryColor &&
|
||||||
other.languages == languages &&
|
other.languages == languages &&
|
||||||
@ -91,6 +103,9 @@ class ExportConfigurationDTO {
|
|||||||
// ignore: unnecessary_parenthesis
|
// ignore: unnecessary_parenthesis
|
||||||
(id == null ? 0 : id!.hashCode) +
|
(id == null ? 0 : id!.hashCode) +
|
||||||
(label == null ? 0 : label!.hashCode) +
|
(label == null ? 0 : label!.hashCode) +
|
||||||
|
(title == null ? 0 : title!.hashCode) +
|
||||||
|
(imageId == null ? 0 : imageId!.hashCode) +
|
||||||
|
(imageSource == null ? 0 : imageSource!.hashCode) +
|
||||||
(primaryColor == null ? 0 : primaryColor!.hashCode) +
|
(primaryColor == null ? 0 : primaryColor!.hashCode) +
|
||||||
(secondaryColor == null ? 0 : secondaryColor!.hashCode) +
|
(secondaryColor == null ? 0 : secondaryColor!.hashCode) +
|
||||||
(languages == null ? 0 : languages!.hashCode) +
|
(languages == null ? 0 : languages!.hashCode) +
|
||||||
@ -102,7 +117,7 @@ class ExportConfigurationDTO {
|
|||||||
(resources == null ? 0 : resources!.hashCode);
|
(resources == null ? 0 : resources!.hashCode);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
String toString() => 'ExportConfigurationDTO[id=$id, label=$label, primaryColor=$primaryColor, secondaryColor=$secondaryColor, languages=$languages, dateCreation=$dateCreation, isMobile=$isMobile, isTablet=$isTablet, isOffline=$isOffline, 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, sections=$sections, resources=$resources]';
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final _json = <String, dynamic>{};
|
final _json = <String, dynamic>{};
|
||||||
@ -112,6 +127,15 @@ class ExportConfigurationDTO {
|
|||||||
if (label != null) {
|
if (label != null) {
|
||||||
_json[r'label'] = label;
|
_json[r'label'] = label;
|
||||||
}
|
}
|
||||||
|
if (title != null) {
|
||||||
|
_json[r'title'] = title;
|
||||||
|
}
|
||||||
|
if (imageId != null) {
|
||||||
|
_json[r'imageId'] = imageId;
|
||||||
|
}
|
||||||
|
if (imageSource != null) {
|
||||||
|
_json[r'imageSource'] = imageSource;
|
||||||
|
}
|
||||||
if (primaryColor != null) {
|
if (primaryColor != null) {
|
||||||
_json[r'primaryColor'] = primaryColor;
|
_json[r'primaryColor'] = primaryColor;
|
||||||
}
|
}
|
||||||
@ -163,6 +187,9 @@ class ExportConfigurationDTO {
|
|||||||
return ExportConfigurationDTO(
|
return ExportConfigurationDTO(
|
||||||
id: mapValueOfType<String>(json, r'id'),
|
id: mapValueOfType<String>(json, r'id'),
|
||||||
label: mapValueOfType<String>(json, r'label'),
|
label: mapValueOfType<String>(json, r'label'),
|
||||||
|
title: TranslationDTO.listFromJson(json[r'title']) ?? const [],
|
||||||
|
imageId: mapValueOfType<String>(json, r'imageId'),
|
||||||
|
imageSource: mapValueOfType<String>(json, r'imageSource'),
|
||||||
primaryColor: mapValueOfType<String>(json, r'primaryColor'),
|
primaryColor: mapValueOfType<String>(json, r'primaryColor'),
|
||||||
secondaryColor: mapValueOfType<String>(json, r'secondaryColor'),
|
secondaryColor: mapValueOfType<String>(json, r'secondaryColor'),
|
||||||
languages: json[r'languages'] is List
|
languages: json[r'languages'] is List
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user