Skip to content

Commit

Permalink
fix: improve the logic to filter emojis or icons by keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
asjqkkkk committed Dec 19, 2024
1 parent 694abea commit 1909e49
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ class IconGroup {
String get displayName => name.replaceAll('_', ' ');

IconGroup filter(String keyword) {
final lowercaseKey = keyword.toLowerCase();
final filteredIcons = icons
.where(
(icon) => icon.keywords.any((k) => k.contains(keyword.toLowerCase())),
(icon) =>
icon.keywords.any((k) => k.contains(lowercaseKey)) ||
icon.name.contains(lowercaseKey),
)
.toList();
return IconGroup(name: name, icons: filteredIcons);
Expand Down
4 changes: 2 additions & 2 deletions frontend/appflowy_flutter/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -757,8 +757,8 @@ packages:
dependency: "direct main"
description:
path: "."
ref: "38c2c42"
resolved-ref: "38c2c429212af6b72a0af829bb0dd3f3eb4ce2c7"
ref: "8a9fa49"
resolved-ref: "8a9fa491cb3b86baf78b0a33c2c37a29d1cae028"
url: "https://github.com/LucasXu0/emoji_mart.git"
source: git
version: "1.0.2"
Expand Down
2 changes: 1 addition & 1 deletion frontend/appflowy_flutter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ dependencies:
flutter_emoji_mart:
git:
url: https://github.com/LucasXu0/emoji_mart.git
ref: "38c2c42"
ref: "8a9fa49"
flutter_math_fork: ^0.7.3
flutter_slidable: ^3.0.0

Expand Down

0 comments on commit 1909e49

Please sign in to comment.