50 lines
1.5 KiB
Dart
50 lines
1.5 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:manager_api_new/api.dart';
|
|
|
|
String getSectionTypeName(SectionType? type) {
|
|
switch (type) {
|
|
case SectionType.Map: return 'Map';
|
|
case SectionType.Slider: return 'Slider';
|
|
case SectionType.Video: return 'Vidéo';
|
|
case SectionType.Web: return 'Web';
|
|
case SectionType.Menu: return 'Menu';
|
|
case SectionType.Quiz: return 'Quiz';
|
|
case SectionType.Article: return 'Article';
|
|
case SectionType.Pdf: return 'PDF';
|
|
case SectionType.Game: return 'Jeu';
|
|
case SectionType.Agenda: return 'Agenda';
|
|
case SectionType.Weather: return 'Météo';
|
|
case SectionType.Event: return 'Événement';
|
|
default: return 'Section';
|
|
}
|
|
}
|
|
|
|
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;
|
|
}
|
|
return Icons.question_mark;
|
|
} |