update max size title + fix map type change + category not showed

This commit is contained in:
Thomas Fransolet 2024-03-04 16:24:13 +01:00
parent 5fd5aa5c53
commit afa9ca4fd5
5 changed files with 19 additions and 18 deletions

View File

@ -8,9 +8,9 @@ import 'package:manager_app/constants.dart';
class CategoryInputContainer extends StatefulWidget { class CategoryInputContainer extends StatefulWidget {
final Color color; final Color color;
final String label; final String label;
final List<CategorieDTO> initialValue; List<CategorieDTO> initialValue;
final ValueChanged<List<CategorieDTO>> onChanged; final ValueChanged<List<CategorieDTO>> onChanged;
const CategoryInputContainer({ CategoryInputContainer({
Key? key, Key? key,
this.color = kSecond, this.color = kSecond,
required this.label, required this.label,
@ -50,6 +50,7 @@ class _CategoryInputContainerState extends State<CategoryInputContainer> {
List<CategorieDTO> initials = widget.initialValue; List<CategorieDTO> initials = widget.initialValue;
showCreateOrUpdateCategories("Catégories", initials, newValues, (value) { showCreateOrUpdateCategories("Catégories", initials, newValues, (value) {
widget.onChanged(value); widget.onChanged(value);
widget.initialValue = value;
}, context); }, context);
}, },
child: Container( child: Container(

View File

@ -37,7 +37,7 @@ class _TranslationInputAndResourceContainerState extends State<TranslationInputA
controllerQuill.onTextChanged((p0) async { controllerQuill.onTextChanged((p0) async {
var plainText = await controllerQuill.getPlainText(); var plainText = await controllerQuill.getPlainText();
if(widget.isTitle) { if(widget.isTitle) {
if(plainText.length > 60) { if(plainText.length > 110) {
print("to much text au dessus"); print("to much text au dessus");
controllerQuill.undo(); controllerQuill.undo();
} }

View File

@ -36,7 +36,7 @@ class _TranslationInputContainerState extends State<TranslationInputContainer> w
controllerQuill.onTextChanged((p0) async { controllerQuill.onTextChanged((p0) async {
var plainText = await controllerQuill.getPlainText(); var plainText = await controllerQuill.getPlainText();
if(widget.isTitle) { if(widget.isTitle) {
if(plainText.length > 60) { if(plainText.length > 110) {
print("to much text au dessus"); print("to much text au dessus");
controllerQuill.undo(); controllerQuill.undo();
} }

View File

@ -75,7 +75,7 @@ Future<CategorieDTO?> showNewOrUpdateCategory(CategorieDTO? inputCategorieDTO, A
isHTML: true, isHTML: true,
) )
), ),
Container( /*Container(
height: size.height * 0.2, height: size.height * 0.2,
constraints: BoxConstraints(minHeight: 50, maxHeight: 80), constraints: BoxConstraints(minHeight: 50, maxHeight: 80),
child: ResourceInputContainer( child: ResourceInputContainer(
@ -95,7 +95,7 @@ Future<CategorieDTO?> showNewOrUpdateCategory(CategorieDTO? inputCategorieDTO, A
}, },
isSmall: true isSmall: true
), ),
), ),*/
], ],
), ),
], ],

View File

@ -73,12 +73,12 @@ class MapTypeAppTypeTransformer {
/// and users are still using an old app with the old code. /// and users are still using an old app with the old code.
MapTypeApp? decode(dynamic data, {bool allowNull = true}) { MapTypeApp? decode(dynamic data, {bool allowNull = true}) {
if (data != null) { if (data != null) {
switch (data.toString()) { switch (data.toString().toLowerCase()) {
case r'None': return MapTypeApp.none; case r'none': return MapTypeApp.none;
case r'Normal': return MapTypeApp.normal; case r'normal': return MapTypeApp.normal;
case r'Satellite': return MapTypeApp.satellite; case r'satellite': return MapTypeApp.satellite;
case r'Terrain': return MapTypeApp.terrain; case r'terrain': return MapTypeApp.terrain;
case r'Hybrid': return MapTypeApp.hybrid; case r'hybrid': return MapTypeApp.hybrid;
default: default:
if (!allowNull) { if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data'); throw ArgumentError('Unknown enum value to decode: $data');
@ -87,12 +87,12 @@ class MapTypeAppTypeTransformer {
} }
if (data != null) { if (data != null) {
if(data.runtimeType == String) { if(data.runtimeType == String) {
switch (data.toString()) { switch (data.toString().toLowerCase()) {
case r'None': return MapTypeApp.none; case r'none': return MapTypeApp.none;
case r'Normal': return MapTypeApp.normal; case r'normal': return MapTypeApp.normal;
case r'Satellite': return MapTypeApp.satellite; case r'satellite': return MapTypeApp.satellite;
case r'Terrain': return MapTypeApp.terrain; case r'terrain': return MapTypeApp.terrain;
case r'Hybrid': return MapTypeApp.hybrid; case r'hybrid': return MapTypeApp.hybrid;
default: default:
if (!allowNull) { if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data'); throw ArgumentError('Unknown enum value to decode: $data');