Fix Menu + misc

This commit is contained in:
Thomas Fransolet 2025-05-27 15:04:20 +02:00
parent c7396012b3
commit d47dc15688
8 changed files with 61 additions and 63 deletions

View File

@ -9,6 +9,28 @@ import 'package:quill_html_editor/quill_html_editor.dart';
import 'flag_decoration.dart';
class TranslationInputAndResourceContainer extends StatefulWidget {
TranslationInputAndResourceContainer({
Key? key,
required this.isTitle,
required this.values,
required this.newValues,
required this.onGetResult,
required this.maxLines,
required this.resourceTypes,
}) : super(key: key);
bool isTitle;
List<TranslationAndResourceDTO> values;
List<TranslationAndResourceDTO> newValues;
Function onGetResult;
int maxLines;
List<ResourceType>? resourceTypes;
@override
State<TranslationInputAndResourceContainer> createState() => _TranslationInputAndResourceContainerState();
}
class _TranslationInputAndResourceContainerState extends State<TranslationInputAndResourceContainer> with TickerProviderStateMixin {
TabController? _tabController;
QuillEditorController controllerQuill = QuillEditorController();
@ -228,25 +250,3 @@ class _TranslationInputAndResourceContainerState extends State<TranslationInputA
);
}
}
class TranslationInputAndResourceContainer extends StatefulWidget {
TranslationInputAndResourceContainer({
Key? key,
required this.isTitle,
required this.values,
required this.newValues,
required this.onGetResult,
required this.maxLines,
required this.resourceTypes,
}) : super(key: key);
bool isTitle;
List<TranslationAndResourceDTO> values;
List<TranslationAndResourceDTO> newValues;
Function onGetResult;
int maxLines;
List<ResourceType>? resourceTypes;
@override
State<TranslationInputAndResourceContainer> createState() => _TranslationInputAndResourceContainerState();
}

View File

@ -119,7 +119,7 @@ class _MenuConfigState extends State<MenuConfig> {
List<SectionDTO> sectionList = rawSubsections.whereType<SectionDTO>().toList();
menuDTO.sections = sectionList;
menuDTO.sections!.sort((a, b) => a.order!.compareTo(b.order!));
//menuDTO.sections!.sort((a, b) => a.order!.compareTo(b.order!));
return ReorderableListView(
onReorder: _onReorder,

View File

@ -75,7 +75,7 @@ class _PuzzleConfigState extends State<PuzzleConfig> {
fontSize: 20,
color: kPrimaryColor,
initialValue: puzzleDTO.messageDebut != null ? puzzleDTO.messageDebut! : [],
resourceTypes: [ResourceType.Image, ResourceType.ImageUrl],
resourceTypes: [ResourceType.Image, ResourceType.ImageUrl, ResourceType.VideoUrl, ResourceType.Video, ResourceType.Audio],
onGetResult: (value) {
if (puzzleDTO.messageDebut != value) {
setState(() {
@ -96,7 +96,7 @@ class _PuzzleConfigState extends State<PuzzleConfig> {
fontSize: 20,
color: kPrimaryColor,
initialValue: puzzleDTO.messageFin != null ? puzzleDTO.messageFin! : [],
resourceTypes: [ResourceType.Image, ResourceType.ImageUrl],
resourceTypes: [ResourceType.Image, ResourceType.ImageUrl, ResourceType.VideoUrl, ResourceType.Video, ResourceType.Audio],
onGetResult: (value) {
if (puzzleDTO.messageFin != value) {
setState(() {

View File

@ -198,7 +198,7 @@ boxDecoration(dynamic resourceDetailDTO, appContext) {
borderRadius: BorderRadius.circular(30.0),
image: resourceDetailDTO.id != null && (resourceDetailDTO.type == ResourceType.Image || resourceDetailDTO.type == ResourceType.ImageUrl) && resourceDetailDTO.url != null ? new DecorationImage(
fit: BoxFit.cover,
colorFilter: new ColorFilter.mode(Colors.black.withOpacity(0.3), BlendMode.dstATop),
colorFilter: new ColorFilter.mode(Colors.black.withValues(alpha: 0.3), BlendMode.dstATop),
image: new NetworkImage(
resourceDetailDTO.url!,
),

View File

@ -1,4 +1,4 @@
// Openapi Generator last run: : 2025-05-15T14:44:57.478150
// Openapi Generator last run: : 2025-05-27T14:44:29.936214
import 'package:openapi_generator_annotations/openapi_generator_annotations.dart';
@Openapi(

View File

@ -4,7 +4,7 @@
"info": {
"title": "Manager Service",
"description": "API Manager Service",
"version": "Version Alpha 3"
"version": "Version Alpha"
},
"servers": [
{
@ -4300,9 +4300,7 @@
"sections": {
"type": "array",
"nullable": true,
"items": {
"$ref": "#/components/schemas/SectionDTO"
}
"items": {}
}
}
}

View File

@ -26,7 +26,7 @@ Name | Type | Description | Notes
**meterZoneGPS** | **int** | | [optional]
**isBeacon** | **bool** | | [optional]
**beaconId** | **int** | | [optional]
**sections** | [**List<SectionDTO>**](SectionDTO.md) | | [optional] [default to const []]
**sections** | [**List<Object>**](Object.md) | | [optional] [default to const []]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@ -94,36 +94,36 @@ class MenuDTO {
int? beaconId;
List<SectionDTO>? sections;
dynamic? sections;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is MenuDTO &&
other.id == id &&
other.label == label &&
_deepEquality.equals(other.title, title) &&
_deepEquality.equals(other.description, description) &&
other.imageId == imageId &&
other.imageSource == imageSource &&
other.configurationId == configurationId &&
other.isSubSection == isSubSection &&
other.parentId == parentId &&
other.type == type &&
other.dateCreation == dateCreation &&
other.order == order &&
other.instanceId == instanceId &&
other.latitude == latitude &&
other.longitude == longitude &&
other.meterZoneGPS == meterZoneGPS &&
other.isBeacon == isBeacon &&
other.beaconId == beaconId &&
_deepEquality.equals(other.sections, sections);
other is MenuDTO &&
other.id == id &&
other.label == label &&
_deepEquality.equals(other.title, title) &&
_deepEquality.equals(other.description, description) &&
other.imageId == imageId &&
other.imageSource == imageSource &&
other.configurationId == configurationId &&
other.isSubSection == isSubSection &&
other.parentId == parentId &&
other.type == type &&
other.dateCreation == dateCreation &&
other.order == order &&
other.instanceId == instanceId &&
other.latitude == latitude &&
other.longitude == longitude &&
other.meterZoneGPS == meterZoneGPS &&
other.isBeacon == isBeacon &&
other.beaconId == beaconId &&
_deepEquality.equals(other.sections, sections);
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(id == null ? 0 : id!.hashCode) +
(id == null ? 0 : id!.hashCode) +
(label == null ? 0 : label!.hashCode) +
(title == null ? 0 : title!.hashCode) +
(description == null ? 0 : description!.hashCode) +
@ -260,9 +260,9 @@ class MenuDTO {
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key),
'Required key "MenuDTO[$key]" is missing from JSON.');
'Required key "MenuDTO[$key]" is missing from JSON.');
assert(json[key] != null,
'Required key "MenuDTO[$key]" has a null value in JSON.');
'Required key "MenuDTO[$key]" has a null value in JSON.');
});
return true;
}());
@ -286,16 +286,16 @@ class MenuDTO {
meterZoneGPS: mapValueOfType<int>(json, r'meterZoneGPS'),
isBeacon: mapValueOfType<bool>(json, r'isBeacon'),
beaconId: mapValueOfType<int>(json, r'beaconId'),
sections: SectionDTO.listFromJson(json[r'sections']),
sections: json[r'sections'],
);
}
return null;
}
static List<MenuDTO> listFromJson(
dynamic json, {
bool growable = false,
}) {
dynamic json, {
bool growable = false,
}) {
final result = <MenuDTO>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
@ -324,9 +324,9 @@ class MenuDTO {
// maps a json object with a list of MenuDTO-objects as value to a dart map
static Map<String, List<MenuDTO>> mapListFromJson(
dynamic json, {
bool growable = false,
}) {
dynamic json, {
bool growable = false,
}) {
final map = <String, List<MenuDTO>>{};
if (json is Map && json.isNotEmpty) {
// ignore: parameter_assignments