Update generation from back + update layout
This commit is contained in:
parent
617f324341
commit
4e7fcd8d51
@ -51,6 +51,7 @@ class _ImageInputContainerState extends State<ImageInputContainer> {
|
||||
padding: EdgeInsets.only(left: widget.isSmall ? 15 : 70, top: 10, bottom: 10),
|
||||
child: Container(
|
||||
width: size.width *0.08,
|
||||
height: size.height *0.08,
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
var result = await showSelectResourceModal(
|
||||
|
||||
@ -7,9 +7,11 @@ import 'package:flutter/material.dart';
|
||||
import 'package:manager_app/Components/check_input_container.dart';
|
||||
import 'package:manager_app/Components/color_picker_input_container.dart';
|
||||
import 'package:manager_app/Components/confirmation_dialog.dart';
|
||||
import 'package:manager_app/Components/image_input_container.dart';
|
||||
import 'package:manager_app/Components/loading_common.dart';
|
||||
import 'package:manager_app/Components/message_notification.dart';
|
||||
import 'package:manager_app/Components/multi_select_dropdown_container.dart';
|
||||
import 'package:manager_app/Components/multi_string_input_container.dart';
|
||||
import 'package:manager_app/Components/rounded_button.dart';
|
||||
import 'package:manager_app/Components/string_input_container.dart';
|
||||
import 'package:manager_app/Helpers/FileHelper.dart';
|
||||
@ -191,14 +193,6 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
|
||||
//print(configurationDTO.languages);
|
||||
},
|
||||
),*/
|
||||
CheckInputContainer(
|
||||
icon: Icons.signal_wifi_off,
|
||||
label: "Hors ligne :",
|
||||
isChecked: configurationDTO.isOffline,
|
||||
onChanged: (value) {
|
||||
configurationDTO.isOffline = value;
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
Column(
|
||||
@ -212,11 +206,12 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
|
||||
configurationDTO.primaryColor = value;
|
||||
},
|
||||
),*/
|
||||
ColorPickerInputContainer(
|
||||
label: "Couleur fond d'écran :",
|
||||
color: configurationDTO.secondaryColor,
|
||||
CheckInputContainer(
|
||||
icon: Icons.signal_wifi_off,
|
||||
label: "Hors ligne :",
|
||||
isChecked: configurationDTO.isOffline,
|
||||
onChanged: (value) {
|
||||
configurationDTO.secondaryColor = value;
|
||||
configurationDTO.isOffline = value;
|
||||
},
|
||||
),
|
||||
CheckInputContainer(
|
||||
@ -247,7 +242,46 @@ class _ConfigurationDetailScreenState extends State<ConfigurationDetailScreen> {
|
||||
},
|
||||
)
|
||||
],
|
||||
)
|
||||
),
|
||||
Column(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
if(!configurationDTO.isMobile)
|
||||
ColorPickerInputContainer(
|
||||
label: "Couleur fond d'écran :",
|
||||
color: configurationDTO.secondaryColor,
|
||||
onChanged: (value) {
|
||||
configurationDTO.secondaryColor = value;
|
||||
},
|
||||
),
|
||||
if(configurationDTO.isMobile)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(bottom: 15),
|
||||
child: MultiStringContainer(
|
||||
label: "Titre affiché:",
|
||||
modalLabel: "Titre",
|
||||
color: kPrimaryColor,
|
||||
initialValue: configurationDTO != null ? configurationDTO.title : [],
|
||||
onGetResult: (value) {
|
||||
if (configurationDTO.title != value) {
|
||||
configurationDTO.title = value;
|
||||
}
|
||||
},
|
||||
maxLines: 1,
|
||||
isTitle: true,
|
||||
),
|
||||
),
|
||||
ImageInputContainer(
|
||||
label: "Image :",
|
||||
initialValue: configurationDTO != null ? configurationDTO.imageId : "",
|
||||
color: kPrimaryColor,
|
||||
onChanged: (ResourceDTO resource) {
|
||||
configurationDTO.imageId = resource.id;
|
||||
configurationDTO.imageSource = resource.type == ResourceType.imageUrl ? resource.data : appContext.getContext().clientAPI.resourceApi.apiClient.basePath+"/api/Resource/"+ resource.id;
|
||||
},
|
||||
),
|
||||
])
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@ -10,6 +10,9 @@ Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **String** | | [optional]
|
||||
**label** | **String** | | [optional]
|
||||
**title** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
|
||||
**imageId** | **String** | | [optional]
|
||||
**imageSource** | **String** | | [optional]
|
||||
**primaryColor** | **String** | | [optional]
|
||||
**secondaryColor** | **String** | | [optional]
|
||||
**languages** | **List<String>** | | [optional] [default to const []]
|
||||
|
||||
@ -10,6 +10,9 @@ Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **String** | | [optional]
|
||||
**label** | **String** | | [optional]
|
||||
**title** | [**List<TranslationDTO>**](TranslationDTO.md) | | [optional] [default to const []]
|
||||
**imageId** | **String** | | [optional]
|
||||
**imageSource** | **String** | | [optional]
|
||||
**primaryColor** | **String** | | [optional]
|
||||
**secondaryColor** | **String** | | [optional]
|
||||
**languages** | **List<String>** | | [optional] [default to const []]
|
||||
|
||||
@ -14,6 +14,9 @@ class ConfigurationDTO {
|
||||
ConfigurationDTO({
|
||||
this.id,
|
||||
this.label,
|
||||
this.title,
|
||||
this.imageId,
|
||||
this.imageSource,
|
||||
this.primaryColor,
|
||||
this.secondaryColor,
|
||||
this.languages,
|
||||
@ -27,6 +30,12 @@ class ConfigurationDTO {
|
||||
|
||||
String label;
|
||||
|
||||
List<TranslationDTO> title;
|
||||
|
||||
String imageId;
|
||||
|
||||
String imageSource;
|
||||
|
||||
String primaryColor;
|
||||
|
||||
String secondaryColor;
|
||||
@ -45,6 +54,9 @@ class ConfigurationDTO {
|
||||
bool operator ==(Object other) => identical(this, other) || other is ConfigurationDTO &&
|
||||
other.id == id &&
|
||||
other.label == label &&
|
||||
other.title == title &&
|
||||
other.imageId == imageId &&
|
||||
other.imageSource == imageSource &&
|
||||
other.primaryColor == primaryColor &&
|
||||
other.secondaryColor == secondaryColor &&
|
||||
other.languages == languages &&
|
||||
@ -57,6 +69,9 @@ class ConfigurationDTO {
|
||||
int get hashCode =>
|
||||
(id == null ? 0 : id.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) +
|
||||
(secondaryColor == null ? 0 : secondaryColor.hashCode) +
|
||||
(languages == null ? 0 : languages.hashCode) +
|
||||
@ -66,7 +81,7 @@ class ConfigurationDTO {
|
||||
(isOffline == null ? 0 : isOffline.hashCode);
|
||||
|
||||
@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() {
|
||||
final json = <String, dynamic>{};
|
||||
@ -76,6 +91,15 @@ class ConfigurationDTO {
|
||||
if (label != null) {
|
||||
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) {
|
||||
json[r'primaryColor'] = primaryColor;
|
||||
}
|
||||
@ -107,6 +131,9 @@ class ConfigurationDTO {
|
||||
: ConfigurationDTO(
|
||||
id: json[r'id'],
|
||||
label: json[r'label'],
|
||||
title: TranslationDTO.listFromJson(json[r'title']),
|
||||
imageId: json[r'imageId'],
|
||||
imageSource: json[r'imageSource'],
|
||||
primaryColor: json[r'primaryColor'],
|
||||
secondaryColor: json[r'secondaryColor'],
|
||||
languages: json[r'languages'] == null
|
||||
|
||||
@ -14,6 +14,9 @@ class ExportConfigurationDTO {
|
||||
ExportConfigurationDTO({
|
||||
this.id,
|
||||
this.label,
|
||||
this.title,
|
||||
this.imageId,
|
||||
this.imageSource,
|
||||
this.primaryColor,
|
||||
this.secondaryColor,
|
||||
this.languages,
|
||||
@ -29,6 +32,12 @@ class ExportConfigurationDTO {
|
||||
|
||||
String label;
|
||||
|
||||
List<TranslationDTO> title;
|
||||
|
||||
String imageId;
|
||||
|
||||
String imageSource;
|
||||
|
||||
String primaryColor;
|
||||
|
||||
String secondaryColor;
|
||||
@ -51,6 +60,9 @@ class ExportConfigurationDTO {
|
||||
bool operator ==(Object other) => identical(this, other) || other is ExportConfigurationDTO &&
|
||||
other.id == id &&
|
||||
other.label == label &&
|
||||
other.title == title &&
|
||||
other.imageId == imageId &&
|
||||
other.imageSource == imageSource &&
|
||||
other.primaryColor == primaryColor &&
|
||||
other.secondaryColor == secondaryColor &&
|
||||
other.languages == languages &&
|
||||
@ -65,6 +77,9 @@ class ExportConfigurationDTO {
|
||||
int get hashCode =>
|
||||
(id == null ? 0 : id.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) +
|
||||
(secondaryColor == null ? 0 : secondaryColor.hashCode) +
|
||||
(languages == null ? 0 : languages.hashCode) +
|
||||
@ -76,7 +91,7 @@ class ExportConfigurationDTO {
|
||||
(resources == null ? 0 : resources.hashCode);
|
||||
|
||||
@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() {
|
||||
final json = <String, dynamic>{};
|
||||
@ -86,6 +101,15 @@ class ExportConfigurationDTO {
|
||||
if (label != null) {
|
||||
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) {
|
||||
json[r'primaryColor'] = primaryColor;
|
||||
}
|
||||
@ -123,6 +147,9 @@ class ExportConfigurationDTO {
|
||||
: ExportConfigurationDTO(
|
||||
id: json[r'id'],
|
||||
label: json[r'label'],
|
||||
title: TranslationDTO.listFromJson(json[r'title']),
|
||||
imageId: json[r'imageId'],
|
||||
imageSource: json[r'imageSource'],
|
||||
primaryColor: json[r'primaryColor'],
|
||||
secondaryColor: json[r'secondaryColor'],
|
||||
languages: json[r'languages'] == null
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user