From afa9ca4fd52dd22ad70da3ef3ea3d1267447e57e Mon Sep 17 00:00:00 2001 From: Thomas Fransolet Date: Mon, 4 Mar 2024 16:24:13 +0100 Subject: [PATCH] update max size title + fix map type change + category not showed --- lib/Components/category_input_container.dart | 5 ++-- ...nslation_input_and_resource_container.dart | 2 +- .../translation_input_container.dart | 2 +- .../SubSection/Map/new_update_categorie.dart | 4 ++-- manager_api_new/lib/model/map_type_app.dart | 24 +++++++++---------- 5 files changed, 19 insertions(+), 18 deletions(-) diff --git a/lib/Components/category_input_container.dart b/lib/Components/category_input_container.dart index 426ec95..37d2fed 100644 --- a/lib/Components/category_input_container.dart +++ b/lib/Components/category_input_container.dart @@ -8,9 +8,9 @@ import 'package:manager_app/constants.dart'; class CategoryInputContainer extends StatefulWidget { final Color color; final String label; - final List initialValue; + List initialValue; final ValueChanged> onChanged; - const CategoryInputContainer({ + CategoryInputContainer({ Key? key, this.color = kSecond, required this.label, @@ -50,6 +50,7 @@ class _CategoryInputContainerState extends State { List initials = widget.initialValue; showCreateOrUpdateCategories("Catégories", initials, newValues, (value) { widget.onChanged(value); + widget.initialValue = value; }, context); }, child: Container( diff --git a/lib/Components/translation_input_and_resource_container.dart b/lib/Components/translation_input_and_resource_container.dart index d5a6032..415828b 100644 --- a/lib/Components/translation_input_and_resource_container.dart +++ b/lib/Components/translation_input_and_resource_container.dart @@ -37,7 +37,7 @@ class _TranslationInputAndResourceContainerState extends State 60) { + if(plainText.length > 110) { print("to much text au dessus"); controllerQuill.undo(); } diff --git a/lib/Components/translation_input_container.dart b/lib/Components/translation_input_container.dart index 51ec42e..fdde3a1 100644 --- a/lib/Components/translation_input_container.dart +++ b/lib/Components/translation_input_container.dart @@ -36,7 +36,7 @@ class _TranslationInputContainerState extends State w controllerQuill.onTextChanged((p0) async { var plainText = await controllerQuill.getPlainText(); if(widget.isTitle) { - if(plainText.length > 60) { + if(plainText.length > 110) { print("to much text au dessus"); controllerQuill.undo(); } diff --git a/lib/Screens/Configurations/Section/SubSection/Map/new_update_categorie.dart b/lib/Screens/Configurations/Section/SubSection/Map/new_update_categorie.dart index 2442189..903c90d 100644 --- a/lib/Screens/Configurations/Section/SubSection/Map/new_update_categorie.dart +++ b/lib/Screens/Configurations/Section/SubSection/Map/new_update_categorie.dart @@ -75,7 +75,7 @@ Future showNewOrUpdateCategory(CategorieDTO? inputCategorieDTO, A isHTML: true, ) ), - Container( + /*Container( height: size.height * 0.2, constraints: BoxConstraints(minHeight: 50, maxHeight: 80), child: ResourceInputContainer( @@ -95,7 +95,7 @@ Future showNewOrUpdateCategory(CategorieDTO? inputCategorieDTO, A }, isSmall: true ), - ), + ),*/ ], ), ], diff --git a/manager_api_new/lib/model/map_type_app.dart b/manager_api_new/lib/model/map_type_app.dart index 735acb9..c2d54af 100644 --- a/manager_api_new/lib/model/map_type_app.dart +++ b/manager_api_new/lib/model/map_type_app.dart @@ -73,12 +73,12 @@ class MapTypeAppTypeTransformer { /// and users are still using an old app with the old code. MapTypeApp? decode(dynamic data, {bool allowNull = true}) { if (data != null) { - switch (data.toString()) { - case r'None': return MapTypeApp.none; - case r'Normal': return MapTypeApp.normal; - case r'Satellite': return MapTypeApp.satellite; - case r'Terrain': return MapTypeApp.terrain; - case r'Hybrid': return MapTypeApp.hybrid; + switch (data.toString().toLowerCase()) { + case r'none': return MapTypeApp.none; + case r'normal': return MapTypeApp.normal; + case r'satellite': return MapTypeApp.satellite; + case r'terrain': return MapTypeApp.terrain; + case r'hybrid': return MapTypeApp.hybrid; default: if (!allowNull) { throw ArgumentError('Unknown enum value to decode: $data'); @@ -87,12 +87,12 @@ class MapTypeAppTypeTransformer { } if (data != null) { if(data.runtimeType == String) { - switch (data.toString()) { - case r'None': return MapTypeApp.none; - case r'Normal': return MapTypeApp.normal; - case r'Satellite': return MapTypeApp.satellite; - case r'Terrain': return MapTypeApp.terrain; - case r'Hybrid': return MapTypeApp.hybrid; + switch (data.toString().toLowerCase()) { + case r'none': return MapTypeApp.none; + case r'normal': return MapTypeApp.normal; + case r'satellite': return MapTypeApp.satellite; + case r'terrain': return MapTypeApp.terrain; + case r'hybrid': return MapTypeApp.hybrid; default: if (!allowNull) { throw ArgumentError('Unknown enum value to decode: $data');