Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Commit c70b658

Browse files
tijoforyounshahan
authored andcommitted
Fix generic types in typedef
PiperOrigin-RevId: 179516024
1 parent db62376 commit c70b658

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/model/selection/string_selection_options.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import 'package:angular_components/utils/async/async.dart';
1212
String _stringFormatSuggestion<T>(T value) =>
1313
'$value'.replaceAll(' ', '').toLowerCase();
1414

15-
typedef StringSuggestionFilter(suggestion, String filterQuery);
15+
typedef bool StringSuggestionFilter<T>(T suggestion, String filterQuery);
1616

1717
/// The class is meant to be used in areas where a selection can be represented
1818
/// as a string.
@@ -50,7 +50,7 @@ class StringSelectionOptions<T> extends SelectionOptions<T>
5050

5151
/// Function for filtering a single suggestion/option, defaults to
5252
/// [filterOption] method.
53-
StringSuggestionFilter _suggestionFilter;
53+
StringSuggestionFilter<T> _suggestionFilter;
5454

5555
/// The [ItemRenderer] that sanitizes options and queries before filtering.
5656
ItemRenderer _sanitizeString;
@@ -68,7 +68,7 @@ class StringSelectionOptions<T> extends SelectionOptions<T>
6868
/// [shouldSort] is a simple way to apply the default sorting rules.
6969
StringSelectionOptions(List<T> options,
7070
{ItemRenderer<T> toFilterableString,
71-
StringSuggestionFilter suggestionFilter,
71+
StringSuggestionFilter<T> suggestionFilter,
7272
ItemRenderer sanitizeString: _stringFormatSuggestion,
7373
bool shouldSort: false})
7474
: this.withOptionGroups([new OptionGroup(options)],
@@ -79,7 +79,7 @@ class StringSelectionOptions<T> extends SelectionOptions<T>
7979

8080
StringSelectionOptions.withOptionGroups(List<OptionGroup<T>> optionGroups,
8181
{ItemRenderer<T> toFilterableString,
82-
StringSuggestionFilter suggestionFilter,
82+
StringSuggestionFilter<T> suggestionFilter,
8383
ItemRenderer sanitizeString: _stringFormatSuggestion,
8484
bool shouldSort: false})
8585
: _toFilterableString = toFilterableString ??

0 commit comments

Comments
 (0)