import 'package:flutter/material.dart'; import 'package:manager_app/l10n/app_localizations.dart'; import 'package:manager_api_new/api.dart'; String getSectionTypeName(AppLocalizations l, SectionType? type) { switch (type) { case SectionType.Map: return l.sectionTypeMap; case SectionType.Slider: return l.sectionTypeSlider; case SectionType.Video: return l.sectionTypeVideo; case SectionType.Web: return l.sectionTypeWeb; case SectionType.Menu: return l.sectionTypeMenu; case SectionType.Quiz: return l.sectionTypeQuiz; case SectionType.Article: return l.sectionTypeArticle; case SectionType.Pdf: return l.sectionTypePdf; case SectionType.Game: return l.sectionTypeGame; case SectionType.Agenda: return l.sectionTypeAgenda; case SectionType.Weather: return l.sectionTypeWeather; case SectionType.Event: return l.sectionTypeEvent; case SectionType.Parcours: return l.sectionTypeParcours; default: return l.sectionTypeDefault; } } /// Une ligne qui dit ce que fait le type, pour la grille de choix : le client /// choisit sans avoir à connaître le vocabulaire du produit. String getSectionTypeDescription(AppLocalizations l, SectionType? type) { switch (type) { case SectionType.Map: return l.sectionTypeDescMap; case SectionType.Slider: return l.sectionTypeDescSlider; case SectionType.Video: return l.sectionTypeDescVideo; case SectionType.Web: return l.sectionTypeDescWeb; case SectionType.Menu: return l.sectionTypeDescMenu; case SectionType.Quiz: return l.sectionTypeDescQuiz; case SectionType.Article: return l.sectionTypeDescArticle; case SectionType.Pdf: return l.sectionTypeDescPdf; case SectionType.Game: return l.sectionTypeDescGame; case SectionType.Agenda: return l.sectionTypeDescAgenda; case SectionType.Weather: return l.sectionTypeDescWeather; case SectionType.Event: return l.sectionTypeDescEvent; case SectionType.Parcours: return l.sectionTypeDescParcours; default: return ""; } } IconData getSectionIcon(elementType) { switch(elementType) { case SectionType.Map: return Icons.location_on; case SectionType.Slider: return Icons.collections; // art_track case SectionType.Video: return Icons.ondemand_video_rounded; case SectionType.Web: return Icons.web; case SectionType.Menu: return Icons.apps_sharp; case SectionType.Quiz: return Icons.question_answer; case SectionType.Article: return Icons.article_outlined; case SectionType.Pdf: return Icons.picture_as_pdf_outlined; case SectionType.Game: return Icons.sports_esports; case SectionType.Agenda: return Icons.calendar_month_outlined; case SectionType.Weather: return Icons.sunny; case SectionType.Event: return Icons.event; case SectionType.Parcours: return Icons.route; } return Icons.question_mark; }