diff --git a/lib/Helpers/PDFHelper.dart b/lib/Helpers/PDFHelper.dart index a0daca7..10690ac 100644 --- a/lib/Helpers/PDFHelper.dart +++ b/lib/Helpers/PDFHelper.dart @@ -23,7 +23,7 @@ class PDFHelper { child: pw.Column( children: [ - pw.Text(section.label), //style: pw.TextStyle(font: ttf, fontSize: 30) + pw.Text(section.label.replaceAll(RegExp("[^A-Za-z0-9---():!éàèëêäâç' ]"), '')), //style: pw.TextStyle(font: ttf, fontSize: 30) pw.Padding(padding: const pw.EdgeInsets.only(top: 20)), pw.BarcodeWidget( data: section.id, diff --git a/lib/Screens/Configurations/section_reorderList.dart b/lib/Screens/Configurations/section_reorderList.dart index bec33dd..25099b8 100644 --- a/lib/Screens/Configurations/section_reorderList.dart +++ b/lib/Screens/Configurations/section_reorderList.dart @@ -1,3 +1,4 @@ +import 'package:diacritic/diacritic.dart'; import 'package:flutter/material.dart'; import 'package:manager_app/Components/string_input_container.dart'; import 'package:manager_app/Models/managerContext.dart'; @@ -172,6 +173,6 @@ class _SectionReorderListState extends State { } void filterResource() { - sections = filterSearch.isEmpty ? widget.sectionsIn: widget.sectionsIn.where((SectionDTO section) => section.label.toUpperCase().contains(filterSearch.toUpperCase())).toList(); + sections = filterSearch.isEmpty ? widget.sectionsIn: widget.sectionsIn.where((SectionDTO section) => removeDiacritics(section.label.toUpperCase()).contains(removeDiacritics(filterSearch.toUpperCase()))).toList(); } } diff --git a/lib/Screens/Resources/resource_body_grid.dart b/lib/Screens/Resources/resource_body_grid.dart index 89be8c4..96c79ba 100644 --- a/lib/Screens/Resources/resource_body_grid.dart +++ b/lib/Screens/Resources/resource_body_grid.dart @@ -7,6 +7,7 @@ import 'package:manager_app/app_context.dart'; import 'package:manager_app/constants.dart'; import 'package:manager_api_new/api.dart'; import 'package:provider/provider.dart'; +import 'package:diacritic/diacritic.dart'; class ResourceBodyGrid extends StatefulWidget { final List resources; //return ResourceDTO @@ -182,7 +183,7 @@ class _ResourceBodyGridState extends State { } void filterResource() { - resourcesToShow = filterSearch.isEmpty ? widget.resources: widget.resources.where((ResourceDTO resource) => resource.id == null || resource.label.toUpperCase().contains(filterSearch.toUpperCase())).toList(); + resourcesToShow = filterSearch.isEmpty ? widget.resources: widget.resources.where((ResourceDTO resource) => resource.id == null || removeDiacritics(resource.label.toUpperCase()).contains(removeDiacritics(filterSearch.toUpperCase()))).toList(); var getTypesInSelected = resource_types.where((ft) => selectedTypes.contains(ft.label)).map((rt) => rt.type).toList(); resourcesToShow = resourcesToShow.where((resource) => resource.id == null || getTypesInSelected.contains(resource.type)).toList(); } diff --git a/pubspec.lock b/pubspec.lock index 050177a..abd2a22 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -217,6 +217,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.2.4" + diacritic: + dependency: "direct main" + description: + name: diacritic + sha256: c09a420e737dc036122121fea9f774767e95068f34a17894ee9db30c5bda3075 + url: "https://pub.dev" + source: hosted + version: "0.1.3" drag_and_drop_lists: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 31c1939..f5b91dc 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -51,6 +51,7 @@ dependencies: # path: plugins/window_size # ref: 927f8cbc09b35d85245c095f2db8df9b186f6618 password_credential: ^0.3.1 + diacritic: ^0.1.3 manager_api_new: path: manager_api_new