Skip to content

Commit

Permalink
feat: make nutrient search accentuation insensitive (#3792)
Browse files Browse the repository at this point in the history
* format

* feat: make nutrient search accentuation insensitive

* feat: make nutrient search accentuation insensitive

* fix: add check on item

* Update packages/smooth_app/pubspec.yaml

---------

Co-authored-by: monsieurtanuki <fabrice_fontaine@hotmail.com>
  • Loading branch information
Sudhanva-Nadiger and monsieurtanuki committed Mar 21, 2023
1 parent 4b3f2e7 commit cd61afa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:diacritic/diacritic.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
import 'package:openfoodfacts/openfoodfacts.dart';
Expand Down Expand Up @@ -55,9 +56,11 @@ class NutritionAddNutrientButton extends StatelessWidget {
controller: nutritionTextController,
onChanged: (String? query) => setState(
() => filteredList = leftovers
.where((OrderedNutrient item) => item.name!
.toLowerCase()
.contains(query!.toLowerCase()))
.where((OrderedNutrient item) =>
removeDiacritics(item.name!)
.toLowerCase()
.contains(
removeDiacritics(query!).toLowerCase()))
.toList(),
),
),
Expand Down
1 change: 1 addition & 0 deletions packages/smooth_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dependencies:
visibility_detector: 0.4.0+2
assorted_layout_widgets: 7.0.0
app_settings: 4.2.0
diacritic: 0.1.3

camera: 0.10.3+2
mobile_scanner: 3.1.0
Expand Down

0 comments on commit cd61afa

Please sign in to comment.