Search fix + fix pdf generation with special character
This commit is contained in:
parent
2056fc23fb
commit
11f5e2860f
@ -23,7 +23,7 @@ class PDFHelper {
|
|||||||
child:
|
child:
|
||||||
pw.Column(
|
pw.Column(
|
||||||
children: [
|
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.Padding(padding: const pw.EdgeInsets.only(top: 20)),
|
||||||
pw.BarcodeWidget(
|
pw.BarcodeWidget(
|
||||||
data: section.id,
|
data: section.id,
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import 'package:diacritic/diacritic.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:manager_app/Components/string_input_container.dart';
|
import 'package:manager_app/Components/string_input_container.dart';
|
||||||
import 'package:manager_app/Models/managerContext.dart';
|
import 'package:manager_app/Models/managerContext.dart';
|
||||||
@ -172,6 +173,6 @@ class _SectionReorderListState extends State<SectionReorderList> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void filterResource() {
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import 'package:manager_app/app_context.dart';
|
|||||||
import 'package:manager_app/constants.dart';
|
import 'package:manager_app/constants.dart';
|
||||||
import 'package:manager_api_new/api.dart';
|
import 'package:manager_api_new/api.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
import 'package:diacritic/diacritic.dart';
|
||||||
|
|
||||||
class ResourceBodyGrid extends StatefulWidget {
|
class ResourceBodyGrid extends StatefulWidget {
|
||||||
final List<ResourceDTO> resources; //return ResourceDTO
|
final List<ResourceDTO> resources; //return ResourceDTO
|
||||||
@ -182,7 +183,7 @@ class _ResourceBodyGridState extends State<ResourceBodyGrid> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void filterResource() {
|
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();
|
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();
|
resourcesToShow = resourcesToShow.where((resource) => resource.id == null || getTypesInSelected.contains(resource.type)).toList();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -217,6 +217,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "2.2.4"
|
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:
|
drag_and_drop_lists:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|||||||
@ -51,6 +51,7 @@ dependencies:
|
|||||||
# path: plugins/window_size
|
# path: plugins/window_size
|
||||||
# ref: 927f8cbc09b35d85245c095f2db8df9b186f6618
|
# ref: 927f8cbc09b35d85245c095f2db8df9b186f6618
|
||||||
password_credential: ^0.3.1
|
password_credential: ^0.3.1
|
||||||
|
diacritic: ^0.1.3
|
||||||
manager_api_new:
|
manager_api_new:
|
||||||
path: manager_api_new
|
path: manager_api_new
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user