Skip to content

Commit

Permalink
docs(search_condition): 📖 add more examples for highlightedRange
Browse files Browse the repository at this point in the history
  • Loading branch information
albertms10 committed Feb 4, 2024
1 parent d55da16 commit bb958f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/src/model/search_condition.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ enum SearchCondition {
///
/// Example:
/// ```dart
/// SearchCondition.startingWith.highlightedRange('dart', 'da')
/// == (0, 2)
/// SearchCondition.startingWith.highlightedRange('pla', 'pl') == (0, 2)
/// SearchCondition.endingIn.highlightedRange('alçària', 'aria') == (3, 7)
/// SearchCondition.doesNotContain.highlightedRange('alçària', 'b') == null
/// ```
(int start, int end)? highlightedRange(String word, String query) {
switch (this) {
Expand Down
2 changes: 1 addition & 1 deletion test/model/search_condition_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void main() {
const (0, 1),
);
expect(
SearchCondition.startingWith.highlightedRange('fabària', 'faba'),
SearchCondition.startingWith.highlightedRange('alçària', 'alça'),
const (0, 4),
);

Expand Down

0 comments on commit bb958f3

Please sign in to comment.