diff --git a/lib/Components/fetch_section_icon.dart b/lib/Components/fetch_section_icon.dart index c97de7e..d299fcb 100644 --- a/lib/Components/fetch_section_icon.dart +++ b/lib/Components/fetch_section_icon.dart @@ -15,6 +15,7 @@ String getSectionTypeName(SectionType? type) { case SectionType.Agenda: return 'Agenda'; case SectionType.Weather: return 'Météo'; case SectionType.Event: return 'Événement'; + case SectionType.Parcours: return 'Parcours'; default: return 'Section'; } } @@ -45,6 +46,8 @@ IconData getSectionIcon(elementType) { return Icons.sunny; case SectionType.Event: return Icons.event; + case SectionType.Parcours: + return Icons.route; } return Icons.question_mark; } \ No newline at end of file diff --git a/lib/Components/geoloc_input_container.dart b/lib/Components/geoloc_input_container.dart index 1acf0e8..7ca765a 100644 --- a/lib/Components/geoloc_input_container.dart +++ b/lib/Components/geoloc_input_container.dart @@ -66,7 +66,7 @@ class _GeolocInputContainerState extends State { width: size.width *0.75, height: 350, child: FlutterLocationPicker( - initZoom: 14, + initZoom: 14, initPosition: localisation == null ? LatLong(50.429333, 4.891434) : LatLong(localisation!.latitude, localisation!.longitude), minZoomLevel: 0, maxZoomLevel: 17, diff --git a/lib/Components/multi_input_modal.dart b/lib/Components/multi_input_modal.dart index 769c9b6..b65d3d0 100644 --- a/lib/Components/multi_input_modal.dart +++ b/lib/Components/multi_input_modal.dart @@ -129,10 +129,10 @@ getTranslations(BuildContext context, AppContext appContext, String label, bool ), child: Center(child: AutoSizeText(language.toUpperCase())) ),*/ - Padding( + Expanded( + child: Padding( padding: const EdgeInsets.only(left: 8.0), - child: Container( - child: Column( + child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, crossAxisAlignment: CrossAxisAlignment.center, children: [ @@ -156,7 +156,9 @@ getTranslations(BuildContext context, AppContext appContext, String label, bool initialValue: newValues.where((element) => element.language == language).first.value == null ? null : newValues.where((element) => element.language == language).first.value!, inResourceTypes: resourceTypes, onChanged: (ResourceDTO resource) { - newValues.where((element) => element.language == language).first.value = resource.id; + final storeUrl = resourceTypes.every((t) => t == ResourceType.Audio); + newValues.where((element) => element.language == language).first.value = + storeUrl ? resource.url : resource.id; }, )/*AudioInputContainer( //label: "Audio :", diff --git a/lib/Components/resource_input_container.dart b/lib/Components/resource_input_container.dart index a3cf911..7a41ab7 100644 --- a/lib/Components/resource_input_container.dart +++ b/lib/Components/resource_input_container.dart @@ -96,18 +96,40 @@ class _ResourceInputContainerState extends State { width: widget.isSmall ? 60 : 120, alignment: Alignment.center, decoration: BoxDecoration( - color: resourceIdToShow == null ? widget.color : Colors.transparent, + color: (resourceIdToShow == null || resourceIdToShow!.isEmpty) ? widget.color : Colors.transparent, borderRadius: BorderRadius.circular(10), ), - child: resourceIdToShow == null - ? Text( - "Choisir", - style: TextStyle( - color: kWhite, - fontSize: widget.fontSize, + child: (resourceIdToShow == null || resourceIdToShow!.isEmpty) + ? Padding( + padding: const EdgeInsets.symmetric(horizontal: 4), + child: FittedBox( + fit: BoxFit.scaleDown, + child: Text( + "Choisir", + style: TextStyle( + color: kWhite, + fontSize: widget.fontSize, + ), + maxLines: 1, + ), ), - maxLines: 1, ) + : resourceIdToShow!.startsWith('http') + ? Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + gradient: const LinearGradient( + colors: [Color(0xFF2C3E50), Color(0xFF3498DB)], + begin: Alignment.topLeft, + end: Alignment.bottomRight, + ), + ), + child: Icon( + Icons.audiotrack, + color: Colors.white, + size: widget.isSmall ? 16 : 28, + ), + ) : FutureBuilder( future: (appContext.getContext() as ManagerAppContext) .clientAPI! @@ -121,23 +143,70 @@ class _ResourceInputContainerState extends State { child: CircularProgressIndicator(strokeWidth: 2), ); } else if (snapshot.hasError || snapshot.data == null) { - return Text( - "Erreur", - style: TextStyle( - color: kWhite, - fontSize: widget.fontSize, + return Padding( + padding: const EdgeInsets.symmetric(horizontal: 4), + child: FittedBox( + fit: BoxFit.scaleDown, + child: Text( + "Erreur", + style: TextStyle( + color: kWhite, + fontSize: widget.fontSize, + ), + maxLines: 1, + ), ), - maxLines: 1, ); } else { + final resource = snapshot.data!; + final isImage = resource.type == ResourceType.Image || + resource.type == ResourceType.ImageUrl; + if (isImage) { + return Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + image: DecorationImage( + fit: widget.imageFit, + image: NetworkImage(resource.url!), + ), + ), + ); + } return Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(10), - image: DecorationImage( - fit: widget.imageFit, - image: NetworkImage(snapshot.data!.url!), + gradient: const LinearGradient( + colors: [Color(0xFF2C3E50), Color(0xFF3498DB)], + begin: Alignment.topLeft, + end: Alignment.bottomRight, ), ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon( + resource.type == ResourceType.Audio + ? Icons.audiotrack + : Icons.insert_drive_file, + color: Colors.white, + size: widget.isSmall ? 16 : 28, + ), + if (!widget.isSmall && resource.label != null) + Padding( + padding: const EdgeInsets.only(top: 4, left: 4, right: 4), + child: Text( + resource.label!, + style: const TextStyle( + color: Colors.white, + fontSize: 10, + ), + maxLines: 2, + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.center, + ), + ), + ], + ), ); } }, diff --git a/lib/Components/text_form_input_container.dart b/lib/Components/text_form_input_container.dart index 24a6b06..46342c7 100644 --- a/lib/Components/text_form_input_container.dart +++ b/lib/Components/text_form_input_container.dart @@ -20,51 +20,49 @@ class TextFormInputContainer extends StatelessWidget { @override Widget build(BuildContext context) { - Size size = MediaQuery.of(context).size; - return Container( - child: Row( - children: [ - Align( - alignment: AlignmentDirectional.centerStart, - child: Text(label, style: TextStyle(fontSize: 20, fontWeight: FontWeight.w300)) - ), - Padding( + return Row( + children: [ + Align( + alignment: AlignmentDirectional.centerStart, + child: Text(label, style: const TextStyle(fontSize: 20, fontWeight: FontWeight.w300)), + ), + Expanded( + child: Padding( padding: const EdgeInsets.all(10.0), child: Container( decoration: BoxDecoration( color: color, borderRadius: BorderRadius.circular(5), - border: Border.all(width: 0.5, color: kSecond) + border: Border.all(width: 0.5, color: kSecond), ), - width: size.width *0.3, child: Padding( padding: const EdgeInsets.all(10.0), - child: TextFormField ( - keyboardType: TextInputType.multiline, - textInputAction: TextInputAction.newline, - minLines: 1, - maxLines: maxLines, - initialValue: initialValue, - onChanged: onChanged, - maxLength: isTitle ? 50 : 2000, - cursorColor: kPrimaryColor, - decoration: InputDecoration( - enabledBorder: UnderlineInputBorder( - borderSide: BorderSide(color: kPrimaryColor), - ), - focusedBorder: UnderlineInputBorder( - borderSide: BorderSide(color: kSecond), - ), - border: UnderlineInputBorder( - borderSide: BorderSide(color: kPrimaryColor), - ), - ) + child: TextFormField( + keyboardType: TextInputType.multiline, + textInputAction: TextInputAction.newline, + minLines: 1, + maxLines: maxLines, + initialValue: initialValue, + onChanged: onChanged, + maxLength: isTitle ? 50 : 2000, + cursorColor: kPrimaryColor, + decoration: const InputDecoration( + enabledBorder: UnderlineInputBorder( + borderSide: BorderSide(color: kPrimaryColor), + ), + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide(color: kSecond), + ), + border: UnderlineInputBorder( + borderSide: BorderSide(color: kPrimaryColor), + ), + ), ), ), ), ), - ], - ), + ), + ], ); } -} \ No newline at end of file +} diff --git a/lib/Components/translation_input_and_resource_container.dart b/lib/Components/translation_input_and_resource_container.dart index bd930e6..bfd9df9 100644 --- a/lib/Components/translation_input_and_resource_container.dart +++ b/lib/Components/translation_input_and_resource_container.dart @@ -1,10 +1,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_quill/flutter_quill.dart'; import 'package:flutter_quill_delta_from_html/flutter_quill_delta_from_html.dart'; -import 'package:vsc_quill_delta_to_html/vsc_quill_delta_to_html.dart'; import 'package:manager_api_new/api.dart'; import 'package:manager_app/Components/resource_input_container.dart'; import 'package:manager_app/Components/rounded_button.dart'; +import 'package:manager_app/Helpers/quill_html_converter.dart'; import 'package:manager_app/Models/managerContext.dart' show ManagerAppContext; import 'package:manager_app/Services/ai_translate_service.dart'; import 'package:manager_app/app_context.dart'; @@ -93,10 +93,7 @@ class _TranslationInputAndResourceContainerState } String _controllerToHtml(QuillController controller) { - final ops = controller.document.toDelta().toJson(); - return QuillDeltaToHtmlConverter( - List>.from(ops), - ).convert(); + return quillOpsToHtml(controller.document.toDelta().toJson()); } Future _translateWithAI() async { diff --git a/lib/Components/translation_input_container.dart b/lib/Components/translation_input_container.dart index 52f510e..ece3362 100644 --- a/lib/Components/translation_input_container.dart +++ b/lib/Components/translation_input_container.dart @@ -1,10 +1,12 @@ +import 'dart:convert'; + import 'package:flutter/material.dart'; import 'package:flutter_quill/flutter_quill.dart'; import 'package:flutter_quill_delta_from_html/flutter_quill_delta_from_html.dart'; -import 'package:vsc_quill_delta_to_html/vsc_quill_delta_to_html.dart'; import 'package:manager_api_new/api.dart'; import 'package:manager_app/Components/resource_input_container.dart'; import 'package:manager_app/Components/rounded_button.dart'; +import 'package:manager_app/Helpers/quill_html_converter.dart'; import 'package:manager_app/Models/managerContext.dart' show ManagerAppContext; import 'package:manager_app/Services/ai_translate_service.dart'; import 'package:manager_app/constants.dart'; @@ -91,10 +93,7 @@ class _TranslationInputContainerState extends State { } String _controllerToHtml(QuillController controller) { - final ops = controller.document.toDelta().toJson(); - return QuillDeltaToHtmlConverter( - List>.from(ops), - ).convert(); + return quillOpsToHtml(controller.document.toDelta().toJson()); } Future _translateWithAI() async { @@ -158,20 +157,25 @@ class _TranslationInputContainerState extends State { void _applyToAllLanguages() { if (_controllers.isEmpty) return; final firstLang = widget.newValues.first.language!; - final html = _controllerToHtml(_controllers[firstLang]!); + final sourceOps = _controllers[firstLang]!.document.toDelta().toJson(); setState(() { + widget.newValues.firstWhere((e) => e.language == firstLang).value = + _controllerToHtml(_controllers[firstLang]!); + for (final translation in widget.newValues) { - translation.value = html; - if (translation.language != firstLang) { - _controllers[translation.language!]?.dispose(); - final controller = QuillController( - document: Document.fromJson(_htmlToDeltaJson(html)), - selection: const TextSelection.collapsed(offset: 0), - ); - _setupListener(translation.language!, controller); - _controllers[translation.language!] = controller; - } + if (translation.language == firstLang) continue; + final opsCopy = List>.from( + jsonDecode(jsonEncode(sourceOps)), + ); + _controllers[translation.language!]?.dispose(); + final controller = QuillController( + document: Document.fromJson(opsCopy), + selection: const TextSelection.collapsed(offset: 0), + ); + _setupListener(translation.language!, controller); + _controllers[translation.language!] = controller; + translation.value = _controllerToHtml(controller); } }); diff --git a/lib/Helpers/quill_html_converter.dart b/lib/Helpers/quill_html_converter.dart new file mode 100644 index 0000000..9d7c122 --- /dev/null +++ b/lib/Helpers/quill_html_converter.dart @@ -0,0 +1,73 @@ +import 'package:vsc_quill_delta_to_html/vsc_quill_delta_to_html.dart'; +import 'package:html/parser.dart' as html_parser; +import 'package:html/dom.dart' as dom; + +/// Converts a Quill Delta (as JSON ops) into an HTML string that survives a +/// round-trip back through [HtmlToDelta] (see translation_input_container.dart). +/// +/// Two issues in the underlying libraries are worked around here: +/// - flutter_quill stores colors as 8-digit ARGB hex (#AARRGGBB), which +/// vsc_quill_delta_to_html's sanitizer silently drops unless truncated to +/// #RRGGBB (colors picked in this editor are always opaque). +/// - vsc_quill_delta_to_html attaches a `style` attribute (color/background) +/// to whichever inline tag (e.g. ) comes first, but +/// flutter_quill_delta_from_html only reads `style` off elements. +/// Combined bold/italic + color would otherwise render fine everywhere +/// else but vanish when the editor reopens the HTML. Wrapping any styled +/// non-span element in a fixes the round-trip. +String quillOpsToHtml(List ops) { + final normalizedOps = _normalizeColors(ops); + final html = QuillDeltaToHtmlConverter( + List>.from(normalizedOps), + ConverterOptions( + converterOptions: OpConverterOptions(inlineStylesFlag: true), + ), + ).convert(); + return _moveStyleToWrappingSpan(html); +} + +List> _normalizeColors(List ops) { + return ops.map((op) { + final copy = Map.from(op); + final attrs = copy['attributes']; + if (attrs is Map) { + final attrsCopy = Map.from(attrs); + for (final key in ['color', 'background']) { + final value = attrsCopy[key]; + if (value is String && value.length == 9 && value.startsWith('#')) { + attrsCopy[key] = '#${value.substring(3)}'; + } + } + copy['attributes'] = attrsCopy; + } + return copy; + }).toList(); +} + +String _moveStyleToWrappingSpan(String htmlStr) { + final fragment = html_parser.parseFragment(htmlStr); + + void visit(dom.Node node) { + if (node is dom.Element) { + if (node.localName != 'span' && node.attributes.containsKey('style')) { + final style = node.attributes.remove('style'); + final span = dom.Element.tag('span')..attributes['style'] = style!; + final parent = node.parent!; + final index = parent.nodes.indexOf(node); + parent.nodes + ..removeAt(index) + ..insert(index, span); + span.nodes.add(node); + } + for (final child in List.from(node.nodes)) { + visit(child); + } + } + } + + for (final child in List.from(fragment.nodes)) { + visit(child); + } + + return fragment.outerHtml; +} diff --git a/lib/Screens/Configurations/Section/SubSection/Game/game_config.dart b/lib/Screens/Configurations/Section/SubSection/Game/game_config.dart index ddc253c..6e67263 100644 --- a/lib/Screens/Configurations/Section/SubSection/Game/game_config.dart +++ b/lib/Screens/Configurations/Section/SubSection/Game/game_config.dart @@ -4,7 +4,6 @@ import 'package:manager_app/Components/multi_string_input_and_resource_container import 'package:manager_app/Components/number_input_container.dart'; import 'package:manager_app/Components/resource_input_container.dart'; import 'package:manager_api_new/api.dart'; -import 'package:manager_app/Screens/Configurations/Section/SubSection/Parcours/parcours_config.dart'; import 'package:manager_app/constants.dart'; import 'package:manager_app/l10n/app_localizations.dart'; @@ -36,7 +35,6 @@ class _GameConfigState extends State { gameDTO.gameType = gameDTO.gameType ?? GameTypes.Puzzle; gameDTO.messageDebut = gameDTO.messageDebut ?? []; gameDTO.messageFin = gameDTO.messageFin ?? []; - gameDTO.guidedPaths = gameDTO.guidedPaths ?? []; super.initState(); } @@ -60,11 +58,11 @@ class _GameConfigState extends State { @override Widget build(BuildContext context) { - int initialIndex = gameDTO.gameType?.value ?? 0; + int initialIndex = (gameDTO.gameType?.value ?? 0).clamp(0, 1); return DefaultTabController( key: ValueKey("${gameDTO.id}_$initialIndex"), - length: 3, + length: 2, initialIndex: initialIndex, child: Builder(builder: (context) { final TabController controller = DefaultTabController.of(context); @@ -91,7 +89,6 @@ class _GameConfigState extends State { tabs: [ Tab(icon: Icon(Icons.extension), text: "Puzzle"), Tab(icon: Icon(Icons.grid_on), text: "Puzzle Glissant"), - Tab(icon: Icon(Icons.door_front_door), text: "Escape Game"), ], ), Container( @@ -100,18 +97,6 @@ class _GameConfigState extends State { children: [ _buildPuzzleConfig(), _buildPuzzleConfig(), - ParcoursConfig( - initialValue: gameDTO.guidedPaths ?? [], - parentId: gameDTO.id!, - isEvent: false, - isEscapeMode: true, - onChanged: (paths) { - setState(() { - gameDTO.guidedPaths = paths; - widget.onChanged(gameDTO); - }); - }, - ), ], ), ), diff --git a/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart b/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart index 82c960f..2a9d366 100644 --- a/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart +++ b/lib/Screens/Configurations/Section/SubSection/Map/map_config.dart @@ -22,7 +22,6 @@ import 'package:manager_app/client.dart'; import 'package:manager_app/constants.dart'; import 'package:manager_app/l10n/app_localizations.dart'; import 'package:manager_api_new/api.dart'; -import 'package:manager_app/Screens/Configurations/Section/SubSection/Parcours/parcours_config.dart'; import 'package:provider/provider.dart'; @@ -46,7 +45,6 @@ class MapConfig extends StatefulWidget { class _MapConfigState extends State { late MapDTO mapDTO; late List pointsToShow = []; - //List? selectedCategories = []; String mapType = "hybrid"; String mapTypeMapBox = "standard"; @@ -56,10 +54,17 @@ class _MapConfigState extends State { ValueNotifier([]); final ValueNotifier searchNotifier = ValueNotifier(""); + late Future?> _geoPointsFuture; + bool _geoPointsInitialized = false; + + Future?> _loadGeoPoints() { + final appContext = Provider.of(context, listen: false); + return getGeoPoints((appContext.getContext() as ManagerAppContext).clientAPI!); + } + @override void initState() { super.initState(); - //mapDTO = MapDTO.fromJson(json.decode(widget.initialValue))!; mapDTO = widget.initialValue; if (mapDTO.mapType != null) { @@ -107,6 +112,18 @@ class _MapConfigState extends State { break; } } + + selectedCategoriesNotifier.value = + mapDTO.categories?.map((c) => c.id!).toList() ?? []; + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + if (!_geoPointsInitialized) { + _geoPointsInitialized = true; + _geoPointsFuture = _loadGeoPoints(); + } } @override @@ -127,33 +144,17 @@ class _MapConfigState extends State { break; } - return DefaultTabController( - length: 2, - child: Column( + return Column( mainAxisSize: MainAxisSize.min, children: [ - _buildMapHeader(size, mapProviderIn), - TabBar( - labelColor: kPrimaryColor, - unselectedLabelColor: Colors.grey, - indicatorColor: kPrimaryColor, - tabs: [ - Tab(icon: Icon(Icons.map), text: AppLocalizations.of(context)!.pointsOfInterestLabel), - Tab(icon: Icon(Icons.route), text: AppLocalizations.of(context)!.pathsLabel), - ], - ), - Container( - height: 700, - child: TabBarView( + _buildMapHeader(size, mapProviderIn), + SizedBox( + height: 700, + child: SingleChildScrollView( + child: Column( children: [ - // Tab 1: Configuration & Points - SingleChildScrollView( - child: Column( - children: [ FutureBuilder( - future: getGeoPoints( - (appContext.getContext() as ManagerAppContext) - .clientAPI!), + future: _geoPointsFuture, builder: (context, AsyncSnapshot snapshot) { if (snapshot.connectionState == ConnectionState.waiting) { @@ -171,10 +172,6 @@ class _MapConfigState extends State { .firstWhere((t) => t.language == 'FR') .value! .toLowerCase())); - selectedCategoriesNotifier.value = mapDTO - .categories! - .map((categorie) => categorie.id!) - .toList(); return Padding( padding: const EdgeInsets.all(8.0), @@ -348,6 +345,7 @@ class _MapConfigState extends State { top: 0, right: 150, child: Container( + width: size.width * 0.2, height: size.height * 0.1, constraints: BoxConstraints(minHeight: 85), @@ -384,8 +382,7 @@ class _MapConfigState extends State { context, null); setState(() { - // refresh ui - print("Refresh UI"); + _geoPointsFuture = _loadGeoPoints(); }); } catch (e) { showNotification( @@ -435,25 +432,10 @@ class _MapConfigState extends State { } }), ], - ), - ), - // Tab 2: Parcours - ParcoursConfig( - initialValue: mapDTO.guidedPaths ?? [], - parentId: mapDTO.id!, - isEvent: false, - onChanged: (paths) { - setState(() { - mapDTO.guidedPaths = paths; - widget.onChanged(mapDTO); - }); - }, - ), - ], + ), ), ), ], - ), ); } diff --git a/lib/Screens/Configurations/Section/SubSection/Parcours/parcours_config.dart b/lib/Screens/Configurations/Section/SubSection/Parcours/parcours_config.dart index 5c17cef..a8d1d60 100644 --- a/lib/Screens/Configurations/Section/SubSection/Parcours/parcours_config.dart +++ b/lib/Screens/Configurations/Section/SubSection/Parcours/parcours_config.dart @@ -13,7 +13,7 @@ class ParcoursConfig extends StatefulWidget { final List initialValue; final String parentId; final bool isEvent; - final bool isEscapeMode; + final bool isParcours; final ValueChanged> onChanged; const ParcoursConfig({ @@ -21,7 +21,7 @@ class ParcoursConfig extends StatefulWidget { required this.initialValue, required this.parentId, required this.isEvent, - this.isEscapeMode = false, + this.isParcours = false, required this.onChanged, }) : super(key: key); @@ -42,13 +42,13 @@ class _ParcoursConfigState extends State { Future _loadFromApi() async { final appContext = Provider.of(context, listen: false); - final api = (appContext.getContext() as ManagerAppContext) - .clientAPI! - .sectionMapApi!; + final clientAPI = (appContext.getContext() as ManagerAppContext).clientAPI!; try { - // Backend already includes steps + quiz questions via .Include() - final fetchedPaths = - await api.sectionMapGetAllGuidedPathFromSection(widget.parentId); + final fetchedPaths = widget.isParcours + ? await clientAPI.sectionParcoursApi! + .sectionParcoursGetAllGuidedPathFromSection(widget.parentId) + : await clientAPI.sectionMapApi! + .sectionMapGetAllGuidedPathFromSection(widget.parentId); if (fetchedPaths == null || !mounted) return; fetchedPaths.sort((a, b) => (a.order ?? 0).compareTo(b.order ?? 0)); @@ -82,27 +82,26 @@ class _ParcoursConfigState extends State { null, widget.parentId, widget.isEvent, - widget.isEscapeMode, (newPath) async { try { newPath.order = paths.length; newPath.instanceId = (appContext.getContext() as ManagerAppContext) .instanceId; - if (widget.isEscapeMode) { - newPath.sectionGameId = widget.parentId; + if (widget.isParcours) { + newPath.sectionParcoursId = widget.parentId; } else if (widget.isEvent) { newPath.sectionEventId = widget.parentId; } else { newPath.sectionMapId = widget.parentId; } - final createdPath = - await (appContext.getContext() as ManagerAppContext) - .clientAPI! - .sectionMapApi! - .sectionMapCreateGuidedPath( - widget.parentId, newPath); + final clientAPI = (appContext.getContext() as ManagerAppContext).clientAPI!; + final createdPath = widget.isParcours + ? await clientAPI.sectionParcoursApi! + .sectionParcoursCreateGuidedPath(widget.parentId, newPath) + : await clientAPI.sectionMapApi! + .sectionMapCreateGuidedPath(widget.parentId, newPath); if (createdPath != null) { if (mounted) { @@ -153,14 +152,12 @@ class _ParcoursConfigState extends State { final appContext = Provider.of(context, listen: false); - final api = (appContext.getContext() as ManagerAppContext) - .clientAPI! - .sectionMapApi!; + final clientAPI = (appContext.getContext() as ManagerAppContext).clientAPI!; try { - // Update all affected paths orders - await Future.wait( - paths.map((p) => api.sectionMapUpdateGuidedPath(p))); + await Future.wait(widget.isParcours + ? paths.map((p) => clientAPI.sectionParcoursApi!.sectionParcoursUpdateGuidedPath(p)) + : paths.map((p) => clientAPI.sectionMapApi!.sectionMapUpdateGuidedPath(p))); } catch (e) { showNotification( kError, @@ -204,16 +201,12 @@ class _ParcoursConfigState extends State { path, widget.parentId, widget.isEvent, - widget.isEscapeMode, (updatedPath) async { try { - final api = (appContext.getContext() - as ManagerAppContext) - .clientAPI! - .sectionMapApi!; - final result = - await api.sectionMapUpdateGuidedPath( - updatedPath); + final clientAPI = (appContext.getContext() as ManagerAppContext).clientAPI!; + final result = widget.isParcours + ? await clientAPI.sectionParcoursApi!.sectionParcoursUpdateGuidedPath(updatedPath) + : await clientAPI.sectionMapApi!.sectionMapUpdateGuidedPath(updatedPath); if (result != null) { if (mounted) { setState(() { @@ -249,11 +242,12 @@ class _ParcoursConfigState extends State { listen: false); try { if (path.id != null) { - await (appContext.getContext() - as ManagerAppContext) - .clientAPI! - .sectionMapApi! - .sectionMapDeleteGuidedPath(path.id!); + final clientAPI = (appContext.getContext() as ManagerAppContext).clientAPI!; + if (widget.isParcours) { + await clientAPI.sectionParcoursApi!.sectionParcoursDeleteGuidedPath(path.id!); + } else { + await clientAPI.sectionMapApi!.sectionMapDeleteGuidedPath(path.id!); + } } setState(() { diff --git a/lib/Screens/Configurations/Section/SubSection/Parcours/showNewOrUpdateGuidedPath.dart b/lib/Screens/Configurations/Section/SubSection/Parcours/showNewOrUpdateGuidedPath.dart index 7cc89db..7ca0e63 100644 --- a/lib/Screens/Configurations/Section/SubSection/Parcours/showNewOrUpdateGuidedPath.dart +++ b/lib/Screens/Configurations/Section/SubSection/Parcours/showNewOrUpdateGuidedPath.dart @@ -8,6 +8,9 @@ import 'package:manager_app/l10n/app_localizations.dart'; import 'package:manager_app/Components/rounded_button.dart'; import 'package:manager_app/Components/multi_string_input_container.dart'; import 'package:manager_app/Components/check_input_container.dart'; +import 'package:manager_app/Components/string_input_container.dart'; +import 'package:manager_app/Components/resource_input_container.dart'; +import 'package:manager_app/Components/reorderable_custom_list.dart'; import 'showNewOrUpdateGuidedStep.dart'; void showNewOrUpdateGuidedPath( @@ -15,7 +18,6 @@ void showNewOrUpdateGuidedPath( GuidedPathDTO? path, String parentId, bool isEvent, - bool isEscapeMode, FutureOr Function(GuidedPathDTO) onSave, ) { GuidedPathDTO workingPath = path != null @@ -28,6 +30,7 @@ void showNewOrUpdateGuidedPath( ); bool isSaving = false; + int stepsRevision = 0; showDialog( context: context, @@ -69,6 +72,15 @@ void showNewOrUpdateGuidedPath( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + // Image du parcours + ResourceInputContainer( + label: "Image :", + color: kPrimaryColor, + initialValue: workingPath.imageResourceId, + onChanged: (resourceDTO) => setState( + () => workingPath.imageResourceId = resourceDTO.id), + ), + SizedBox(height: 16), // Titre + Description côte à côte Row( children: [ @@ -140,6 +152,90 @@ void showNewOrUpdateGuidedPath( ), ], ), + SizedBox(height: 8), + SizedBox( + width: thirdWidth, + child: StringInputContainer( + label: "Durée estimée (min) :", + initialValue: workingPath.estimatedDurationMinutes?.toString() ?? "", + onChanged: (val) => setState(() => + workingPath.estimatedDurationMinutes = int.tryParse(val)), + ), + ), + Divider(height: 24), + // Mode jeu + CheckInputContainer( + label: "Mode jeu (escape game / chasse au trésor)", + isChecked: workingPath.isGameMode ?? false, + onChanged: (val) => + setState(() => workingPath.isGameMode = val), + ), + if (workingPath.isGameMode == true) ...[ + SizedBox(height: 8), + Row( + children: [ + Expanded( + child: MultiStringInputContainer( + label: "Message de début :", + modalLabel: "Message d'introduction du jeu", + color: kPrimaryColor, + initialValue: (workingPath.gameMessageDebut ?? []) + .map((t) => TranslationDTO(language: t.language, value: t.value)) + .toList(), + onGetResult: (val) { + setState(() { + workingPath.gameMessageDebut = val.map((t) { + final prev = (workingPath.gameMessageDebut ?? []).firstWhere( + (e) => e.language == t.language, + orElse: () => TranslationAndResourceDTO(), + ); + return TranslationAndResourceDTO( + language: t.language, + value: t.value, + resourceId: prev.resourceId, + resource: prev.resource, + ); + }).toList(); + }); + }, + maxLines: 2, + isTitle: false, + isHTML: true, + ), + ), + SizedBox(width: 20), + Expanded( + child: MultiStringInputContainer( + label: "Message de fin :", + modalLabel: "Message de félicitations du jeu", + color: kPrimaryColor, + initialValue: (workingPath.gameMessageFin ?? []) + .map((t) => TranslationDTO(language: t.language, value: t.value)) + .toList(), + onGetResult: (val) { + setState(() { + workingPath.gameMessageFin = val.map((t) { + final prev = (workingPath.gameMessageFin ?? []).firstWhere( + (e) => e.language == t.language, + orElse: () => TranslationAndResourceDTO(), + ); + return TranslationAndResourceDTO( + language: t.language, + value: t.value, + resourceId: prev.resourceId, + resource: prev.resource, + ); + }).toList(); + }); + }, + maxLines: 2, + isTitle: false, + isHTML: true, + ), + ), + ], + ), + ], Divider(height: 24), // Étapes Row( @@ -157,13 +253,16 @@ void showNewOrUpdateGuidedPath( context, null, workingPath.id ?? "temp", - isEscapeMode, + workingPath.isGameMode ?? false, (newStep) async { setState(() { + newStep.order = + workingPath.steps?.length ?? 0; workingPath.steps = [ ...(workingPath.steps ?? []), newStep ]; + stepsRevision++; }); }, ); @@ -182,12 +281,19 @@ void showNewOrUpdateGuidedPath( ), ) else - ListView.builder( + ReorderableCustomList( + key: ValueKey(stepsRevision), + items: workingPath.steps!, shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemCount: workingPath.steps!.length, - itemBuilder: (context, index) { - final step = workingPath.steps![index]; + onChanged: (updatedList) { + setState(() { + for (var i = 0; i < updatedList.length; i++) { + updatedList[i].order = i; + } + workingPath.steps = List.from(updatedList); + }); + }, + itemBuilder: (context, index, step) { return ListTile( leading: CircleAvatar(child: Text("${index + 1}")), @@ -202,43 +308,43 @@ void showNewOrUpdateGuidedPath( "${AppLocalizations.of(context)!.stepFallback} $index" : "${AppLocalizations.of(context)!.stepFallback} $index", ), - subtitle: isEscapeMode + subtitle: workingPath.isGameMode ?? false ? Text( "${step.quizQuestions?.length ?? 0} question(s)") : null, - trailing: Row( - mainAxisSize: MainAxisSize.min, - children: [ - IconButton( - icon: Icon(Icons.edit, - color: kPrimaryColor), - onPressed: () { - showNewOrUpdateGuidedStep( - context, - step, - workingPath.id ?? "temp", - isEscapeMode, - (updatedStep) async { - setState(() { - workingPath.steps![index] = - updatedStep; - }); - }, - ); - }, - ), - IconButton( - icon: Icon(Icons.delete, color: kError), - onPressed: () { - setState(() { - workingPath.steps!.removeAt(index); - }); - }, - ), - ], - ), ); }, + actions: [ + (context, index, step) => IconButton( + icon: Icon(Icons.edit, + color: kPrimaryColor), + onPressed: () { + showNewOrUpdateGuidedStep( + context, + step, + workingPath.id ?? "temp", + workingPath.isGameMode ?? false, + (updatedStep) async { + setState(() { + updatedStep.order = step.order; + workingPath.steps![index] = + updatedStep; + stepsRevision++; + }); + }, + ); + }, + ), + (context, index, step) => IconButton( + icon: Icon(Icons.delete, color: kError), + onPressed: () { + setState(() { + workingPath.steps!.removeAt(index); + stepsRevision++; + }); + }, + ), + ], ), ], ), diff --git a/lib/Screens/Configurations/Section/SubSection/Parcours/showNewOrUpdateGuidedStep.dart b/lib/Screens/Configurations/Section/SubSection/Parcours/showNewOrUpdateGuidedStep.dart index 773b043..f02bac6 100644 --- a/lib/Screens/Configurations/Section/SubSection/Parcours/showNewOrUpdateGuidedStep.dart +++ b/lib/Screens/Configurations/Section/SubSection/Parcours/showNewOrUpdateGuidedStep.dart @@ -1,14 +1,20 @@ import 'dart:async'; import 'dart:convert'; import 'package:flutter/material.dart'; +import 'package:flutter_widget_from_html/flutter_widget_from_html.dart'; import 'package:manager_api_new/api.dart'; import 'package:manager_app/Components/confirmation_dialog.dart'; import 'package:manager_app/Components/geometry_input_container.dart'; +import 'package:manager_app/Components/reorderable_custom_list.dart'; import 'package:manager_app/Components/multi_string_input_container.dart'; import 'package:manager_app/Components/rounded_button.dart'; import 'package:manager_app/Components/string_input_container.dart'; +import 'package:manager_app/Screens/Configurations/Section/SubSection/Slider/listView_card_image.dart'; +import 'package:manager_app/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart'; +import 'package:manager_app/app_context.dart'; import 'package:manager_app/constants.dart'; import 'package:manager_app/l10n/app_localizations.dart'; +import 'package:provider/provider.dart'; import 'showNewOrUpdateQuizQuestion.dart'; void showNewOrUpdateGuidedStep( @@ -25,10 +31,16 @@ void showNewOrUpdateGuidedStep( title: [], description: [], quizQuestions: [], + audioIds: [], + contents: [], order: 0, ); + workingStep.audioIds = List.from(workingStep.audioIds ?? []); + workingStep.contents = List.from(workingStep.contents ?? []); + workingStep.quizQuestions = List.from(workingStep.quizQuestions ?? []); bool isSaving = false; + int questionsRevision = 0; showDialog( context: context, @@ -41,6 +53,7 @@ void showNewOrUpdateGuidedStep( final double dialogWidth = screenWidth * 0.75; final double contentWidth = dialogWidth - 48; final double halfWidth = (contentWidth - 20) / 2; + final appCtx = Provider.of(context, listen: false); return Dialog( shape: @@ -110,6 +123,27 @@ void showNewOrUpdateGuidedStep( }); }, ), + SizedBox(height: 8), + SwitchListTile( + dense: true, + contentPadding: EdgeInsets.zero, + title: Text("Déclenchement géolocalisé"), + value: workingStep.isGeoTriggered ?? false, + onChanged: (val) => setState(() => workingStep.isGeoTriggered = val), + activeThumbColor: kPrimaryColor, + ), + if (workingStep.isGeoTriggered == true) ...[ + SizedBox(height: 8), + SizedBox( + width: halfWidth, + child: StringInputContainer( + label: "Rayon (mètres) :", + initialValue: workingStep.zoneRadiusMeters?.toString() ?? "", + onChanged: (val) => setState(() => + workingStep.zoneRadiusMeters = double.tryParse(val)), + ), + ), + ], Divider(height: 24), // Comportement de l'étape Text("Comportement", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15)), @@ -134,54 +168,75 @@ void showNewOrUpdateGuidedStep( activeThumbColor: kPrimaryColor, ), ), - Expanded( - child: SwitchListTile( - dense: true, - title: Text("Timer"), - value: workingStep.isStepTimer ?? false, - onChanged: (val) => setState(() => workingStep.isStepTimer = val), - activeThumbColor: kPrimaryColor, - ), + ], + ), + Divider(height: 24), + Text("Contenu riche", style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15)), + SizedBox(height: 8), + // Audio + MultiStringInputContainer( + label: "Audio :", + resourceTypes: [ResourceType.Audio], + modalLabel: "Audio du guide", + initialValue: workingStep.audioIds!, + onGetResult: (val) => setState(() => workingStep.audioIds = val.isEmpty ? null : val), + maxLines: 1, + isTitle: false, + isHTML: false, + ), + SizedBox(height: 12), + // Images + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text("Images :", style: TextStyle(fontSize: 14, fontWeight: FontWeight.w500)), + IconButton( + icon: Icon(Icons.add_circle_outline, color: kSuccess), + onPressed: () async { + final result = await showNewOrUpdateContentSlider(null, appCtx, context, true, false); + if (result != null) { + setState(() { + result.order = workingStep.contents!.length; + workingStep.contents = [...workingStep.contents!, result]; + }); + } + }, ), ], ), - if (workingStep.isStepTimer == true) ...[ - SizedBox(height: 8), - Row( - children: [ - SizedBox( - width: halfWidth, - child: StringInputContainer( - label: AppLocalizations.of(context)!.durationSecondsLabel, - initialValue: workingStep.timerSeconds?.toString() ?? "", - onChanged: (val) => setState(() => - workingStep.timerSeconds = int.tryParse(val)), - ), - ), - SizedBox(width: 20), - SizedBox( - width: halfWidth, - child: MultiStringInputContainer( - label: "Message d'expiration :", - modalLabel: "Message d'expiration du timer", - initialValue: workingStep.timerExpiredMessage ?? [], - onGetResult: (val) => setState(() => - workingStep.timerExpiredMessage = val.isEmpty ? null : val), - maxLines: 2, - isTitle: false, - isHTML: false, - ), - ), - ], + if (workingStep.contents!.isEmpty) + Padding( + padding: const EdgeInsets.only(bottom: 8), + child: Text( + "Aucune image — cliquez + pour en ajouter", + style: TextStyle(fontStyle: FontStyle.italic, color: Colors.grey[600], fontSize: 13), + ), + ) + else + SizedBox( + height: 250, + child: ReorderableListView( + scrollDirection: Axis.horizontal, + onReorderItem: (oldIndex, newIndex) { + setState(() { + final item = workingStep.contents!.removeAt(oldIndex); + workingStep.contents!.insert(newIndex, item); + for (var i = 0; i < workingStep.contents!.length; i++) { + workingStep.contents![i].order = i; + } + }); + }, + children: List.generate(workingStep.contents!.length, (i) => ListViewCardContent( + workingStep.contents!, + i, + Key('content_$i'), + appCtx, + (updated) => setState(() => workingStep.contents = List.from(updated)), + true, + false, + )), + ), ), - ], - SizedBox(height: 8), - StringInputContainer( - label: AppLocalizations.of(context)!.triggerGeopointLabel, - initialValue: workingStep.triggerGeoPointId?.toString() ?? "", - onChanged: (val) => setState(() => - workingStep.triggerGeoPointId = int.tryParse(val)), - ), // Questions — uniquement en mode Escape Game if (isEscapeMode) ...[ Divider(height: 24), @@ -203,11 +258,14 @@ void showNewOrUpdateGuidedStep( isEscapeMode, (newQuestion) { setState(() { + newQuestion.order = + workingStep.quizQuestions?.length ?? 0; workingStep.quizQuestions = [ ...(workingStep.quizQuestions ?? []), newQuestion ]; + questionsRevision++; }); }, ); @@ -215,6 +273,48 @@ void showNewOrUpdateGuidedStep( ), ], ), + SizedBox( + width: halfWidth, + child: SwitchListTile( + dense: true, + contentPadding: EdgeInsets.zero, + title: Text("Timer"), + value: workingStep.isStepTimer ?? false, + onChanged: (val) => setState(() => workingStep.isStepTimer = val), + activeThumbColor: kPrimaryColor, + ), + ), + if (workingStep.isStepTimer == true) ...[ + SizedBox(height: 8), + Row( + children: [ + SizedBox( + width: halfWidth, + child: StringInputContainer( + label: AppLocalizations.of(context)!.durationSecondsLabel, + initialValue: workingStep.timerSeconds?.toString() ?? "", + onChanged: (val) => setState(() => + workingStep.timerSeconds = int.tryParse(val)), + ), + ), + SizedBox(width: 20), + SizedBox( + width: halfWidth, + child: MultiStringInputContainer( + label: "Message d'expiration :", + modalLabel: "Message d'expiration du timer", + initialValue: workingStep.timerExpiredMessage ?? [], + onGetResult: (val) => setState(() => + workingStep.timerExpiredMessage = val.isEmpty ? null : val), + maxLines: 2, + isTitle: false, + isHTML: true, + ), + ), + ], + ), + SizedBox(height: 8), + ], if (workingStep.quizQuestions == null || workingStep.quizQuestions!.isEmpty) Padding( @@ -228,65 +328,77 @@ void showNewOrUpdateGuidedStep( ), ) else - ListView.builder( + ReorderableCustomList( + key: ValueKey(questionsRevision), + items: workingStep.quizQuestions!, shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemCount: workingStep.quizQuestions!.length, - itemBuilder: (context, qIndex) { - final question = - workingStep.quizQuestions![qIndex]; + onChanged: (updatedList) { + setState(() { + for (var i = 0; i < updatedList.length; i++) { + updatedList[i].order = i; + } + workingStep.quizQuestions = + List.from(updatedList); + }); + }, + itemBuilder: (context, qIndex, question) { return ListTile( dense: true, - title: Text(question.label.isNotEmpty - ? question.label - .firstWhere( - (t) => t.language == 'FR', - orElse: () => - question.label[0]) - .value ?? - "Question $qIndex" - : "Question $qIndex"), + title: HtmlWidget( + question.label.isNotEmpty + ? question.label + .firstWhere( + (t) => t.language == 'FR', + orElse: () => + question.label[0]) + .value ?? + "Question $qIndex" + : "Question $qIndex", + textStyle: TextStyle(fontSize: 14), + ), subtitle: Text( "Type: ${question.validationQuestionType?.value == 2 ? 'Puzzle' : question.validationQuestionType?.value == 1 ? 'QCM' : 'Texte'}"), - trailing: Row( - mainAxisSize: MainAxisSize.min, - children: [ - IconButton( - icon: Icon(Icons.edit, - size: 18, color: kPrimaryColor), - onPressed: () { - showNewOrUpdateQuizQuestion( - context, - question, - workingStep.id ?? "temp", - isEscapeMode, - (updatedQuestion) { - setState(() { - workingStep.quizQuestions![ - qIndex] = updatedQuestion; - }); - }, - ); - }, - ), - IconButton( - icon: Icon(Icons.delete, - size: 18, color: kError), - onPressed: () { - showConfirmationDialog( - "Supprimer cette question ?", - () {}, - () => setState(() => workingStep - .quizQuestions! - .removeAt(qIndex)), - context, - ); - }, - ), - ], - ), ); }, + actions: [ + (context, qIndex, question) => IconButton( + icon: Icon(Icons.edit, + size: 18, color: kPrimaryColor), + onPressed: () { + showNewOrUpdateQuizQuestion( + context, + question, + workingStep.id ?? "temp", + isEscapeMode, + (updatedQuestion) { + setState(() { + updatedQuestion.order = + question.order; + workingStep.quizQuestions![ + qIndex] = updatedQuestion; + questionsRevision++; + }); + }, + ); + }, + ), + (context, qIndex, question) => IconButton( + icon: Icon(Icons.delete, + size: 18, color: kError), + onPressed: () { + showConfirmationDialog( + "Supprimer cette question ?", + () {}, + () => setState(() { + workingStep.quizQuestions! + .removeAt(qIndex); + questionsRevision++; + }), + context, + ); + }, + ), + ], ), ], ], @@ -320,6 +432,15 @@ void showNewOrUpdateGuidedStep( workingStep.isHiddenInitially ??= false; workingStep.isStepTimer ??= false; workingStep.isStepLocked ??= false; + workingStep.isGeoTriggered ??= false; + if (workingStep.isGeoTriggered != true) { + workingStep.zoneRadiusMeters = null; + } + if (!isEscapeMode) { + workingStep.isStepTimer = false; + workingStep.timerSeconds = null; + workingStep.timerExpiredMessage = null; + } try { await onSave(workingStep); if (context.mounted) Navigator.pop(context); diff --git a/lib/Screens/Configurations/Section/SubSection/SectionParcours/section_parcours_config.dart b/lib/Screens/Configurations/Section/SubSection/SectionParcours/section_parcours_config.dart new file mode 100644 index 0000000..86c9007 --- /dev/null +++ b/lib/Screens/Configurations/Section/SubSection/SectionParcours/section_parcours_config.dart @@ -0,0 +1,127 @@ +import 'package:flutter/material.dart'; +import 'package:manager_api_new/api.dart'; +import 'package:provider/provider.dart'; +import 'package:manager_app/app_context.dart'; +import 'package:manager_app/Models/managerContext.dart'; +import 'package:manager_app/Components/check_input_container.dart'; +import 'package:manager_app/Screens/Configurations/Section/SubSection/Parcours/parcours_config.dart'; + +class SectionParcoursConfig extends StatefulWidget { + final ParcoursDTO initialValue; + final ValueChanged onChanged; + + const SectionParcoursConfig({ + Key? key, + required this.initialValue, + required this.onChanged, + }) : super(key: key); + + @override + _SectionParcoursConfigState createState() => _SectionParcoursConfigState(); +} + +class _SectionParcoursConfigState extends State { + late ParcoursDTO parcoursDTO; + List availableMaps = []; + + @override + void initState() { + super.initState(); + parcoursDTO = widget.initialValue; + WidgetsBinding.instance.addPostFrameCallback((_) => _loadAvailableMaps()); + } + + Future _loadAvailableMaps() async { + if (parcoursDTO.configurationId == null || !mounted) return; + final appContext = Provider.of(context, listen: false); + final api = (appContext.getContext() as ManagerAppContext).clientAPI!.sectionApi!; + try { + final sections = await api.sectionGetFromConfiguration(parcoursDTO.configurationId!); + if (sections == null || !mounted) return; + setState(() { + availableMaps = sections.where((s) => s.type == SectionType.Map).toList(); + }); + } catch (e) { + // Silently keep empty on error + } + } + + @override + Widget build(BuildContext context) { + return Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // ── Options carte ── + Padding( + padding: const EdgeInsets.fromLTRB(16, 16, 16, 0), + child: Row( + children: [ + Expanded( + child: CheckInputContainer( + label: "Afficher la carte", + isChecked: parcoursDTO.showMap ?? true, + onChanged: (val) { + setState(() => parcoursDTO.showMap = val); + widget.onChanged(parcoursDTO); + }, + ), + ), + if (parcoursDTO.showMap == true && availableMaps.isNotEmpty) + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text("Carte de base (optionnel)", + style: TextStyle(fontWeight: FontWeight.w500)), + DropdownButton( + isExpanded: true, + value: parcoursDTO.baseSectionMapId, + items: [ + DropdownMenuItem( + value: null, child: Text("Aucune")), + ...availableMaps.map((m) => DropdownMenuItem( + value: m.id, + child: Text(m.label ?? m.id ?? ''))), + ], + onChanged: (val) { + setState(() => parcoursDTO.baseSectionMapId = val); + widget.onChanged(parcoursDTO); + }, + ), + ], + ), + ), + ), + ], + ), + ), + // ── Liste des parcours ── + if (parcoursDTO.id != null) + SizedBox( + height: 500, + child: ParcoursConfig( + initialValue: parcoursDTO.guidedPaths ?? [], + parentId: parcoursDTO.id!, + isEvent: false, + isParcours: true, + onChanged: (paths) { + setState(() => parcoursDTO.guidedPaths = paths); + widget.onChanged(parcoursDTO); + }, + ), + ) + else + Padding( + padding: const EdgeInsets.all(16), + child: Text( + "Sauvegardez d'abord la section pour gérer les parcours.", + style: TextStyle(fontStyle: FontStyle.italic, color: Colors.grey[600]), + ), + ), + ], + ); + } +} diff --git a/lib/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart b/lib/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart index 504a449..6feb7cb 100644 --- a/lib/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart +++ b/lib/Screens/Configurations/Section/SubSection/Slider/new_update_image_slider.dart @@ -38,8 +38,11 @@ Future showNewOrUpdateContentSlider(ContentDTO? inputContentDTO, Ap shape: RoundedRectangleBorder( borderRadius: BorderRadius.all(Radius.circular(20.0)) ), - child: SizedBox( - width: 480, + child: ConstrainedBox( + constraints: BoxConstraints( + maxWidth: 480, + maxHeight: size.height * 0.85, + ), child: Padding( padding: const EdgeInsets.fromLTRB(24, 20, 24, 24), child: Column( diff --git a/lib/Screens/Configurations/Section/section_detail_screen.dart b/lib/Screens/Configurations/Section/section_detail_screen.dart index f7b7fc1..bfc33fd 100644 --- a/lib/Screens/Configurations/Section/section_detail_screen.dart +++ b/lib/Screens/Configurations/Section/section_detail_screen.dart @@ -40,6 +40,7 @@ import 'dart:html' as html; import 'SubSection/Weather/weather_config.dart'; import 'SubSection/Event/event_config.dart'; +import 'SubSection/SectionParcours/section_parcours_config.dart'; class SectionDetailScreen extends StatefulWidget { final String id; @@ -459,6 +460,11 @@ class _SectionDetailScreenState extends State { .sectionUpdate(sectionDetailDTO!); SectionDTO? section = SectionDTO.fromJson(sectionResult); + setState(() { + sectionDetailDTO = null; + _sectionFuture = Future.value(sectionResult); + }); + ManagerAppContext managerAppContext = appContext.getContext(); managerAppContext.selectedSection = section; appContext.setContext(managerAppContext); @@ -561,6 +567,13 @@ class _SectionDetailScreenState extends State { sectionDetailDTO = updatedEvent; }, ); + case SectionType.Parcours: + return SectionParcoursConfig( + initialValue: sectionDetailDTO as ParcoursDTO, + onChanged: (ParcoursDTO updatedParcours) { + sectionDetailDTO = updatedParcours; + }, + ); } } @@ -605,6 +618,9 @@ class _SectionDetailScreenState extends State { case SectionType.Event: sectionDetailDTO = SectionEventDTO.fromJson(rawSectionData)!; break; + case SectionType.Parcours: + sectionDetailDTO = ParcoursDTO.fromJson(rawSectionData)!; + break; } } @@ -852,6 +868,26 @@ class _SectionDetailScreenState extends State { (sectionDetailDTO as SectionEventDTO).longitude = sectionDTO.longitude; (sectionDetailDTO as SectionEventDTO).meterZoneGPS = sectionDTO.meterZoneGPS; break; + case SectionType.Parcours: + (sectionDetailDTO as ParcoursDTO).id = sectionDTO.id; + (sectionDetailDTO as ParcoursDTO).order = sectionDTO.order; + (sectionDetailDTO as ParcoursDTO).dateCreation = sectionDTO.dateCreation; + (sectionDetailDTO as ParcoursDTO).type = sectionDTO.type; + (sectionDetailDTO as ParcoursDTO).instanceId = sectionDTO.instanceId; + (sectionDetailDTO as ParcoursDTO).configurationId = sectionDTO.configurationId; + (sectionDetailDTO as ParcoursDTO).isSubSection = sectionDTO.isSubSection; + (sectionDetailDTO as ParcoursDTO).parentId = sectionDTO.parentId; + (sectionDetailDTO as ParcoursDTO).label = sectionDTO.label; + (sectionDetailDTO as ParcoursDTO).title = sectionDTO.title; + (sectionDetailDTO as ParcoursDTO).description = sectionDTO.description; + (sectionDetailDTO as ParcoursDTO).imageId = sectionDTO.imageId; + (sectionDetailDTO as ParcoursDTO).imageSource = sectionDTO.imageSource; + (sectionDetailDTO as ParcoursDTO).isBeacon = sectionDTO.isBeacon; + (sectionDetailDTO as ParcoursDTO).beaconId = sectionDTO.beaconId; + (sectionDetailDTO as ParcoursDTO).latitude = sectionDTO.latitude; + (sectionDetailDTO as ParcoursDTO).longitude = sectionDTO.longitude; + (sectionDetailDTO as ParcoursDTO).meterZoneGPS = sectionDTO.meterZoneGPS; + break; } } } diff --git a/lib/Screens/Configurations/configuration_detail_screen.dart b/lib/Screens/Configurations/configuration_detail_screen.dart index a90be77..05290fe 100644 --- a/lib/Screens/Configurations/configuration_detail_screen.dart +++ b/lib/Screens/Configurations/configuration_detail_screen.dart @@ -10,6 +10,7 @@ import 'package:manager_app/Components/common_loader.dart'; import 'package:manager_app/Components/message_notification.dart'; import 'package:manager_app/l10n/app_localizations.dart'; import 'package:manager_app/Components/multi_select_dropdown_language_container.dart'; +import 'package:manager_app/Components/multi_string_input_container.dart'; import 'package:manager_app/Components/string_input_container.dart'; import 'package:manager_app/Helpers/FileHelper.dart'; import 'package:manager_app/Models/managerContext.dart'; @@ -191,6 +192,17 @@ class _ConfigurationDetailScreenState extends State { onChanged: (value) => config.label = value, ), const SizedBox(height: 12), + MultiStringInputContainer( + label: l.displayTitleLabel, + modalLabel: l.messageTitle, + initialValue: config.title ?? [], + isTitle: true, + isHTML: true, + isMandatory: false, + maxLines: 1, + onGetResult: (value) => config.title = value, + ), + const SizedBox(height: 12), Wrap( spacing: 24, runSpacing: 12, diff --git a/lib/client.dart b/lib/client.dart index d81c563..023fa77 100644 --- a/lib/client.dart +++ b/lib/client.dart @@ -41,6 +41,9 @@ class Client { SectionEventApi? _sectionEventApi; SectionEventApi? get sectionEventApi => _sectionEventApi; + SectionParcoursApi? _sectionParcoursApi; + SectionParcoursApi? get sectionParcoursApi => _sectionParcoursApi; + StatsApi? _statsApi; StatsApi? get statsApi => _statsApi; @@ -70,6 +73,7 @@ class Client { _sectionQuizApi = SectionQuizApi(_apiClient); _sectionAgendaApi = SectionAgendaApi(_apiClient); _sectionEventApi = SectionEventApi(_apiClient); + _sectionParcoursApi = SectionParcoursApi(_apiClient); _statsApi = StatsApi(_apiClient); _apiKeyApi = ApiKeyApi(_apiClient); _notificationApi = NotificationApi(_apiClient); diff --git a/lib/constants.dart b/lib/constants.dart index 094e195..4cca4f8 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -44,7 +44,7 @@ const kSectionLabelStyle = TextStyle( color: kTitleTextColor, ); -const List section_types = ["Map", "Slider", "Video", "Web", "Menu", "Quiz", "Article", "PDF", "Game", "Agenda", "Weather", "Event"]; +const List section_types = ["Map", "Slider", "Video", "Web", "Menu", "Quiz", "Article", "PDF", "Game", "Agenda", "Weather", "Event", "Parcours"]; 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"]; diff --git a/manager_api_new/doc/GuidedStepDTOTriggerGeoPoint.md b/manager_api_new/doc/GuidedStepDTOTriggerGeoPoint.md deleted file mode 100644 index c7c9628..0000000 --- a/manager_api_new/doc/GuidedStepDTOTriggerGeoPoint.md +++ /dev/null @@ -1,30 +0,0 @@ -# manager_api_new.model.GuidedStepDTOTriggerGeoPoint - -## Load the model package -```dart -import 'package:manager_api_new/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | [optional] -**title** | [**List**](TranslationDTO.md) | | [optional] [default to const []] -**description** | [**List**](TranslationDTO.md) | | [optional] [default to const []] -**contents** | [**List**](ContentDTO.md) | | [optional] [default to const []] -**categorieId** | **int** | | [optional] -**imageResourceId** | **String** | | [optional] -**imageUrl** | **String** | | [optional] -**schedules** | [**List**](TranslationDTO.md) | | [optional] [default to const []] -**prices** | [**List**](TranslationDTO.md) | | [optional] [default to const []] -**phone** | [**List**](TranslationDTO.md) | | [optional] [default to const []] -**email** | [**List**](TranslationDTO.md) | | [optional] [default to const []] -**site** | [**List**](TranslationDTO.md) | | [optional] [default to const []] -**geometry** | [**EventAddressDTOGeometry**](EventAddressDTOGeometry.md) | | [optional] -**polyColor** | **String** | | [optional] -**sectionMapId** | **String** | | [optional] -**sectionEventId** | **String** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/manager_api_new/doc/GuidedStepTriggerGeoPoint.md b/manager_api_new/doc/GuidedStepTriggerGeoPoint.md deleted file mode 100644 index 3f0aa0f..0000000 --- a/manager_api_new/doc/GuidedStepTriggerGeoPoint.md +++ /dev/null @@ -1,32 +0,0 @@ -# manager_api_new.model.GuidedStepTriggerGeoPoint - -## Load the model package -```dart -import 'package:manager_api_new/api.dart'; -``` - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **int** | | -**title** | [**List**](TranslationDTO.md) | | [default to const []] -**description** | [**List**](TranslationDTO.md) | | [default to const []] -**contents** | [**List**](ContentDTO.md) | | [default to const []] -**schedules** | [**List**](TranslationDTO.md) | | [default to const []] -**prices** | [**List**](TranslationDTO.md) | | [default to const []] -**phone** | [**List**](TranslationDTO.md) | | [default to const []] -**email** | [**List**](TranslationDTO.md) | | [default to const []] -**site** | [**List**](TranslationDTO.md) | | [default to const []] -**categorieId** | **int** | | [optional] -**geometry** | [**PointAllOfBoundary**](PointAllOfBoundary.md) | | [optional] -**polyColor** | **String** | | [optional] -**imageResourceId** | **String** | | [optional] -**imageUrl** | **String** | | [optional] -**sectionMapId** | **String** | | [optional] -**sectionMap** | [**GuidedPathSectionMap**](GuidedPathSectionMap.md) | | [optional] -**sectionEventId** | **String** | | [optional] -**sectionEvent** | [**ApplicationInstanceSectionEvent**](ApplicationInstanceSectionEvent.md) | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/manager_api_new/lib/api.dart b/manager_api_new/lib/api.dart index d114962..259213a 100644 --- a/manager_api_new/lib/api.dart +++ b/manager_api_new/lib/api.dart @@ -41,6 +41,7 @@ part 'api/section_api.dart'; part 'api/section_agenda_api.dart'; part 'api/section_event_api.dart'; part 'api/section_map_api.dart'; +part 'api/section_parcours_api.dart'; part 'api/section_quiz_api.dart'; part 'api/notification_api.dart'; part 'api/stats_api.dart'; @@ -112,9 +113,7 @@ part 'model/guided_path_section_game.dart'; part 'model/guided_path_section_map.dart'; part 'model/guided_step.dart'; part 'model/guided_step_dto.dart'; -part 'model/guided_step_dto_trigger_geo_point.dart'; part 'model/guided_step_guided_path.dart'; -part 'model/guided_step_trigger_geo_point.dart'; part 'model/instance.dart'; part 'model/instance_dto.dart'; part 'model/instance_quota_dto.dart'; @@ -167,6 +166,7 @@ part 'model/section_dto.dart'; part 'model/section_event.dart'; part 'model/section_event_dto.dart'; part 'model/section_game.dart'; +part 'model/parcours_dto.dart'; part 'model/section_game_all_of_game_puzzle_image.dart'; part 'model/section_map.dart'; part 'model/section_map_all_of_map_map_provider.dart'; diff --git a/manager_api_new/lib/api/section_parcours_api.dart b/manager_api_new/lib/api/section_parcours_api.dart new file mode 100644 index 0000000..7cde522 --- /dev/null +++ b/manager_api_new/lib/api/section_parcours_api.dart @@ -0,0 +1,386 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class SectionParcoursApi { + SectionParcoursApi([ApiClient? apiClient]) + : apiClient = apiClient ?? defaultApiClient; + + final ApiClient apiClient; + + /// Performs an HTTP 'GET /api/SectionParcours/{sectionParcoursId}/guided-path' operation and returns the [Response]. + Future sectionParcoursGetAllGuidedPathFromSectionWithHttpInfo( + String sectionParcoursId, + ) async { + // ignore: prefer_const_declarations + final path = r'/api/SectionParcours/{sectionParcoursId}/guided-path' + .replaceAll('{sectionParcoursId}', sectionParcoursId); + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = []; + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + Future?> sectionParcoursGetAllGuidedPathFromSection( + String sectionParcoursId, + ) async { + final response = + await sectionParcoursGetAllGuidedPathFromSectionWithHttpInfo( + sectionParcoursId, + ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + if (response.body.isNotEmpty && + response.statusCode != HttpStatus.noContent) { + final responseBody = await _decodeBodyBytes(response); + return (await apiClient.deserializeAsync(responseBody, 'List') as List) + .cast() + .toList(growable: false); + } + return null; + } + + /// Performs an HTTP 'POST /api/SectionParcours/{sectionParcoursId}/guided-path' operation and returns the [Response]. + Future sectionParcoursCreateGuidedPathWithHttpInfo( + String sectionParcoursId, + GuidedPathDTO guidedPathDTO, + ) async { + // ignore: prefer_const_declarations + final path = r'/api/SectionParcours/{sectionParcoursId}/guided-path' + .replaceAll('{sectionParcoursId}', sectionParcoursId); + + // ignore: prefer_final_locals + Object? postBody = guidedPathDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = ['application/json']; + + return apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + Future sectionParcoursCreateGuidedPath( + String sectionParcoursId, + GuidedPathDTO guidedPathDTO, + ) async { + final response = await sectionParcoursCreateGuidedPathWithHttpInfo( + sectionParcoursId, + guidedPathDTO, + ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + if (response.body.isNotEmpty && + response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync( + await _decodeBodyBytes(response), + 'GuidedPathDTO', + ) as GuidedPathDTO; + } + return null; + } + + /// Performs an HTTP 'PUT /api/SectionParcours/guided-path' operation and returns the [Response]. + Future sectionParcoursUpdateGuidedPathWithHttpInfo( + GuidedPathDTO guidedPathDTO, + ) async { + // ignore: prefer_const_declarations + final path = r'/api/SectionParcours/guided-path'; + + // ignore: prefer_final_locals + Object? postBody = guidedPathDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = ['application/json']; + + return apiClient.invokeAPI( + path, + 'PUT', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + Future sectionParcoursUpdateGuidedPath( + GuidedPathDTO guidedPathDTO, + ) async { + final response = await sectionParcoursUpdateGuidedPathWithHttpInfo( + guidedPathDTO, + ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + if (response.body.isNotEmpty && + response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync( + await _decodeBodyBytes(response), + 'GuidedPathDTO', + ) as GuidedPathDTO; + } + return null; + } + + /// Performs an HTTP 'DELETE /api/SectionParcours/guided-path/{guidedPathId}' operation and returns the [Response]. + Future sectionParcoursDeleteGuidedPathWithHttpInfo( + String guidedPathId, + ) async { + // ignore: prefer_const_declarations + final path = r'/api/SectionParcours/guided-path/{guidedPathId}' + .replaceAll('{guidedPathId}', guidedPathId); + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = []; + + return apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + Future sectionParcoursDeleteGuidedPath( + String guidedPathId, + ) async { + final response = await sectionParcoursDeleteGuidedPathWithHttpInfo( + guidedPathId, + ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + } + + /// Performs an HTTP 'GET /api/SectionParcours/guided-path/{guidedPathId}/guided-step' operation and returns the [Response]. + Future sectionParcoursGetAllGuidedStepFromGuidedPathWithHttpInfo( + String guidedPathId, + ) async { + // ignore: prefer_const_declarations + final path = + r'/api/SectionParcours/guided-path/{guidedPathId}/guided-step' + .replaceAll('{guidedPathId}', guidedPathId); + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = []; + + return apiClient.invokeAPI( + path, + 'GET', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + Future?> sectionParcoursGetAllGuidedStepFromGuidedPath( + String guidedPathId, + ) async { + final response = + await sectionParcoursGetAllGuidedStepFromGuidedPathWithHttpInfo( + guidedPathId, + ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + if (response.body.isNotEmpty && + response.statusCode != HttpStatus.noContent) { + final responseBody = await _decodeBodyBytes(response); + return (await apiClient.deserializeAsync(responseBody, 'List') as List) + .cast() + .toList(growable: false); + } + return null; + } + + /// Performs an HTTP 'POST /api/SectionParcours/guided-path/{guidedPathId}/guided-step' operation and returns the [Response]. + Future sectionParcoursCreateGuidedStepWithHttpInfo( + String guidedPathId, + GuidedStepDTO guidedStepDTO, + ) async { + // ignore: prefer_const_declarations + final path = + r'/api/SectionParcours/guided-path/{guidedPathId}/guided-step' + .replaceAll('{guidedPathId}', guidedPathId); + + // ignore: prefer_final_locals + Object? postBody = guidedStepDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = ['application/json']; + + return apiClient.invokeAPI( + path, + 'POST', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + Future sectionParcoursCreateGuidedStep( + String guidedPathId, + GuidedStepDTO guidedStepDTO, + ) async { + final response = await sectionParcoursCreateGuidedStepWithHttpInfo( + guidedPathId, + guidedStepDTO, + ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + if (response.body.isNotEmpty && + response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync( + await _decodeBodyBytes(response), + 'GuidedStepDTO', + ) as GuidedStepDTO; + } + return null; + } + + /// Performs an HTTP 'PUT /api/SectionParcours/guided-step' operation and returns the [Response]. + Future sectionParcoursUpdateGuidedStepWithHttpInfo( + GuidedStepDTO guidedStepDTO, + ) async { + // ignore: prefer_const_declarations + final path = r'/api/SectionParcours/guided-step'; + + // ignore: prefer_final_locals + Object? postBody = guidedStepDTO; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = ['application/json']; + + return apiClient.invokeAPI( + path, + 'PUT', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + Future sectionParcoursUpdateGuidedStep( + GuidedStepDTO guidedStepDTO, + ) async { + final response = await sectionParcoursUpdateGuidedStepWithHttpInfo( + guidedStepDTO, + ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + if (response.body.isNotEmpty && + response.statusCode != HttpStatus.noContent) { + return await apiClient.deserializeAsync( + await _decodeBodyBytes(response), + 'GuidedStepDTO', + ) as GuidedStepDTO; + } + return null; + } + + /// Performs an HTTP 'DELETE /api/SectionParcours/guided-step/{guidedStepId}' operation and returns the [Response]. + Future sectionParcoursDeleteGuidedStepWithHttpInfo( + String guidedStepId, + ) async { + // ignore: prefer_const_declarations + final path = r'/api/SectionParcours/guided-step/{guidedStepId}' + .replaceAll('{guidedStepId}', guidedStepId); + + // ignore: prefer_final_locals + Object? postBody; + + final queryParams = []; + final headerParams = {}; + final formParams = {}; + + const contentTypes = []; + + return apiClient.invokeAPI( + path, + 'DELETE', + queryParams, + postBody, + headerParams, + formParams, + contentTypes.isEmpty ? null : contentTypes.first, + ); + } + + Future sectionParcoursDeleteGuidedStep( + String guidedStepId, + ) async { + final response = await sectionParcoursDeleteGuidedStepWithHttpInfo( + guidedStepId, + ); + if (response.statusCode >= HttpStatus.badRequest) { + throw ApiException(response.statusCode, await _decodeBodyBytes(response)); + } + } +} diff --git a/manager_api_new/lib/api_client.dart b/manager_api_new/lib/api_client.dart index 53bdd11..8fd21d3 100644 --- a/manager_api_new/lib/api_client.dart +++ b/manager_api_new/lib/api_client.dart @@ -353,12 +353,8 @@ class ApiClient { return GuidedStep.fromJson(value); case 'GuidedStepDTO': return GuidedStepDTO.fromJson(value); - case 'GuidedStepDTOTriggerGeoPoint': - return GuidedStepDTOTriggerGeoPoint.fromJson(value); case 'GuidedStepGuidedPath': return GuidedStepGuidedPath.fromJson(value); - case 'GuidedStepTriggerGeoPoint': - return GuidedStepTriggerGeoPoint.fromJson(value); case 'Instance': return Instance.fromJson(value); case 'InstanceDTO': diff --git a/manager_api_new/lib/model/ai_chat_request.dart b/manager_api_new/lib/model/ai_chat_request.dart index 7518e05..5f1fd79 100644 --- a/manager_api_new/lib/model/ai_chat_request.dart +++ b/manager_api_new/lib/model/ai_chat_request.dart @@ -19,6 +19,7 @@ class AiChatRequest { this.configurationId, this.language, this.history = const [], + this.isVoice = false, }); String? message; @@ -39,6 +40,9 @@ class AiChatRequest { List? history; + /// true = interaction vocale (lunettes) — prompt audio-friendly, pas de navigation + bool? isVoice; + @override bool operator ==(Object other) => identical(this, other) || @@ -96,6 +100,7 @@ class AiChatRequest { } else { json[r'history'] = null; } + json[r'isVoice'] = this.isVoice ?? false; return json; } diff --git a/manager_api_new/lib/model/ai_chat_response.dart b/manager_api_new/lib/model/ai_chat_response.dart index 461c8cf..1d593b7 100644 --- a/manager_api_new/lib/model/ai_chat_response.dart +++ b/manager_api_new/lib/model/ai_chat_response.dart @@ -16,6 +16,7 @@ class AiChatResponse { this.reply, this.cards = const [], this.navigation, + this.expectsReply = true, }); String? reply; @@ -24,24 +25,28 @@ class AiChatResponse { AiChatResponseNavigation? navigation; + bool? expectsReply; + @override bool operator ==(Object other) => identical(this, other) || other is AiChatResponse && other.reply == reply && _deepEquality.equals(other.cards, cards) && - other.navigation == navigation; + other.navigation == navigation && + other.expectsReply == expectsReply; @override int get hashCode => // ignore: unnecessary_parenthesis (reply == null ? 0 : reply!.hashCode) + (cards == null ? 0 : cards!.hashCode) + - (navigation == null ? 0 : navigation!.hashCode); + (navigation == null ? 0 : navigation!.hashCode) + + (expectsReply == null ? 0 : expectsReply!.hashCode); @override String toString() => - 'AiChatResponse[reply=$reply, cards=$cards, navigation=$navigation]'; + 'AiChatResponse[reply=$reply, cards=$cards, navigation=$navigation, expectsReply=$expectsReply]'; Map toJson() { final json = {}; @@ -60,6 +65,7 @@ class AiChatResponse { } else { json[r'navigation'] = null; } + json[r'expectsReply'] = this.expectsReply; return json; } @@ -87,6 +93,7 @@ class AiChatResponse { reply: mapValueOfType(json, r'reply'), cards: AiCardDTO.listFromJson(json[r'cards']), navigation: AiChatResponseNavigation.fromJson(json[r'navigation']), + expectsReply: mapValueOfType(json, r'expectsReply') ?? true, ); } return null; diff --git a/manager_api_new/lib/model/app_type.dart b/manager_api_new/lib/model/app_type.dart index 7779efc..afd7883 100644 --- a/manager_api_new/lib/model/app_type.dart +++ b/manager_api_new/lib/model/app_type.dart @@ -10,7 +10,7 @@ part of openapi.api; -/// 0 = Mobile 1 = Tablet 2 = Web 3 = VR +/// 0 = Mobile 1 = Tablet 2 = Web 3 = VR 4 = Voice (lunettes / interface vocale) class AppType { /// Instantiate a new enum with the provided [value]. const AppType._(this.value); @@ -27,6 +27,7 @@ class AppType { static const Tablet = AppType._(1); static const Web = AppType._(2); static const VR = AppType._(3); + static const Voice = AppType._(4); // Lunettes Ray-Ban Meta / interface vocale /// List of all possible values in this [enum][AppType]. static const values = [ @@ -34,6 +35,7 @@ class AppType { Tablet, Web, VR, + Voice, ]; static AppType? fromJson(dynamic value) => @@ -82,6 +84,7 @@ class AppTypeTypeTransformer { case r'Tablet': return AppType.Tablet; case r'Web': return AppType.Web; case r'VR': return AppType.VR; + case r'Voice': return AppType.Voice; default: if (!allowNull) { throw ArgumentError('Unknown enum value to decode: $data'); @@ -94,6 +97,7 @@ class AppTypeTypeTransformer { case 1: return AppType.Tablet; case 2: return AppType.Web; case 3: return AppType.VR; + case 4: return AppType.Voice; default: if (!allowNull) { throw ArgumentError('Unknown enum value to decode: $data'); diff --git a/manager_api_new/lib/model/game_dto.dart b/manager_api_new/lib/model/game_dto.dart index e1bf2f2..94c24da 100644 --- a/manager_api_new/lib/model/game_dto.dart +++ b/manager_api_new/lib/model/game_dto.dart @@ -39,7 +39,6 @@ class GameDTO { this.rows, this.cols, this.gameType, - this.guidedPaths = const [], }); String? id; @@ -136,8 +135,6 @@ class GameDTO { /// GameTypes? gameType; - List? guidedPaths; - @override bool operator ==(Object other) => identical(this, other) || @@ -167,8 +164,7 @@ class GameDTO { other.puzzleImageId == puzzleImageId && other.rows == rows && other.cols == cols && - other.gameType == gameType && - _deepEquality.equals(other.guidedPaths, guidedPaths); + other.gameType == gameType; @override int get hashCode => @@ -198,12 +194,11 @@ class GameDTO { (puzzleImageId == null ? 0 : puzzleImageId!.hashCode) + (rows == null ? 0 : rows!.hashCode) + (cols == null ? 0 : cols!.hashCode) + - (gameType == null ? 0 : gameType!.hashCode) + - (guidedPaths == null ? 0 : guidedPaths!.hashCode); + (gameType == null ? 0 : gameType!.hashCode); @override String toString() => - 'GameDTO[id=$id, label=$label, title=$title, description=$description, isActive=$isActive, imageId=$imageId, imageSource=$imageSource, configurationId=$configurationId, isSubSection=$isSubSection, parentId=$parentId, type=$type, dateCreation=$dateCreation, order=$order, instanceId=$instanceId, latitude=$latitude, longitude=$longitude, meterZoneGPS=$meterZoneGPS, isBeacon=$isBeacon, beaconId=$beaconId, messageDebut=$messageDebut, messageFin=$messageFin, puzzleImage=$puzzleImage, puzzleImageId=$puzzleImageId, rows=$rows, cols=$cols, gameType=$gameType, guidedPaths=$guidedPaths]'; + 'GameDTO[id=$id, label=$label, title=$title, description=$description, isActive=$isActive, imageId=$imageId, imageSource=$imageSource, configurationId=$configurationId, isSubSection=$isSubSection, parentId=$parentId, type=$type, dateCreation=$dateCreation, order=$order, instanceId=$instanceId, latitude=$latitude, longitude=$longitude, meterZoneGPS=$meterZoneGPS, isBeacon=$isBeacon, beaconId=$beaconId, messageDebut=$messageDebut, messageFin=$messageFin, puzzleImage=$puzzleImage, puzzleImageId=$puzzleImageId, rows=$rows, cols=$cols, gameType=$gameType]'; Map toJson() { final json = {}; @@ -338,11 +333,6 @@ class GameDTO { } else { json[r'gameType'] = null; } - if (this.guidedPaths != null) { - json[r'guidedPaths'] = this.guidedPaths!.map((v) => v.toJson()).toList(); - } else { - json[r'guidedPaths'] = null; - } return json; } @@ -394,7 +384,6 @@ class GameDTO { rows: mapValueOfType(json, r'rows'), cols: mapValueOfType(json, r'cols'), gameType: GameTypes.fromJson(json[r'gameType']), - guidedPaths: GuidedPathDTO.listFromJson(json[r'guidedPaths']), ); } return null; diff --git a/manager_api_new/lib/model/guided_path_dto.dart b/manager_api_new/lib/model/guided_path_dto.dart index 0366439..679026d 100644 --- a/manager_api_new/lib/model/guided_path_dto.dart +++ b/manager_api_new/lib/model/guided_path_dto.dart @@ -19,11 +19,16 @@ class GuidedPathDTO { this.description = const [], this.sectionMapId, this.sectionEventId, - this.sectionGameId, + this.sectionParcoursId, this.isLinear, this.requireSuccessToAdvance, this.hideNextStepsUntilComplete, + this.estimatedDurationMinutes, + this.imageResourceId, this.order, + this.isGameMode, + this.gameMessageDebut = const [], + this.gameMessageFin = const [], this.steps = const [], }); @@ -39,7 +44,11 @@ class GuidedPathDTO { String? sectionEventId; - String? sectionGameId; + String? sectionParcoursId; + + int? estimatedDurationMinutes; + + String? imageResourceId; /// /// Please note: This property should have been non-nullable! Since the specification file @@ -67,6 +76,12 @@ class GuidedPathDTO { int? order; + bool? isGameMode; + + List? gameMessageDebut; + + List? gameMessageFin; + List? steps; @override @@ -79,11 +94,16 @@ class GuidedPathDTO { _deepEquality.equals(other.description, description) && other.sectionMapId == sectionMapId && other.sectionEventId == sectionEventId && - other.sectionGameId == sectionGameId && + other.sectionParcoursId == sectionParcoursId && + other.estimatedDurationMinutes == estimatedDurationMinutes && + other.imageResourceId == imageResourceId && other.isLinear == isLinear && other.requireSuccessToAdvance == requireSuccessToAdvance && other.hideNextStepsUntilComplete == hideNextStepsUntilComplete && other.order == order && + other.isGameMode == isGameMode && + _deepEquality.equals(other.gameMessageDebut, gameMessageDebut) && + _deepEquality.equals(other.gameMessageFin, gameMessageFin) && _deepEquality.equals(other.steps, steps); @override @@ -95,7 +115,9 @@ class GuidedPathDTO { (description == null ? 0 : description!.hashCode) + (sectionMapId == null ? 0 : sectionMapId!.hashCode) + (sectionEventId == null ? 0 : sectionEventId!.hashCode) + - (sectionGameId == null ? 0 : sectionGameId!.hashCode) + + (sectionParcoursId == null ? 0 : sectionParcoursId!.hashCode) + + (estimatedDurationMinutes == null ? 0 : estimatedDurationMinutes!.hashCode) + + (imageResourceId == null ? 0 : imageResourceId!.hashCode) + (isLinear == null ? 0 : isLinear!.hashCode) + (requireSuccessToAdvance == null ? 0 @@ -104,11 +126,14 @@ class GuidedPathDTO { ? 0 : hideNextStepsUntilComplete!.hashCode) + (order == null ? 0 : order!.hashCode) + + (isGameMode == null ? 0 : isGameMode!.hashCode) + + (gameMessageDebut == null ? 0 : gameMessageDebut!.hashCode) + + (gameMessageFin == null ? 0 : gameMessageFin!.hashCode) + (steps == null ? 0 : steps!.hashCode); @override String toString() => - 'GuidedPathDTO[id=$id, instanceId=$instanceId, title=$title, description=$description, sectionMapId=$sectionMapId, sectionEventId=$sectionEventId, sectionGameId=$sectionGameId, isLinear=$isLinear, requireSuccessToAdvance=$requireSuccessToAdvance, hideNextStepsUntilComplete=$hideNextStepsUntilComplete, order=$order, steps=$steps]'; + 'GuidedPathDTO[id=$id, instanceId=$instanceId, title=$title, description=$description, sectionMapId=$sectionMapId, sectionEventId=$sectionEventId, sectionParcoursId=$sectionParcoursId, estimatedDurationMinutes=$estimatedDurationMinutes, imageResourceId=$imageResourceId, isLinear=$isLinear, requireSuccessToAdvance=$requireSuccessToAdvance, hideNextStepsUntilComplete=$hideNextStepsUntilComplete, order=$order, isGameMode=$isGameMode, gameMessageDebut=$gameMessageDebut, gameMessageFin=$gameMessageFin, steps=$steps]'; Map toJson() { final json = {}; @@ -142,10 +167,20 @@ class GuidedPathDTO { } else { json[r'sectionEventId'] = null; } - if (this.sectionGameId != null) { - json[r'sectionGameId'] = this.sectionGameId; + if (this.sectionParcoursId != null) { + json[r'sectionParcoursId'] = this.sectionParcoursId; } else { - json[r'sectionGameId'] = null; + json[r'sectionParcoursId'] = null; + } + if (this.estimatedDurationMinutes != null) { + json[r'estimatedDurationMinutes'] = this.estimatedDurationMinutes; + } else { + json[r'estimatedDurationMinutes'] = null; + } + if (this.imageResourceId != null) { + json[r'imageResourceId'] = this.imageResourceId; + } else { + json[r'imageResourceId'] = null; } if (this.isLinear != null) { json[r'isLinear'] = this.isLinear; @@ -167,6 +202,23 @@ class GuidedPathDTO { } else { json[r'order'] = null; } + if (this.isGameMode != null) { + json[r'isGameMode'] = this.isGameMode; + } else { + json[r'isGameMode'] = null; + } + if (this.gameMessageDebut != null) { + json[r'gameMessageDebut'] = + this.gameMessageDebut!.map((v) => v.toJson()).toList(); + } else { + json[r'gameMessageDebut'] = null; + } + if (this.gameMessageFin != null) { + json[r'gameMessageFin'] = + this.gameMessageFin!.map((v) => v.toJson()).toList(); + } else { + json[r'gameMessageFin'] = null; + } if (this.steps != null) { json[r'steps'] = this.steps; } else { @@ -202,13 +254,20 @@ class GuidedPathDTO { description: TranslationDTO.listFromJson(json[r'description']), sectionMapId: mapValueOfType(json, r'sectionMapId'), sectionEventId: mapValueOfType(json, r'sectionEventId'), - sectionGameId: mapValueOfType(json, r'sectionGameId'), + sectionParcoursId: mapValueOfType(json, r'sectionParcoursId'), + estimatedDurationMinutes: mapValueOfType(json, r'estimatedDurationMinutes'), + imageResourceId: mapValueOfType(json, r'imageResourceId'), isLinear: mapValueOfType(json, r'isLinear'), requireSuccessToAdvance: mapValueOfType(json, r'requireSuccessToAdvance'), hideNextStepsUntilComplete: mapValueOfType(json, r'hideNextStepsUntilComplete'), order: mapValueOfType(json, r'order'), + isGameMode: mapValueOfType(json, r'isGameMode'), + gameMessageDebut: + TranslationAndResourceDTO.listFromJson(json[r'gameMessageDebut']), + gameMessageFin: + TranslationAndResourceDTO.listFromJson(json[r'gameMessageFin']), steps: GuidedStepDTO.listFromJson(json[r'steps']), ); } diff --git a/manager_api_new/lib/model/guided_step.dart b/manager_api_new/lib/model/guided_step.dart index 5e16746..16f067f 100644 --- a/manager_api_new/lib/model/guided_step.dart +++ b/manager_api_new/lib/model/guided_step.dart @@ -20,10 +20,9 @@ class GuidedStep { this.order, this.description = const [], this.geometry, + this.isGeoTriggered, this.zoneRadiusMeters, this.imageUrl, - this.triggerGeoPointId, - this.triggerGeoPoint, this.isHiddenInitially, this.quizQuestions = const [], this.isStepTimer, @@ -52,14 +51,18 @@ class GuidedStep { PointAllOfBoundary? geometry; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isGeoTriggered; + double? zoneRadiusMeters; String? imageUrl; - int? triggerGeoPointId; - - GuidedStepTriggerGeoPoint? triggerGeoPoint; - /// /// Please note: This property should have been non-nullable! Since the specification file /// does not include a default value (using the "default:" property), however, the generated @@ -101,10 +104,9 @@ class GuidedStep { other.order == order && _deepEquality.equals(other.description, description) && other.geometry == geometry && + other.isGeoTriggered == isGeoTriggered && other.zoneRadiusMeters == zoneRadiusMeters && other.imageUrl == imageUrl && - other.triggerGeoPointId == triggerGeoPointId && - other.triggerGeoPoint == triggerGeoPoint && other.isHiddenInitially == isHiddenInitially && _deepEquality.equals(other.quizQuestions, quizQuestions) && other.isStepTimer == isStepTimer && @@ -122,10 +124,9 @@ class GuidedStep { (order == null ? 0 : order!.hashCode) + (description == null ? 0 : description!.hashCode) + (geometry == null ? 0 : geometry!.hashCode) + + (isGeoTriggered == null ? 0 : isGeoTriggered!.hashCode) + (zoneRadiusMeters == null ? 0 : zoneRadiusMeters!.hashCode) + (imageUrl == null ? 0 : imageUrl!.hashCode) + - (triggerGeoPointId == null ? 0 : triggerGeoPointId!.hashCode) + - (triggerGeoPoint == null ? 0 : triggerGeoPoint!.hashCode) + (isHiddenInitially == null ? 0 : isHiddenInitially!.hashCode) + (quizQuestions == null ? 0 : quizQuestions!.hashCode) + (isStepTimer == null ? 0 : isStepTimer!.hashCode) + @@ -135,7 +136,7 @@ class GuidedStep { @override String toString() => - 'GuidedStep[guidedPathId=$guidedPathId, title=$title, id=$id, guidedPath=$guidedPath, order=$order, description=$description, geometry=$geometry, zoneRadiusMeters=$zoneRadiusMeters, imageUrl=$imageUrl, triggerGeoPointId=$triggerGeoPointId, triggerGeoPoint=$triggerGeoPoint, isHiddenInitially=$isHiddenInitially, quizQuestions=$quizQuestions, isStepTimer=$isStepTimer, isStepLocked=$isStepLocked, timerSeconds=$timerSeconds, timerExpiredMessage=$timerExpiredMessage]'; + 'GuidedStep[guidedPathId=$guidedPathId, title=$title, id=$id, guidedPath=$guidedPath, order=$order, description=$description, geometry=$geometry, isGeoTriggered=$isGeoTriggered, zoneRadiusMeters=$zoneRadiusMeters, imageUrl=$imageUrl, isHiddenInitially=$isHiddenInitially, quizQuestions=$quizQuestions, isStepTimer=$isStepTimer, isStepLocked=$isStepLocked, timerSeconds=$timerSeconds, timerExpiredMessage=$timerExpiredMessage]'; Map toJson() { final json = {}; @@ -166,6 +167,11 @@ class GuidedStep { } else { json[r'geometry'] = null; } + if (this.isGeoTriggered != null) { + json[r'isGeoTriggered'] = this.isGeoTriggered; + } else { + json[r'isGeoTriggered'] = null; + } if (this.zoneRadiusMeters != null) { json[r'zoneRadiusMeters'] = this.zoneRadiusMeters; } else { @@ -176,16 +182,6 @@ class GuidedStep { } else { json[r'imageUrl'] = null; } - if (this.triggerGeoPointId != null) { - json[r'triggerGeoPointId'] = this.triggerGeoPointId; - } else { - json[r'triggerGeoPointId'] = null; - } - if (this.triggerGeoPoint != null) { - json[r'triggerGeoPoint'] = this.triggerGeoPoint; - } else { - json[r'triggerGeoPoint'] = null; - } if (this.isHiddenInitially != null) { json[r'isHiddenInitially'] = this.isHiddenInitially; } else { @@ -247,11 +243,9 @@ class GuidedStep { order: mapValueOfType(json, r'order'), description: TranslationDTO.listFromJson(json[r'description']), geometry: PointAllOfBoundary.fromJson(json[r'geometry']), + isGeoTriggered: mapValueOfType(json, r'isGeoTriggered'), zoneRadiusMeters: mapValueOfType(json, r'zoneRadiusMeters'), imageUrl: mapValueOfType(json, r'imageUrl'), - triggerGeoPointId: mapValueOfType(json, r'triggerGeoPointId'), - triggerGeoPoint: - GuidedStepTriggerGeoPoint.fromJson(json[r'triggerGeoPoint']), isHiddenInitially: mapValueOfType(json, r'isHiddenInitially'), quizQuestions: QuizQuestion.listFromJson(json[r'quizQuestions']), isStepTimer: mapValueOfType(json, r'isStepTimer'), diff --git a/manager_api_new/lib/model/guided_step_dto.dart b/manager_api_new/lib/model/guided_step_dto.dart index 3ae3a1e..1fa1c54 100644 --- a/manager_api_new/lib/model/guided_step_dto.dart +++ b/manager_api_new/lib/model/guided_step_dto.dart @@ -19,15 +19,17 @@ class GuidedStepDTO { this.title = const [], this.description = const [], this.geometry, + this.isGeoTriggered, this.zoneRadiusMeters, this.imageUrl, - this.triggerGeoPointId, - this.triggerGeoPoint, this.isHiddenInitially, this.isStepTimer, this.isStepLocked, this.timerSeconds, this.timerExpiredMessage = const [], + this.audioIds = const [], + this.contents = const [], + this.factContent = const [], this.quizQuestions = const [], }); @@ -49,14 +51,18 @@ class GuidedStepDTO { GeometryDTO? geometry; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isGeoTriggered; + double? zoneRadiusMeters; String? imageUrl; - int? triggerGeoPointId; - - GuidedStepDTOTriggerGeoPoint? triggerGeoPoint; - /// /// Please note: This property should have been non-nullable! Since the specification file /// does not include a default value (using the "default:" property), however, the generated @@ -85,6 +91,12 @@ class GuidedStepDTO { List? timerExpiredMessage; + List? audioIds; + + List? contents; + + List? factContent; + List? quizQuestions; @override @@ -97,16 +109,18 @@ class GuidedStepDTO { _deepEquality.equals(other.title, title) && _deepEquality.equals(other.description, description) && other.geometry == geometry && + other.isGeoTriggered == isGeoTriggered && other.zoneRadiusMeters == zoneRadiusMeters && other.imageUrl == imageUrl && - other.triggerGeoPointId == triggerGeoPointId && - other.triggerGeoPoint == triggerGeoPoint && other.isHiddenInitially == isHiddenInitially && other.isStepTimer == isStepTimer && other.isStepLocked == isStepLocked && other.timerSeconds == timerSeconds && _deepEquality.equals( other.timerExpiredMessage, timerExpiredMessage) && + _deepEquality.equals(other.audioIds, audioIds) && + _deepEquality.equals(other.contents, contents) && + _deepEquality.equals(other.factContent, factContent) && _deepEquality.equals(other.quizQuestions, quizQuestions); @override @@ -118,20 +132,22 @@ class GuidedStepDTO { (title == null ? 0 : title!.hashCode) + (description == null ? 0 : description!.hashCode) + (geometry == null ? 0 : geometry!.hashCode) + + (isGeoTriggered == null ? 0 : isGeoTriggered!.hashCode) + (zoneRadiusMeters == null ? 0 : zoneRadiusMeters!.hashCode) + (imageUrl == null ? 0 : imageUrl!.hashCode) + - (triggerGeoPointId == null ? 0 : triggerGeoPointId!.hashCode) + - (triggerGeoPoint == null ? 0 : triggerGeoPoint!.hashCode) + (isHiddenInitially == null ? 0 : isHiddenInitially!.hashCode) + (isStepTimer == null ? 0 : isStepTimer!.hashCode) + (isStepLocked == null ? 0 : isStepLocked!.hashCode) + (timerSeconds == null ? 0 : timerSeconds!.hashCode) + (timerExpiredMessage == null ? 0 : timerExpiredMessage!.hashCode) + + (audioIds == null ? 0 : audioIds!.hashCode) + + (contents == null ? 0 : contents!.hashCode) + + (factContent == null ? 0 : factContent!.hashCode) + (quizQuestions == null ? 0 : quizQuestions!.hashCode); @override String toString() => - 'GuidedStepDTO[id=$id, guidedPathId=$guidedPathId, order=$order, title=$title, description=$description, geometry=$geometry, zoneRadiusMeters=$zoneRadiusMeters, imageUrl=$imageUrl, triggerGeoPointId=$triggerGeoPointId, triggerGeoPoint=$triggerGeoPoint, isHiddenInitially=$isHiddenInitially, isStepTimer=$isStepTimer, isStepLocked=$isStepLocked, timerSeconds=$timerSeconds, timerExpiredMessage=$timerExpiredMessage, quizQuestions=$quizQuestions]'; + 'GuidedStepDTO[id=$id, guidedPathId=$guidedPathId, order=$order, title=$title, description=$description, geometry=$geometry, isGeoTriggered=$isGeoTriggered, zoneRadiusMeters=$zoneRadiusMeters, imageUrl=$imageUrl, isHiddenInitially=$isHiddenInitially, isStepTimer=$isStepTimer, isStepLocked=$isStepLocked, timerSeconds=$timerSeconds, timerExpiredMessage=$timerExpiredMessage, audioIds=$audioIds, contents=$contents, factContent=$factContent, quizQuestions=$quizQuestions]'; Map toJson() { final json = {}; @@ -165,6 +181,11 @@ class GuidedStepDTO { } else { json[r'geometry'] = null; } + if (this.isGeoTriggered != null) { + json[r'isGeoTriggered'] = this.isGeoTriggered; + } else { + json[r'isGeoTriggered'] = null; + } if (this.zoneRadiusMeters != null) { json[r'zoneRadiusMeters'] = this.zoneRadiusMeters; } else { @@ -175,16 +196,6 @@ class GuidedStepDTO { } else { json[r'imageUrl'] = null; } - if (this.triggerGeoPointId != null) { - json[r'triggerGeoPointId'] = this.triggerGeoPointId; - } else { - json[r'triggerGeoPointId'] = null; - } - if (this.triggerGeoPoint != null) { - json[r'triggerGeoPoint'] = this.triggerGeoPoint; - } else { - json[r'triggerGeoPoint'] = null; - } if (this.isHiddenInitially != null) { json[r'isHiddenInitially'] = this.isHiddenInitially; } else { @@ -211,6 +222,21 @@ class GuidedStepDTO { } else { json[r'timerExpiredMessage'] = null; } + if (this.audioIds != null) { + json[r'audioIds'] = this.audioIds!.map((v) => v.toJson()).toList(); + } else { + json[r'audioIds'] = null; + } + if (this.contents != null) { + json[r'contents'] = this.contents!.map((v) => v.toJson()).toList(); + } else { + json[r'contents'] = null; + } + if (this.factContent != null) { + json[r'factContent'] = this.factContent!.map((v) => v.toJson()).toList(); + } else { + json[r'factContent'] = null; + } if (this.quizQuestions != null) { json[r'quizQuestions'] = this.quizQuestions!.map((v) => v.toJson()).toList(); @@ -247,17 +273,18 @@ class GuidedStepDTO { title: TranslationDTO.listFromJson(json[r'title']), description: TranslationDTO.listFromJson(json[r'description']), geometry: GeometryDTO.fromJson(json[r'geometry']), + isGeoTriggered: mapValueOfType(json, r'isGeoTriggered'), zoneRadiusMeters: mapValueOfType(json, r'zoneRadiusMeters'), imageUrl: mapValueOfType(json, r'imageUrl'), - triggerGeoPointId: mapValueOfType(json, r'triggerGeoPointId'), - triggerGeoPoint: - GuidedStepDTOTriggerGeoPoint.fromJson(json[r'triggerGeoPoint']), isHiddenInitially: mapValueOfType(json, r'isHiddenInitially'), isStepTimer: mapValueOfType(json, r'isStepTimer'), isStepLocked: mapValueOfType(json, r'isStepLocked'), timerSeconds: mapValueOfType(json, r'timerSeconds'), timerExpiredMessage: TranslationDTO.listFromJson(json[r'timerExpiredMessage']), + audioIds: TranslationDTO.listFromJson(json[r'audioIds']), + contents: ContentDTO.listFromJson(json[r'contents']), + factContent: TranslationDTO.listFromJson(json[r'factContent']), quizQuestions: QuizQuestion.listFromJson(json[r'quizQuestions']), ); } diff --git a/manager_api_new/lib/model/guided_step_dto_trigger_geo_point.dart b/manager_api_new/lib/model/guided_step_dto_trigger_geo_point.dart deleted file mode 100644 index d29ba68..0000000 --- a/manager_api_new/lib/model/guided_step_dto_trigger_geo_point.dart +++ /dev/null @@ -1,289 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// -// @dart=2.18 - -// ignore_for_file: unused_element, unused_import -// ignore_for_file: always_put_required_named_parameters_first -// ignore_for_file: constant_identifier_names -// ignore_for_file: lines_longer_than_80_chars - -part of openapi.api; - -class GuidedStepDTOTriggerGeoPoint { - /// Returns a new [GuidedStepDTOTriggerGeoPoint] instance. - GuidedStepDTOTriggerGeoPoint({ - this.id, - this.title = const [], - this.description = const [], - this.contents = const [], - this.categorieId, - this.imageResourceId, - this.imageUrl, - this.schedules = const [], - this.prices = const [], - this.phone = const [], - this.email = const [], - this.site = const [], - this.geometry, - this.polyColor, - this.sectionMapId, - this.sectionEventId, - }); - - int? id; - - List? title; - - List? description; - - List? contents; - - int? categorieId; - - String? imageResourceId; - - String? imageUrl; - - List? schedules; - - List? prices; - - List? phone; - - List? email; - - List? site; - - EventAddressDTOGeometry? geometry; - - String? polyColor; - - String? sectionMapId; - - String? sectionEventId; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is GuidedStepDTOTriggerGeoPoint && - other.id == id && - _deepEquality.equals(other.title, title) && - _deepEquality.equals(other.description, description) && - _deepEquality.equals(other.contents, contents) && - other.categorieId == categorieId && - other.imageResourceId == imageResourceId && - other.imageUrl == imageUrl && - _deepEquality.equals(other.schedules, schedules) && - _deepEquality.equals(other.prices, prices) && - _deepEquality.equals(other.phone, phone) && - _deepEquality.equals(other.email, email) && - _deepEquality.equals(other.site, site) && - other.geometry == geometry && - other.polyColor == polyColor && - other.sectionMapId == sectionMapId && - other.sectionEventId == sectionEventId; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (id == null ? 0 : id!.hashCode) + - (title == null ? 0 : title!.hashCode) + - (description == null ? 0 : description!.hashCode) + - (contents == null ? 0 : contents!.hashCode) + - (categorieId == null ? 0 : categorieId!.hashCode) + - (imageResourceId == null ? 0 : imageResourceId!.hashCode) + - (imageUrl == null ? 0 : imageUrl!.hashCode) + - (schedules == null ? 0 : schedules!.hashCode) + - (prices == null ? 0 : prices!.hashCode) + - (phone == null ? 0 : phone!.hashCode) + - (email == null ? 0 : email!.hashCode) + - (site == null ? 0 : site!.hashCode) + - (geometry == null ? 0 : geometry!.hashCode) + - (polyColor == null ? 0 : polyColor!.hashCode) + - (sectionMapId == null ? 0 : sectionMapId!.hashCode) + - (sectionEventId == null ? 0 : sectionEventId!.hashCode); - - @override - String toString() => - 'GuidedStepDTOTriggerGeoPoint[id=$id, title=$title, description=$description, contents=$contents, categorieId=$categorieId, imageResourceId=$imageResourceId, imageUrl=$imageUrl, schedules=$schedules, prices=$prices, phone=$phone, email=$email, site=$site, geometry=$geometry, polyColor=$polyColor, sectionMapId=$sectionMapId, sectionEventId=$sectionEventId]'; - - Map toJson() { - final json = {}; - if (this.id != null) { - json[r'id'] = this.id; - } else { - json[r'id'] = null; - } - if (this.title != null) { - json[r'title'] = this.title; - } else { - json[r'title'] = null; - } - if (this.description != null) { - json[r'description'] = this.description; - } else { - json[r'description'] = null; - } - if (this.contents != null) { - json[r'contents'] = this.contents; - } else { - json[r'contents'] = null; - } - if (this.categorieId != null) { - json[r'categorieId'] = this.categorieId; - } else { - json[r'categorieId'] = null; - } - if (this.imageResourceId != null) { - json[r'imageResourceId'] = this.imageResourceId; - } else { - json[r'imageResourceId'] = null; - } - if (this.imageUrl != null) { - json[r'imageUrl'] = this.imageUrl; - } else { - json[r'imageUrl'] = null; - } - if (this.schedules != null) { - json[r'schedules'] = this.schedules; - } else { - json[r'schedules'] = null; - } - if (this.prices != null) { - json[r'prices'] = this.prices; - } else { - json[r'prices'] = null; - } - if (this.phone != null) { - json[r'phone'] = this.phone; - } else { - json[r'phone'] = null; - } - if (this.email != null) { - json[r'email'] = this.email; - } else { - json[r'email'] = null; - } - if (this.site != null) { - json[r'site'] = this.site; - } else { - json[r'site'] = null; - } - if (this.geometry != null) { - json[r'geometry'] = this.geometry; - } else { - json[r'geometry'] = null; - } - if (this.polyColor != null) { - json[r'polyColor'] = this.polyColor; - } else { - json[r'polyColor'] = null; - } - if (this.sectionMapId != null) { - json[r'sectionMapId'] = this.sectionMapId; - } else { - json[r'sectionMapId'] = null; - } - if (this.sectionEventId != null) { - json[r'sectionEventId'] = this.sectionEventId; - } else { - json[r'sectionEventId'] = null; - } - return json; - } - - /// Returns a new [GuidedStepDTOTriggerGeoPoint] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static GuidedStepDTOTriggerGeoPoint? fromJson(dynamic value) { - if (value is Map) { - final json = value.cast(); - - // Ensure that the map contains the required keys. - // Note 1: the values aren't checked for validity beyond being non-null. - // Note 2: this code is stripped in release mode! - assert(() { - requiredKeys.forEach((key) { - assert(json.containsKey(key), - 'Required key "GuidedStepDTOTriggerGeoPoint[$key]" is missing from JSON.'); - assert(json[key] != null, - 'Required key "GuidedStepDTOTriggerGeoPoint[$key]" has a null value in JSON.'); - }); - return true; - }()); - - return GuidedStepDTOTriggerGeoPoint( - id: mapValueOfType(json, r'id'), - title: TranslationDTO.listFromJson(json[r'title']), - description: TranslationDTO.listFromJson(json[r'description']), - contents: ContentDTO.listFromJson(json[r'contents']), - categorieId: mapValueOfType(json, r'categorieId'), - imageResourceId: mapValueOfType(json, r'imageResourceId'), - imageUrl: mapValueOfType(json, r'imageUrl'), - schedules: TranslationDTO.listFromJson(json[r'schedules']), - prices: TranslationDTO.listFromJson(json[r'prices']), - phone: TranslationDTO.listFromJson(json[r'phone']), - email: TranslationDTO.listFromJson(json[r'email']), - site: TranslationDTO.listFromJson(json[r'site']), - geometry: EventAddressDTOGeometry.fromJson(json[r'geometry']), - polyColor: mapValueOfType(json, r'polyColor'), - sectionMapId: mapValueOfType(json, r'sectionMapId'), - sectionEventId: mapValueOfType(json, r'sectionEventId'), - ); - } - return null; - } - - static List listFromJson( - dynamic json, { - bool growable = false, - }) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = GuidedStepDTOTriggerGeoPoint.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = GuidedStepDTOTriggerGeoPoint.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of GuidedStepDTOTriggerGeoPoint-objects as value to a dart map - static Map> mapListFromJson( - dynamic json, { - bool growable = false, - }) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = GuidedStepDTOTriggerGeoPoint.listFromJson( - entry.value, - growable: growable, - ); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = {}; -} diff --git a/manager_api_new/lib/model/guided_step_trigger_geo_point.dart b/manager_api_new/lib/model/guided_step_trigger_geo_point.dart deleted file mode 100644 index 9f4e5bb..0000000 --- a/manager_api_new/lib/model/guided_step_trigger_geo_point.dart +++ /dev/null @@ -1,286 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// -// @dart=2.18 - -// ignore_for_file: unused_element, unused_import -// ignore_for_file: always_put_required_named_parameters_first -// ignore_for_file: constant_identifier_names -// ignore_for_file: lines_longer_than_80_chars - -part of openapi.api; - -class GuidedStepTriggerGeoPoint { - /// Returns a new [GuidedStepTriggerGeoPoint] instance. - GuidedStepTriggerGeoPoint({ - required this.id, - this.title = const [], - this.description = const [], - this.contents = const [], - this.schedules = const [], - this.prices = const [], - this.phone = const [], - this.email = const [], - this.site = const [], - this.categorieId, - this.geometry, - this.polyColor, - this.imageResourceId, - this.imageUrl, - this.sectionMapId, - this.sectionMap, - this.sectionEventId, - this.sectionEvent, - }); - - int id; - - List title; - - List description; - - List contents; - - List schedules; - - List prices; - - List phone; - - List email; - - List site; - - int? categorieId; - - PointAllOfBoundary? geometry; - - String? polyColor; - - String? imageResourceId; - - String? imageUrl; - - String? sectionMapId; - - GuidedPathSectionMap? sectionMap; - - String? sectionEventId; - - ApplicationInstanceSectionEvent? sectionEvent; - - @override - bool operator ==(Object other) => - identical(this, other) || - other is GuidedStepTriggerGeoPoint && - other.id == id && - _deepEquality.equals(other.title, title) && - _deepEquality.equals(other.description, description) && - _deepEquality.equals(other.contents, contents) && - _deepEquality.equals(other.schedules, schedules) && - _deepEquality.equals(other.prices, prices) && - _deepEquality.equals(other.phone, phone) && - _deepEquality.equals(other.email, email) && - _deepEquality.equals(other.site, site) && - other.categorieId == categorieId && - other.geometry == geometry && - other.polyColor == polyColor && - other.imageResourceId == imageResourceId && - other.imageUrl == imageUrl && - other.sectionMapId == sectionMapId && - other.sectionMap == sectionMap && - other.sectionEventId == sectionEventId && - other.sectionEvent == sectionEvent; - - @override - int get hashCode => - // ignore: unnecessary_parenthesis - (id.hashCode) + - (title.hashCode) + - (description.hashCode) + - (contents.hashCode) + - (schedules.hashCode) + - (prices.hashCode) + - (phone.hashCode) + - (email.hashCode) + - (site.hashCode) + - (categorieId == null ? 0 : categorieId!.hashCode) + - (geometry == null ? 0 : geometry!.hashCode) + - (polyColor == null ? 0 : polyColor!.hashCode) + - (imageResourceId == null ? 0 : imageResourceId!.hashCode) + - (imageUrl == null ? 0 : imageUrl!.hashCode) + - (sectionMapId == null ? 0 : sectionMapId!.hashCode) + - (sectionMap == null ? 0 : sectionMap!.hashCode) + - (sectionEventId == null ? 0 : sectionEventId!.hashCode) + - (sectionEvent == null ? 0 : sectionEvent!.hashCode); - - @override - String toString() => - 'GuidedStepTriggerGeoPoint[id=$id, title=$title, description=$description, contents=$contents, schedules=$schedules, prices=$prices, phone=$phone, email=$email, site=$site, categorieId=$categorieId, geometry=$geometry, polyColor=$polyColor, imageResourceId=$imageResourceId, imageUrl=$imageUrl, sectionMapId=$sectionMapId, sectionMap=$sectionMap, sectionEventId=$sectionEventId, sectionEvent=$sectionEvent]'; - - Map toJson() { - final json = {}; - json[r'id'] = this.id; - json[r'title'] = this.title; - json[r'description'] = this.description; - json[r'contents'] = this.contents; - json[r'schedules'] = this.schedules; - json[r'prices'] = this.prices; - json[r'phone'] = this.phone; - json[r'email'] = this.email; - json[r'site'] = this.site; - if (this.categorieId != null) { - json[r'categorieId'] = this.categorieId; - } else { - json[r'categorieId'] = null; - } - if (this.geometry != null) { - json[r'geometry'] = this.geometry; - } else { - json[r'geometry'] = null; - } - if (this.polyColor != null) { - json[r'polyColor'] = this.polyColor; - } else { - json[r'polyColor'] = null; - } - if (this.imageResourceId != null) { - json[r'imageResourceId'] = this.imageResourceId; - } else { - json[r'imageResourceId'] = null; - } - if (this.imageUrl != null) { - json[r'imageUrl'] = this.imageUrl; - } else { - json[r'imageUrl'] = null; - } - if (this.sectionMapId != null) { - json[r'sectionMapId'] = this.sectionMapId; - } else { - json[r'sectionMapId'] = null; - } - if (this.sectionMap != null) { - json[r'sectionMap'] = this.sectionMap; - } else { - json[r'sectionMap'] = null; - } - if (this.sectionEventId != null) { - json[r'sectionEventId'] = this.sectionEventId; - } else { - json[r'sectionEventId'] = null; - } - if (this.sectionEvent != null) { - json[r'sectionEvent'] = this.sectionEvent; - } else { - json[r'sectionEvent'] = null; - } - return json; - } - - /// Returns a new [GuidedStepTriggerGeoPoint] instance and imports its values from - /// [value] if it's a [Map], null otherwise. - // ignore: prefer_constructors_over_static_methods - static GuidedStepTriggerGeoPoint? fromJson(dynamic value) { - if (value is Map) { - final json = value.cast(); - - // Ensure that the map contains the required keys. - // Note 1: the values aren't checked for validity beyond being non-null. - // Note 2: this code is stripped in release mode! - assert(() { - requiredKeys.forEach((key) { - assert(json.containsKey(key), - 'Required key "GuidedStepTriggerGeoPoint[$key]" is missing from JSON.'); - assert(json[key] != null, - 'Required key "GuidedStepTriggerGeoPoint[$key]" has a null value in JSON.'); - }); - return true; - }()); - - return GuidedStepTriggerGeoPoint( - id: mapValueOfType(json, r'id')!, - title: TranslationDTO.listFromJson(json[r'title']), - description: TranslationDTO.listFromJson(json[r'description']), - contents: ContentDTO.listFromJson(json[r'contents']), - schedules: TranslationDTO.listFromJson(json[r'schedules']), - prices: TranslationDTO.listFromJson(json[r'prices']), - phone: TranslationDTO.listFromJson(json[r'phone']), - email: TranslationDTO.listFromJson(json[r'email']), - site: TranslationDTO.listFromJson(json[r'site']), - categorieId: mapValueOfType(json, r'categorieId'), - geometry: PointAllOfBoundary.fromJson(json[r'geometry']), - polyColor: mapValueOfType(json, r'polyColor'), - imageResourceId: mapValueOfType(json, r'imageResourceId'), - imageUrl: mapValueOfType(json, r'imageUrl'), - sectionMapId: mapValueOfType(json, r'sectionMapId'), - sectionMap: GuidedPathSectionMap.fromJson(json[r'sectionMap']), - sectionEventId: mapValueOfType(json, r'sectionEventId'), - sectionEvent: - ApplicationInstanceSectionEvent.fromJson(json[r'sectionEvent']), - ); - } - return null; - } - - static List listFromJson( - dynamic json, { - bool growable = false, - }) { - final result = []; - if (json is List && json.isNotEmpty) { - for (final row in json) { - final value = GuidedStepTriggerGeoPoint.fromJson(row); - if (value != null) { - result.add(value); - } - } - } - return result.toList(growable: growable); - } - - static Map mapFromJson(dynamic json) { - final map = {}; - if (json is Map && json.isNotEmpty) { - json = json.cast(); // ignore: parameter_assignments - for (final entry in json.entries) { - final value = GuidedStepTriggerGeoPoint.fromJson(entry.value); - if (value != null) { - map[entry.key] = value; - } - } - } - return map; - } - - // maps a json object with a list of GuidedStepTriggerGeoPoint-objects as value to a dart map - static Map> mapListFromJson( - dynamic json, { - bool growable = false, - }) { - final map = >{}; - if (json is Map && json.isNotEmpty) { - // ignore: parameter_assignments - json = json.cast(); - for (final entry in json.entries) { - map[entry.key] = GuidedStepTriggerGeoPoint.listFromJson( - entry.value, - growable: growable, - ); - } - } - return map; - } - - /// The list of required keys that must be present in a JSON. - static const requiredKeys = { - 'id', - 'title', - 'description', - 'contents', - 'schedules', - 'prices', - 'phone', - 'email', - 'site', - }; -} diff --git a/manager_api_new/lib/model/map_dto.dart b/manager_api_new/lib/model/map_dto.dart index 55311f9..b49c288 100644 --- a/manager_api_new/lib/model/map_dto.dart +++ b/manager_api_new/lib/model/map_dto.dart @@ -44,7 +44,6 @@ class MapDTO { this.centerLatitude, this.centerLongitude, this.isParcours, - this.guidedPaths = const [], }); String? id; @@ -139,8 +138,6 @@ class MapDTO { bool? isParcours; - List? guidedPaths; - @override bool operator ==(Object other) => identical(this, other) || @@ -175,8 +172,7 @@ class MapDTO { _deepEquality.equals(other.categories, categories) && other.centerLatitude == centerLatitude && other.centerLongitude == centerLongitude && - other.isParcours == isParcours && - _deepEquality.equals(other.guidedPaths, guidedPaths); + other.isParcours == isParcours; @override int get hashCode => @@ -211,12 +207,11 @@ class MapDTO { (categories == null ? 0 : categories!.hashCode) + (centerLatitude == null ? 0 : centerLatitude!.hashCode) + (centerLongitude == null ? 0 : centerLongitude!.hashCode) + - (isParcours == null ? 0 : isParcours!.hashCode) + - (guidedPaths == null ? 0 : guidedPaths!.hashCode); + (isParcours == null ? 0 : isParcours!.hashCode); @override String toString() => - 'MapDTO[id=$id, label=$label, title=$title, description=$description, isActive=$isActive, imageId=$imageId, imageSource=$imageSource, configurationId=$configurationId, isSubSection=$isSubSection, parentId=$parentId, type=$type, dateCreation=$dateCreation, order=$order, instanceId=$instanceId, latitude=$latitude, longitude=$longitude, meterZoneGPS=$meterZoneGPS, isBeacon=$isBeacon, beaconId=$beaconId, zoom=$zoom, mapType=$mapType, mapTypeMapbox=$mapTypeMapbox, mapProvider=$mapProvider, points=$points, iconResourceId=$iconResourceId, iconSource=$iconSource, categories=$categories, centerLatitude=$centerLatitude, centerLongitude=$centerLongitude, isParcours=$isParcours, guidedPaths=$guidedPaths]'; + 'MapDTO[id=$id, label=$label, title=$title, description=$description, isActive=$isActive, imageId=$imageId, imageSource=$imageSource, configurationId=$configurationId, isSubSection=$isSubSection, parentId=$parentId, type=$type, dateCreation=$dateCreation, order=$order, instanceId=$instanceId, latitude=$latitude, longitude=$longitude, meterZoneGPS=$meterZoneGPS, isBeacon=$isBeacon, beaconId=$beaconId, zoom=$zoom, mapType=$mapType, mapTypeMapbox=$mapTypeMapbox, mapProvider=$mapProvider, points=$points, iconResourceId=$iconResourceId, iconSource=$iconSource, categories=$categories, centerLatitude=$centerLatitude, centerLongitude=$centerLongitude, isParcours=$isParcours]'; Map toJson() { final json = {}; @@ -375,11 +370,6 @@ class MapDTO { } else { json[r'isParcours'] = null; } - if (this.guidedPaths != null) { - json[r'guidedPaths'] = this.guidedPaths!.map((v) => v.toJson()).toList(); - } else { - json[r'guidedPaths'] = null; - } return json; } @@ -435,7 +425,6 @@ class MapDTO { centerLatitude: mapValueOfType(json, r'centerLatitude'), centerLongitude: mapValueOfType(json, r'centerLongitude'), isParcours: mapValueOfType(json, r'isParcours'), - guidedPaths: GuidedPathDTO.listFromJson(json[r'guidedPaths']), ); } return null; diff --git a/manager_api_new/lib/model/parcours_dto.dart b/manager_api_new/lib/model/parcours_dto.dart new file mode 100644 index 0000000..88f8332 --- /dev/null +++ b/manager_api_new/lib/model/parcours_dto.dart @@ -0,0 +1,351 @@ +// +// AUTO-GENERATED FILE, DO NOT MODIFY! +// +// @dart=2.18 + +// ignore_for_file: unused_element, unused_import +// ignore_for_file: always_put_required_named_parameters_first +// ignore_for_file: constant_identifier_names +// ignore_for_file: lines_longer_than_80_chars + +part of openapi.api; + +class ParcoursDTO { + /// Returns a new [ParcoursDTO] instance. + ParcoursDTO({ + this.id, + this.label, + this.title = const [], + this.description = const [], + this.isActive, + this.imageId, + this.imageSource, + this.configurationId, + this.isSubSection, + this.parentId, + this.type, + this.dateCreation, + this.order, + this.instanceId, + this.latitude, + this.longitude, + this.meterZoneGPS, + this.isBeacon, + this.beaconId, + this.showMap, + this.baseSectionMapId, + this.guidedPaths = const [], + }); + + String? id; + + String? label; + + List? title; + + List? description; + + bool? isActive; + + String? imageId; + + String? imageSource; + + String? configurationId; + + bool? isSubSection; + + String? parentId; + + SectionType? type; + + DateTime? dateCreation; + + int? order; + + String? instanceId; + + String? latitude; + + String? longitude; + + int? meterZoneGPS; + + bool? isBeacon; + + int? beaconId; + + bool? showMap; + + String? baseSectionMapId; + + List? guidedPaths; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ParcoursDTO && + other.id == id && + other.label == label && + _deepEquality.equals(other.title, title) && + _deepEquality.equals(other.description, description) && + other.isActive == isActive && + 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 && + other.showMap == showMap && + other.baseSectionMapId == baseSectionMapId && + _deepEquality.equals(other.guidedPaths, guidedPaths); + + @override + int get hashCode => + // ignore: unnecessary_parenthesis + (id == null ? 0 : id!.hashCode) + + (label == null ? 0 : label!.hashCode) + + (title == null ? 0 : title!.hashCode) + + (description == null ? 0 : description!.hashCode) + + (isActive == null ? 0 : isActive!.hashCode) + + (imageId == null ? 0 : imageId!.hashCode) + + (imageSource == null ? 0 : imageSource!.hashCode) + + (configurationId == null ? 0 : configurationId!.hashCode) + + (isSubSection == null ? 0 : isSubSection!.hashCode) + + (parentId == null ? 0 : parentId!.hashCode) + + (type == null ? 0 : type!.hashCode) + + (dateCreation == null ? 0 : dateCreation!.hashCode) + + (order == null ? 0 : order!.hashCode) + + (instanceId == null ? 0 : instanceId!.hashCode) + + (latitude == null ? 0 : latitude!.hashCode) + + (longitude == null ? 0 : longitude!.hashCode) + + (meterZoneGPS == null ? 0 : meterZoneGPS!.hashCode) + + (isBeacon == null ? 0 : isBeacon!.hashCode) + + (beaconId == null ? 0 : beaconId!.hashCode) + + (showMap == null ? 0 : showMap!.hashCode) + + (baseSectionMapId == null ? 0 : baseSectionMapId!.hashCode) + + (guidedPaths == null ? 0 : guidedPaths!.hashCode); + + @override + String toString() => + 'ParcoursDTO[id=$id, label=$label, title=$title, description=$description, isActive=$isActive, imageId=$imageId, imageSource=$imageSource, configurationId=$configurationId, isSubSection=$isSubSection, parentId=$parentId, type=$type, dateCreation=$dateCreation, order=$order, instanceId=$instanceId, showMap=$showMap, baseSectionMapId=$baseSectionMapId, guidedPaths=$guidedPaths]'; + + Map toJson() { + final json = {}; + if (this.id != null) { + json[r'id'] = this.id; + } else { + json[r'id'] = null; + } + if (this.label != null) { + json[r'label'] = this.label; + } else { + json[r'label'] = null; + } + if (this.title != null) { + json[r'title'] = this.title!.map((v) => v.toJson()).toList(); + } else { + json[r'title'] = null; + } + if (this.description != null) { + json[r'description'] = this.description!.map((v) => v.toJson()).toList(); + } else { + json[r'description'] = null; + } + if (this.isActive != null) { + json[r'isActive'] = this.isActive; + } else { + json[r'isActive'] = null; + } + if (this.imageId != null) { + json[r'imageId'] = this.imageId; + } else { + json[r'imageId'] = null; + } + if (this.imageSource != null) { + json[r'imageSource'] = this.imageSource; + } else { + json[r'imageSource'] = null; + } + if (this.configurationId != null) { + json[r'configurationId'] = this.configurationId; + } else { + json[r'configurationId'] = null; + } + if (this.isSubSection != null) { + json[r'isSubSection'] = this.isSubSection; + } else { + json[r'isSubSection'] = null; + } + if (this.parentId != null) { + json[r'parentId'] = this.parentId; + } else { + json[r'parentId'] = null; + } + if (this.type != null) { + json[r'type'] = this.type; + } else { + json[r'type'] = null; + } + if (this.dateCreation != null) { + json[r'dateCreation'] = this.dateCreation!.toUtc().toIso8601String(); + } else { + json[r'dateCreation'] = null; + } + if (this.order != null) { + json[r'order'] = this.order; + } else { + json[r'order'] = null; + } + if (this.instanceId != null) { + json[r'instanceId'] = this.instanceId; + } else { + json[r'instanceId'] = null; + } + if (this.latitude != null) { + json[r'latitude'] = this.latitude; + } else { + json[r'latitude'] = null; + } + if (this.longitude != null) { + json[r'longitude'] = this.longitude; + } else { + json[r'longitude'] = null; + } + if (this.meterZoneGPS != null) { + json[r'meterZoneGPS'] = this.meterZoneGPS; + } else { + json[r'meterZoneGPS'] = null; + } + if (this.isBeacon != null) { + json[r'isBeacon'] = this.isBeacon; + } else { + json[r'isBeacon'] = null; + } + if (this.beaconId != null) { + json[r'beaconId'] = this.beaconId; + } else { + json[r'beaconId'] = null; + } + if (this.showMap != null) { + json[r'showMap'] = this.showMap; + } else { + json[r'showMap'] = null; + } + if (this.baseSectionMapId != null) { + json[r'baseSectionMapId'] = this.baseSectionMapId; + } else { + json[r'baseSectionMapId'] = null; + } + if (this.guidedPaths != null) { + json[r'guidedPaths'] = this.guidedPaths!.map((v) => v.toJson()).toList(); + } else { + json[r'guidedPaths'] = null; + } + return json; + } + + /// Returns a new [ParcoursDTO] instance and imports its values from + /// [value] if it's a [Map], null otherwise. + // ignore: prefer_constructors_over_static_methods + static ParcoursDTO? fromJson(dynamic value) { + if (value is Map) { + final json = value.cast(); + + assert(() { + requiredKeys.forEach((key) { + assert(json.containsKey(key), + 'Required key "ParcoursDTO[$key]" is missing from JSON.'); + assert(json[key] != null, + 'Required key "ParcoursDTO[$key]" has a null value in JSON.'); + }); + return true; + }()); + + return ParcoursDTO( + id: mapValueOfType(json, r'id'), + label: mapValueOfType(json, r'label'), + title: TranslationDTO.listFromJson(json[r'title']), + description: TranslationDTO.listFromJson(json[r'description']), + isActive: mapValueOfType(json, r'isActive'), + imageId: mapValueOfType(json, r'imageId'), + imageSource: mapValueOfType(json, r'imageSource'), + configurationId: mapValueOfType(json, r'configurationId'), + isSubSection: mapValueOfType(json, r'isSubSection'), + parentId: mapValueOfType(json, r'parentId'), + type: SectionType.fromJson(json[r'type']), + dateCreation: mapDateTime(json, r'dateCreation', r''), + order: mapValueOfType(json, r'order'), + instanceId: mapValueOfType(json, r'instanceId'), + latitude: mapValueOfType(json, r'latitude'), + longitude: mapValueOfType(json, r'longitude'), + meterZoneGPS: mapValueOfType(json, r'meterZoneGPS'), + isBeacon: mapValueOfType(json, r'isBeacon'), + beaconId: mapValueOfType(json, r'beaconId'), + showMap: mapValueOfType(json, r'showMap'), + baseSectionMapId: mapValueOfType(json, r'baseSectionMapId'), + guidedPaths: GuidedPathDTO.listFromJson(json[r'guidedPaths']), + ); + } + return null; + } + + static List listFromJson( + dynamic json, { + bool growable = false, + }) { + final result = []; + if (json is List && json.isNotEmpty) { + for (final row in json) { + final value = ParcoursDTO.fromJson(row); + if (value != null) { + result.add(value); + } + } + } + return result.toList(growable: growable); + } + + static Map mapFromJson(dynamic json) { + final map = {}; + if (json is Map && json.isNotEmpty) { + json = json.cast(); // ignore: parameter_assignments + for (final entry in json.entries) { + final value = ParcoursDTO.fromJson(entry.value); + if (value != null) { + map[entry.key] = value; + } + } + } + return map; + } + + static Map> mapListFromJson( + dynamic json, { + bool growable = false, + }) { + final map = >{}; + if (json is Map && json.isNotEmpty) { + // ignore: parameter_assignments + json = json.cast(); + for (final entry in json.entries) { + map[entry.key] = ParcoursDTO.listFromJson( + entry.value, + growable: growable, + ); + } + } + return map; + } + + /// The list of required keys that must be present in a JSON. + static const requiredKeys = {}; +} diff --git a/manager_api_new/lib/model/quiz_question_guided_step.dart b/manager_api_new/lib/model/quiz_question_guided_step.dart index 259191a..d3103527 100644 --- a/manager_api_new/lib/model/quiz_question_guided_step.dart +++ b/manager_api_new/lib/model/quiz_question_guided_step.dart @@ -20,10 +20,9 @@ class QuizQuestionGuidedStep { this.order, this.description = const [], this.geometry, + this.isGeoTriggered, this.zoneRadiusMeters, this.imageUrl, - this.triggerGeoPointId, - this.triggerGeoPoint, this.isHiddenInitially, this.quizQuestions = const [], this.isStepTimer, @@ -52,14 +51,18 @@ class QuizQuestionGuidedStep { PointAllOfBoundary? geometry; + /// + /// Please note: This property should have been non-nullable! Since the specification file + /// does not include a default value (using the "default:" property), however, the generated + /// source code must fall back to having a nullable type. + /// Consider adding a "default:" property in the specification file to hide this note. + /// + bool? isGeoTriggered; + double? zoneRadiusMeters; String? imageUrl; - int? triggerGeoPointId; - - GuidedStepTriggerGeoPoint? triggerGeoPoint; - /// /// Please note: This property should have been non-nullable! Since the specification file /// does not include a default value (using the "default:" property), however, the generated @@ -101,10 +104,9 @@ class QuizQuestionGuidedStep { other.order == order && _deepEquality.equals(other.description, description) && other.geometry == geometry && + other.isGeoTriggered == isGeoTriggered && other.zoneRadiusMeters == zoneRadiusMeters && other.imageUrl == imageUrl && - other.triggerGeoPointId == triggerGeoPointId && - other.triggerGeoPoint == triggerGeoPoint && other.isHiddenInitially == isHiddenInitially && _deepEquality.equals(other.quizQuestions, quizQuestions) && other.isStepTimer == isStepTimer && @@ -122,10 +124,9 @@ class QuizQuestionGuidedStep { (order == null ? 0 : order!.hashCode) + (description == null ? 0 : description!.hashCode) + (geometry == null ? 0 : geometry!.hashCode) + + (isGeoTriggered == null ? 0 : isGeoTriggered!.hashCode) + (zoneRadiusMeters == null ? 0 : zoneRadiusMeters!.hashCode) + (imageUrl == null ? 0 : imageUrl!.hashCode) + - (triggerGeoPointId == null ? 0 : triggerGeoPointId!.hashCode) + - (triggerGeoPoint == null ? 0 : triggerGeoPoint!.hashCode) + (isHiddenInitially == null ? 0 : isHiddenInitially!.hashCode) + (quizQuestions == null ? 0 : quizQuestions!.hashCode) + (isStepTimer == null ? 0 : isStepTimer!.hashCode) + @@ -135,7 +136,7 @@ class QuizQuestionGuidedStep { @override String toString() => - 'QuizQuestionGuidedStep[guidedPathId=$guidedPathId, title=$title, id=$id, guidedPath=$guidedPath, order=$order, description=$description, geometry=$geometry, zoneRadiusMeters=$zoneRadiusMeters, imageUrl=$imageUrl, triggerGeoPointId=$triggerGeoPointId, triggerGeoPoint=$triggerGeoPoint, isHiddenInitially=$isHiddenInitially, quizQuestions=$quizQuestions, isStepTimer=$isStepTimer, isStepLocked=$isStepLocked, timerSeconds=$timerSeconds, timerExpiredMessage=$timerExpiredMessage]'; + 'QuizQuestionGuidedStep[guidedPathId=$guidedPathId, title=$title, id=$id, guidedPath=$guidedPath, order=$order, description=$description, geometry=$geometry, isGeoTriggered=$isGeoTriggered, zoneRadiusMeters=$zoneRadiusMeters, imageUrl=$imageUrl, isHiddenInitially=$isHiddenInitially, quizQuestions=$quizQuestions, isStepTimer=$isStepTimer, isStepLocked=$isStepLocked, timerSeconds=$timerSeconds, timerExpiredMessage=$timerExpiredMessage]'; Map toJson() { final json = {}; @@ -166,6 +167,11 @@ class QuizQuestionGuidedStep { } else { json[r'geometry'] = null; } + if (this.isGeoTriggered != null) { + json[r'isGeoTriggered'] = this.isGeoTriggered; + } else { + json[r'isGeoTriggered'] = null; + } if (this.zoneRadiusMeters != null) { json[r'zoneRadiusMeters'] = this.zoneRadiusMeters; } else { @@ -176,16 +182,6 @@ class QuizQuestionGuidedStep { } else { json[r'imageUrl'] = null; } - if (this.triggerGeoPointId != null) { - json[r'triggerGeoPointId'] = this.triggerGeoPointId; - } else { - json[r'triggerGeoPointId'] = null; - } - if (this.triggerGeoPoint != null) { - json[r'triggerGeoPoint'] = this.triggerGeoPoint; - } else { - json[r'triggerGeoPoint'] = null; - } if (this.isHiddenInitially != null) { json[r'isHiddenInitially'] = this.isHiddenInitially; } else { @@ -247,11 +243,9 @@ class QuizQuestionGuidedStep { order: mapValueOfType(json, r'order'), description: TranslationDTO.listFromJson(json[r'description']), geometry: PointAllOfBoundary.fromJson(json[r'geometry']), + isGeoTriggered: mapValueOfType(json, r'isGeoTriggered'), zoneRadiusMeters: mapValueOfType(json, r'zoneRadiusMeters'), imageUrl: mapValueOfType(json, r'imageUrl'), - triggerGeoPointId: mapValueOfType(json, r'triggerGeoPointId'), - triggerGeoPoint: - GuidedStepTriggerGeoPoint.fromJson(json[r'triggerGeoPoint']), isHiddenInitially: mapValueOfType(json, r'isHiddenInitially'), quizQuestions: QuizQuestion.listFromJson(json[r'quizQuestions']), isStepTimer: mapValueOfType(json, r'isStepTimer'), diff --git a/manager_api_new/lib/model/section_type.dart b/manager_api_new/lib/model/section_type.dart index 9753f32..123b5cd 100644 --- a/manager_api_new/lib/model/section_type.dart +++ b/manager_api_new/lib/model/section_type.dart @@ -35,6 +35,7 @@ class SectionType { static const Agenda = SectionType._(9); static const Weather = SectionType._(10); static const Event = SectionType._(11); + static const Parcours = SectionType._(12); /// List of all possible values in this [enum][SectionType]. static const values = [ @@ -49,7 +50,8 @@ class SectionType { Game, Agenda, Weather, - Event + Event, + Parcours, ]; static SectionType? fromJson(dynamic value) => SectionTypeTypeTransformer().decode(value); @@ -101,6 +103,7 @@ class SectionTypeTypeTransformer { case r'Agenda': return SectionType.Agenda; case r'Weather': return SectionType.Weather; case r'Event': return SectionType.Event; + case r'Parcours': return SectionType.Parcours; default: if (!allowNull) { throw ArgumentError('Unknown enum value to decode: $data'); @@ -121,6 +124,7 @@ class SectionTypeTypeTransformer { case 9: return SectionType.Agenda; case 10: return SectionType.Weather; case 11: return SectionType.Event; + case 12: return SectionType.Parcours; default: if (!allowNull) { throw ArgumentError('Unknown enum value to decode: $data'); diff --git a/manager_api_new/test/guided_step_dto_test.dart b/manager_api_new/test/guided_step_dto_test.dart index 84497a6..46fba56 100644 --- a/manager_api_new/test/guided_step_dto_test.dart +++ b/manager_api_new/test/guided_step_dto_test.dart @@ -56,16 +56,6 @@ void main() { // TODO }); - // int triggerGeoPointId - test('to test the property `triggerGeoPointId`', () async { - // TODO - }); - - // GuidedStepDTOTriggerGeoPoint triggerGeoPoint - test('to test the property `triggerGeoPoint`', () async { - // TODO - }); - // bool isHiddenInitially test('to test the property `isHiddenInitially`', () async { // TODO diff --git a/manager_api_new/test/guided_step_dto_trigger_geo_point_test.dart b/manager_api_new/test/guided_step_dto_trigger_geo_point_test.dart deleted file mode 100644 index 09dd638..0000000 --- a/manager_api_new/test/guided_step_dto_trigger_geo_point_test.dart +++ /dev/null @@ -1,99 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// -// @dart=2.18 - -// ignore_for_file: unused_element, unused_import -// ignore_for_file: always_put_required_named_parameters_first -// ignore_for_file: constant_identifier_names -// ignore_for_file: lines_longer_than_80_chars - -import 'package:manager_api_new/api.dart'; -import 'package:test/test.dart'; - -// tests for GuidedStepDTOTriggerGeoPoint -void main() { - // final instance = GuidedStepDTOTriggerGeoPoint(); - - group('test GuidedStepDTOTriggerGeoPoint', () { - // int id - test('to test the property `id`', () async { - // TODO - }); - - // List title (default value: const []) - test('to test the property `title`', () async { - // TODO - }); - - // List description (default value: const []) - test('to test the property `description`', () async { - // TODO - }); - - // List contents (default value: const []) - test('to test the property `contents`', () async { - // TODO - }); - - // int categorieId - test('to test the property `categorieId`', () async { - // TODO - }); - - // String imageResourceId - test('to test the property `imageResourceId`', () async { - // TODO - }); - - // String imageUrl - test('to test the property `imageUrl`', () async { - // TODO - }); - - // List schedules (default value: const []) - test('to test the property `schedules`', () async { - // TODO - }); - - // List prices (default value: const []) - test('to test the property `prices`', () async { - // TODO - }); - - // List phone (default value: const []) - test('to test the property `phone`', () async { - // TODO - }); - - // List email (default value: const []) - test('to test the property `email`', () async { - // TODO - }); - - // List site (default value: const []) - test('to test the property `site`', () async { - // TODO - }); - - // EventAddressDTOGeometry geometry - test('to test the property `geometry`', () async { - // TODO - }); - - // String polyColor - test('to test the property `polyColor`', () async { - // TODO - }); - - // String sectionMapId - test('to test the property `sectionMapId`', () async { - // TODO - }); - - // String sectionEventId - test('to test the property `sectionEventId`', () async { - // TODO - }); - }); -} diff --git a/manager_api_new/test/guided_step_test.dart b/manager_api_new/test/guided_step_test.dart index 6274870..f21709b 100644 --- a/manager_api_new/test/guided_step_test.dart +++ b/manager_api_new/test/guided_step_test.dart @@ -61,16 +61,6 @@ void main() { // TODO }); - // int triggerGeoPointId - test('to test the property `triggerGeoPointId`', () async { - // TODO - }); - - // GuidedStepTriggerGeoPoint triggerGeoPoint - test('to test the property `triggerGeoPoint`', () async { - // TODO - }); - // bool isHiddenInitially test('to test the property `isHiddenInitially`', () async { // TODO diff --git a/manager_api_new/test/guided_step_trigger_geo_point_test.dart b/manager_api_new/test/guided_step_trigger_geo_point_test.dart deleted file mode 100644 index c42e722..0000000 --- a/manager_api_new/test/guided_step_trigger_geo_point_test.dart +++ /dev/null @@ -1,109 +0,0 @@ -// -// AUTO-GENERATED FILE, DO NOT MODIFY! -// -// @dart=2.18 - -// ignore_for_file: unused_element, unused_import -// ignore_for_file: always_put_required_named_parameters_first -// ignore_for_file: constant_identifier_names -// ignore_for_file: lines_longer_than_80_chars - -import 'package:manager_api_new/api.dart'; -import 'package:test/test.dart'; - -// tests for GuidedStepTriggerGeoPoint -void main() { - // final instance = GuidedStepTriggerGeoPoint(); - - group('test GuidedStepTriggerGeoPoint', () { - // int id - test('to test the property `id`', () async { - // TODO - }); - - // List title (default value: const []) - test('to test the property `title`', () async { - // TODO - }); - - // List description (default value: const []) - test('to test the property `description`', () async { - // TODO - }); - - // List contents (default value: const []) - test('to test the property `contents`', () async { - // TODO - }); - - // List schedules (default value: const []) - test('to test the property `schedules`', () async { - // TODO - }); - - // List prices (default value: const []) - test('to test the property `prices`', () async { - // TODO - }); - - // List phone (default value: const []) - test('to test the property `phone`', () async { - // TODO - }); - - // List email (default value: const []) - test('to test the property `email`', () async { - // TODO - }); - - // List site (default value: const []) - test('to test the property `site`', () async { - // TODO - }); - - // int categorieId - test('to test the property `categorieId`', () async { - // TODO - }); - - // PointAllOfBoundary geometry - test('to test the property `geometry`', () async { - // TODO - }); - - // String polyColor - test('to test the property `polyColor`', () async { - // TODO - }); - - // String imageResourceId - test('to test the property `imageResourceId`', () async { - // TODO - }); - - // String imageUrl - test('to test the property `imageUrl`', () async { - // TODO - }); - - // String sectionMapId - test('to test the property `sectionMapId`', () async { - // TODO - }); - - // GuidedPathSectionMap sectionMap - test('to test the property `sectionMap`', () async { - // TODO - }); - - // String sectionEventId - test('to test the property `sectionEventId`', () async { - // TODO - }); - - // ApplicationInstanceSectionEvent sectionEvent - test('to test the property `sectionEvent`', () async { - // TODO - }); - }); -} diff --git a/manager_api_new/test/quiz_question_guided_step_test.dart b/manager_api_new/test/quiz_question_guided_step_test.dart index c64dfdc..7d8e888 100644 --- a/manager_api_new/test/quiz_question_guided_step_test.dart +++ b/manager_api_new/test/quiz_question_guided_step_test.dart @@ -61,16 +61,6 @@ void main() { // TODO }); - // int triggerGeoPointId - test('to test the property `triggerGeoPointId`', () async { - // TODO - }); - - // GuidedStepTriggerGeoPoint triggerGeoPoint - test('to test the property `triggerGeoPoint`', () async { - // TODO - }); - // bool isHiddenInitially test('to test the property `isHiddenInitially`', () async { // TODO diff --git a/pubspec.lock b/pubspec.lock index e76e1bf..5958f03 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -189,10 +189,10 @@ packages: dependency: transitive description: name: characters - sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 + sha256: faf38497bda5ead2a8c7615f4f7939df04333478bf32e4173fcb06d428b5716b url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "1.4.1" charcode: dependency: transitive description: @@ -599,10 +599,10 @@ packages: dependency: "direct main" description: name: flutter_quill - sha256: b96bb8525afdeaaea52f5d02f525e05cc34acd176467ab6d6f35d434cf14fde2 + sha256: "3ee7125b2dd3f3bce3ebdaac722a72f0c8aff3db9aa19053a9d777db12d71c98" url: "https://pub.dev" source: hosted - version: "11.5.0" + version: "11.5.1" flutter_quill_delta_from_html: dependency: "direct main" description: @@ -774,7 +774,7 @@ packages: source: hosted version: "2.3.1" html: - dependency: transitive + dependency: "direct main" description: name: html sha256: "6d1264f2dffa1b1101c25a91dff0dc2daee4c18e87cd8538729773c073dbf602" @@ -968,18 +968,18 @@ packages: dependency: transitive description: name: matcher - sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 + sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861 url: "https://pub.dev" source: hosted - version: "0.12.17" + version: "0.12.19" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec + sha256: "9c337007e82b1889149c82ed242ed1cb24a66044e30979c44912381e9be4c48b" url: "https://pub.dev" source: hosted - version: "0.11.1" + version: "0.13.0" material_segmented_control: dependency: "direct main" description: @@ -992,10 +992,10 @@ packages: dependency: transitive description: name: meta - sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c + sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349" url: "https://pub.dev" source: hosted - version: "1.16.0" + version: "1.18.0" mgrs_dart: dependency: transitive description: @@ -1477,10 +1477,10 @@ packages: dependency: transitive description: name: test_api - sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00" + sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e" url: "https://pub.dev" source: hosted - version: "0.7.6" + version: "0.7.11" timing: dependency: transitive description: @@ -1810,5 +1810,5 @@ packages: source: hosted version: "3.1.1" sdks: - dart: ">=3.8.0 <4.0.0" - flutter: ">=3.32.0" + dart: ">=3.12.0 <4.0.0" + flutter: ">=3.44.0" diff --git a/pubspec.yaml b/pubspec.yaml index 5c66abe..117fef1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -71,9 +71,10 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.6 - flutter_quill: ^11.5.0 + flutter_quill: 11.5.1 vsc_quill_delta_to_html: ^1.0.5 flutter_quill_delta_from_html: ^1.5.3 + html: ^0.15.6 responsive_framework: ^1.4.0 tab_container: ^2.0.0 flutter_widget_from_html: ^0.15.3