layout update + enable all section type for all + added missing loader for kiosk mode (tablet) + update section type

This commit is contained in:
Thomas Fransolet 2025-11-21 15:08:42 +01:00
parent 38c36adc8a
commit 1de0e2ec27
6 changed files with 26 additions and 11 deletions

View File

@ -557,15 +557,15 @@ class _AppConfigurationLinkScreenState extends State<AppConfigurationLinkScreen>
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),

View File

@ -159,8 +159,7 @@ class _MenuConfigState extends State<MenuConfig> {
(appContext.getContext() as ManagerAppContext).selectedConfiguration!.id!,
appContext,
context,
true,
false
true
);
try {
if(newSubsection != null)

View File

@ -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<SectionDTO?> showNewSection(String configurationId, AppContext appContext, BuildContext contextBuild, bool isSubSection, bool isMobile) {
Future<SectionDTO?> 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<SectionDTO?>(
builder: (BuildContext context) => AlertDialog(
@ -45,8 +45,8 @@ Future<SectionDTO?> 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);
},

View File

@ -148,7 +148,7 @@ class _SectionReorderListState extends State<SectionReorderList> {
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();

View File

@ -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(

View File

@ -16,7 +16,7 @@ const kWhite = Color(0xFFFFFFFF);
const kBlack = Color(0xFF000000);
const kSuccess = Color(0xFF8bc34a);
const List<String> section_types = ["Map", "Slider", "Video", "Web", "Menu", "Quiz", "Article", "PDF", "Puzzle", "Agenda", "Weather"];
const List<String> section_types = ["Map", "Slider", "Video", "Web", "Menu", "Quiz", "Article", "PDF", "Game", "Agenda", "Weather", "Event"];
const List<String> map_types = ["none", "normal", "satellite", "terrain", "hybrid"];
const List<String> languages = ["FR", "NL", "EN", "DE", "IT", "ES", "CN", "PL", "AR", "UK"];
const List<String> map_types_mapBox = ["standard", "streets", "outdoors", "light", "dark", "satellite", "satellite_streets"];