From 1de0e2ec2715215aa6b65e7af47f02098effe883 Mon Sep 17 00:00:00 2001 From: Thomas Fransolet Date: Fri, 21 Nov 2025 15:08:42 +0100 Subject: [PATCH] layout update + enable all section type for all + added missing loader for kiosk mode (tablet) + update section type --- .../app_configuration_link_screen.dart | 6 +++--- .../Section/SubSection/Menu/menu_config.dart | 3 +-- .../Configurations/new_section_popup.dart | 8 ++++---- .../Configurations/section_reorderList.dart | 2 +- .../Kiosk_devices/change_device_info_modal.dart | 16 ++++++++++++++++ lib/constants.dart | 2 +- 6 files changed, 26 insertions(+), 11 deletions(-) diff --git a/lib/Screens/Applications/app_configuration_link_screen.dart b/lib/Screens/Applications/app_configuration_link_screen.dart index 8ad1fdd..81a6f90 100644 --- a/lib/Screens/Applications/app_configuration_link_screen.dart +++ b/lib/Screens/Applications/app_configuration_link_screen.dart @@ -557,15 +557,15 @@ class _AppConfigurationLinkScreenState extends State children: [ ConstrainedBox( constraints: BoxConstraints( - maxHeight: maxHeight * 0.45, + maxHeight: maxHeight * 0.42, minHeight: 150, ), child: _generalInfoCard(), ), - const SizedBox(height: 10), + const SizedBox(height: 8), ConstrainedBox( constraints: BoxConstraints( - maxHeight: maxHeight * 0.5, + maxHeight: maxHeight * 0.53, minHeight: 150, ), child: _phoneConfigCard(appConfigurationLinks), diff --git a/lib/Screens/Configurations/Section/SubSection/Menu/menu_config.dart b/lib/Screens/Configurations/Section/SubSection/Menu/menu_config.dart index 1573d33..e6f4351 100644 --- a/lib/Screens/Configurations/Section/SubSection/Menu/menu_config.dart +++ b/lib/Screens/Configurations/Section/SubSection/Menu/menu_config.dart @@ -159,8 +159,7 @@ class _MenuConfigState extends State { (appContext.getContext() as ManagerAppContext).selectedConfiguration!.id!, appContext, context, - true, - false + true ); try { if(newSubsection != null) diff --git a/lib/Screens/Configurations/new_section_popup.dart b/lib/Screens/Configurations/new_section_popup.dart index 7dbf6dd..b103d76 100644 --- a/lib/Screens/Configurations/new_section_popup.dart +++ b/lib/Screens/Configurations/new_section_popup.dart @@ -8,14 +8,14 @@ import 'package:manager_app/app_context.dart'; import 'package:manager_app/constants.dart'; import 'package:manager_api_new/api.dart'; -Future showNewSection(String configurationId, AppContext appContext, BuildContext contextBuild, bool isSubSection, bool isMobile) { +Future showNewSection(String configurationId, AppContext appContext, BuildContext contextBuild, bool isSubSection) { SectionDTO sectionDTO = new SectionDTO(); sectionDTO.label = ""; sectionDTO.configurationId = configurationId; sectionDTO.isSubSection = isSubSection; sectionDTO.parentId = isSubSection ? (appContext.getContext() as ManagerAppContext).selectedSection!.id : null; Size size = MediaQuery.of(contextBuild).size; - sectionDTO.type = isMobile ? SectionType.Article : SectionType.Map; + sectionDTO.type = SectionType.Map; var section = showDialog( builder: (BuildContext context) => AlertDialog( @@ -45,8 +45,8 @@ Future showNewSection(String configurationId, AppContext appContext ), DropDownInputContainer( label: "Type:", - values: isMobile ? section_types.where((sectionType) => sectionType == "Article" || sectionType == "Quizz").toList(): isSubSection ? section_types.where((sectionType) => sectionType != "Menu" && sectionType != "Article").toList(): section_types.where((sectionType) => sectionType != "Article").toList(), // Todo get menu by enum type - initialValue: isMobile ? "Article" : "Map", + values: isSubSection ? section_types.where((sectionType) => sectionType != "Menu").toList(): section_types.toList(), // Todo get menu by enum type + initialValue: "Map", onChange: (String? value) { sectionDTO.type = SectionType.fromJson(value); }, diff --git a/lib/Screens/Configurations/section_reorderList.dart b/lib/Screens/Configurations/section_reorderList.dart index 8039147..51220cc 100644 --- a/lib/Screens/Configurations/section_reorderList.dart +++ b/lib/Screens/Configurations/section_reorderList.dart @@ -148,7 +148,7 @@ class _SectionReorderListState extends State { right: 10, child: InkWell( onTap: () async { - var sectionToCreate = await showNewSection(widget.configurationId, appContext, context, false, false/*currentConfiguration.isMobile!*/); + var sectionToCreate = await showNewSection(widget.configurationId, appContext, context, false); if(sectionToCreate != null) { ManagerAppContext managerAppContext = appContext.getContext(); diff --git a/lib/Screens/Kiosk_devices/change_device_info_modal.dart b/lib/Screens/Kiosk_devices/change_device_info_modal.dart index bc5e445..c6ed70d 100644 --- a/lib/Screens/Kiosk_devices/change_device_info_modal.dart +++ b/lib/Screens/Kiosk_devices/change_device_info_modal.dart @@ -11,6 +11,7 @@ import 'package:manager_app/app_context.dart'; import 'package:manager_app/constants.dart'; import 'package:manager_api_new/api.dart'; +import '../../Components/resource_input_container.dart'; import 'dropDown_configuration.dart'; showChangeInfo (String text, DeviceDTO inputDevice, AppConfigurationLinkDTO appConfiguration, Function onGetResult, int maxLines, BuildContext mainContext, dynamic appContext) async { @@ -110,6 +111,21 @@ showChangeInfo (String text, DeviceDTO inputDevice, AppConfigurationLinkDTO appC appConfiguration.secondaryColor = value; }, ), + ResourceInputContainer( + label: "Loader :", + initialValue: appConfiguration.loaderImageId, + color: kPrimaryColor, + imageFit: BoxFit.fitHeight, + onChanged: (ResourceDTO resource) async { + if(resource.id == null) { + appConfiguration.loaderImageId = null; + appConfiguration.loaderImageUrl = null; + } else { + appConfiguration.loaderImageId = resource.id; + appConfiguration.loaderImageUrl = resource.url; + } + }, + ), ], ), Row( diff --git a/lib/constants.dart b/lib/constants.dart index b7627dc..7c26e7e 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -16,7 +16,7 @@ const kWhite = Color(0xFFFFFFFF); const kBlack = Color(0xFF000000); const kSuccess = Color(0xFF8bc34a); -const List section_types = ["Map", "Slider", "Video", "Web", "Menu", "Quiz", "Article", "PDF", "Puzzle", "Agenda", "Weather"]; +const List section_types = ["Map", "Slider", "Video", "Web", "Menu", "Quiz", "Article", "PDF", "Game", "Agenda", "Weather", "Event"]; const List map_types = ["none", "normal", "satellite", "terrain", "hybrid"]; const List languages = ["FR", "NL", "EN", "DE", "IT", "ES", "CN", "PL", "AR", "UK"]; const List map_types_mapBox = ["standard", "streets", "outdoors", "light", "dark", "satellite", "satellite_streets"];