Skip to content

Commit b54d4b6

Browse files
committed
fix linter warnings
1 parent 5e8410e commit b54d4b6

File tree

8 files changed

+25
-15
lines changed

8 files changed

+25
-15
lines changed

example/lib/UserSelect.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class _UserSelectState extends State<UserSelect> {
3131
child: SearchField<UserModel>(
3232
maxSuggestionsInViewPort: 5,
3333
itemHeight: 80,
34-
hint: 'Search for users',
3534
suggestionsDecoration: SuggestionDecoration(
3635
borderRadius: BorderRadius.only(
3736
bottomLeft: Radius.circular(8.0),
@@ -61,6 +60,7 @@ class _UserSelectState extends State<UserSelect> {
6160
style: BorderStyle.solid,
6261
width: 1.0)),
6362
searchInputDecoration: SearchInputDecoration(
63+
hintText: 'Search for users',
6464
filled: true,
6565
fillColor: Colors.grey.withValues(alpha: 0.2),
6666
focusedBorder: OutlineInputBorder(

example/lib/country_search.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ class _CountrySearchState extends State<CountrySearch> {
6363
.toList(),
6464
suggestionState: Suggestion.hidden,
6565
controller: _searchController,
66-
hint: 'Search by country name',
6766
maxSuggestionsInViewPort: 4,
6867
itemHeight: 45,
6968
searchInputDecoration: SearchInputDecoration(
69+
hintText: 'Search by country name',
7070
textCapitalization: TextCapitalization.words,
7171
),
7272
validator: (x) {

example/lib/demo.dart

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ class _DemoAppState extends State<DemoApp> {
8282
_suggestions.map((e) => SearchFieldListItem(e)).toList(),
8383
textInputAction: TextInputAction.next,
8484
controller: _searchController,
85-
hint: 'SearchField Example 1',
85+
searchInputDecoration: SearchInputDecoration(
86+
hintText: 'SearchField Example 1',
87+
),
8688
// selectedValue: SearchFieldListItem(_suggestions[2], SizedBox()),
8789
maxSuggestionsInViewPort: 3,
8890
itemHeight: 45,
@@ -114,14 +116,14 @@ class _DemoAppState extends State<DemoApp> {
114116
onSaved: (x) {},
115117
suggestionState: Suggestion.expand,
116118
textInputAction: TextInputAction.next,
117-
hint: 'SearchField Example 2',
118119
validator: (x) {
119120
if (!_statesOfIndia.contains(x) || x!.isEmpty) {
120121
return 'Please Enter a valid State';
121122
}
122123
return null;
123124
},
124125
searchInputDecoration: SearchInputDecoration(
126+
hintText: 'SearchField Example 2',
125127
searchStyle: TextStyle(
126128
fontSize: 18,
127129
color: Colors.black.withValues(alpha: 0.8),
@@ -149,7 +151,6 @@ class _DemoAppState extends State<DemoApp> {
149151
child: SearchField(
150152
maxSuggestionsInViewPort: 5,
151153
itemHeight: 40,
152-
hint: 'SearchField Example 3',
153154
suggestionsDecoration: SuggestionDecoration(
154155
borderRadius: BorderRadius.only(
155156
bottomLeft: Radius.circular(8.0),
@@ -180,6 +181,7 @@ class _DemoAppState extends State<DemoApp> {
180181
width: 1.0)),
181182
searchInputDecoration: SearchInputDecoration(
182183
filled: true,
184+
hintText: 'SearchField Example 3',
183185
fillColor: Colors.grey.withValues(alpha: 0.2),
184186
focusedBorder: OutlineInputBorder(
185187
borderSide: const BorderSide(
@@ -243,11 +245,11 @@ class _DemoAppState extends State<DemoApp> {
243245
_suggestions.map((e) => SearchFieldListItem(e)).toList(),
244246
suggestionState: Suggestion.hidden,
245247
searchInputDecoration: SearchInputDecoration(
248+
hintText: 'SearchField example 4',
246249
floatingLabelBehavior: FloatingLabelBehavior.auto,
247250
labelText: 'SearchField',
248251
border: OutlineInputBorder(),
249252
),
250-
hint: 'SearchField example 4',
251253
maxSuggestionsInViewPort: 6,
252254
suggestionDirection: SuggestionDirection.up,
253255
itemHeight: 45,

example/lib/dynamic_height.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class _DynamicHeightExampleState extends State<DynamicHeightExample> {
4242
child: SearchField<UserModel>(
4343
dynamicHeight: true,
4444
// maxSuggestionBoxHeight: MediaQuery.of(context).size.height * 0.8,
45-
hint: 'Search for users dynamic height',
4645
suggestionsDecoration: SuggestionDecoration(
4746
borderRadius: BorderRadius.only(
4847
bottomLeft: Radius.circular(8.0),
@@ -73,6 +72,7 @@ class _DynamicHeightExampleState extends State<DynamicHeightExample> {
7372
width: 1.0)),
7473
searchInputDecoration: SearchInputDecoration(
7574
filled: true,
75+
hintText: 'Search for users dynamic height',
7676
fillColor: Colors.grey.withValues(alpha: 0.2),
7777
focusedBorder: OutlineInputBorder(
7878
borderSide: const BorderSide(

example/lib/network_sample.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,13 @@ class _NetworkSampleState extends State<NetworkSample> {
8383
color: Colors.white,
8484
))),
8585
key: const Key('searchfield'),
86-
hint: 'Load suggestions from network',
8786
itemHeight: 50,
8887
scrollbarDecoration: ScrollbarDecoration(),
8988
onTapOutside: (x) {},
9089
suggestionDirection: SuggestionDirection.up,
9190
suggestionStyle: const TextStyle(fontSize: 20, color: Colors.black),
9291
searchInputDecoration: SearchInputDecoration(
92+
hintText: 'Load suggestions from network',
9393
focusedBorder: OutlineInputBorder(
9494
borderRadius: BorderRadius.circular(24),
9595
borderSide: const BorderSide(

example/lib/pagination.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,13 @@ class _PaginationState extends State<Pagination> {
106106
color: Colors.black,
107107
))),
108108
key: const Key('searchfield'),
109-
hint: 'Load Paginated suggestions from network',
110109
itemHeight: 50,
111110
maxSuggestionsInViewPort: 4,
112111
scrollbarDecoration: ScrollbarDecoration(),
113112
onTapOutside: (x) {},
114113
suggestionStyle: const TextStyle(fontSize: 20, color: Colors.black),
115114
searchInputDecoration: SearchInputDecoration(
115+
hintText: 'Load Paginated suggestions from network',
116116
focusedBorder: OutlineInputBorder(
117117
borderRadius: BorderRadius.circular(24),
118118
borderSide: const BorderSide(

example/lib/sample.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,16 @@ class _SearchFieldSampleState extends State<SearchFieldSample> {
119119
height: 20,
120120
),
121121
SearchField(
122-
hint: 'Basic SearchField',
123122
dynamicHeight: true,
124123
maxSuggestionBoxHeight: 300,
125124
onSuggestionTap: (SearchFieldListItem<String> item) {
126125
setState(() {
127126
selectedValue = item;
128127
});
129128
},
129+
searchInputDecoration: SearchInputDecoration(
130+
hintText: 'Basic SearchField',
131+
),
130132
selectedValue: selectedValue,
131133
suggestions:
132134
suggestions.map(SearchFieldListItem<String>.new).toList(),
@@ -211,7 +213,6 @@ class _SearchFieldSampleState extends State<SearchFieldSample> {
211213
onSubmit: (x) {},
212214
autofocus: false,
213215
key: const Key('searchfield'),
214-
hint: 'Search by country name',
215216
itemHeight: 50,
216217
onTapOutside: (x) {
217218
// focus.unfocus();
@@ -237,6 +238,7 @@ class _SearchFieldSampleState extends State<SearchFieldSample> {
237238
),
238239
searchInputDecoration: SearchInputDecoration(
239240
searchStyle: TextStyle(fontSize: 18, color: Colors.black),
241+
hintText: 'Search by country name',
240242
hintStyle: TextStyle(fontSize: 18, color: Colors.grey),
241243
focusedBorder: OutlineInputBorder(
242244
borderRadius: BorderRadius.circular(24),
@@ -289,11 +291,13 @@ class _SearchFieldSampleState extends State<SearchFieldSample> {
289291
),
290292
SearchField(
291293
enabled: false,
292-
hint: 'Disabled SearchField',
293294
suggestions: ['ABC', 'DEF', 'GHI', 'JKL']
294295
.map(SearchFieldListItem<String>.new)
295296
.toList(),
296297
suggestionState: Suggestion.expand,
298+
searchInputDecoration: SearchInputDecoration(
299+
hintText: 'Disabled SearchField',
300+
),
297301
),
298302
SizedBox(
299303
height: 50,

test/searchfield_test.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ void main() {
204204
child: Column(
205205
children: [
206206
SearchField<City>(
207-
hint: 'Search for a city or zip code',
207+
searchInputDecoration: SearchInputDecoration(
208+
hintText: 'Search for a city or zip code',
209+
),
208210
// dynamicHeight: true,
209211
maxSuggestionBoxHeight: 300,
210212
onSuggestionTap: (SearchFieldListItem<City> item) {
@@ -1917,7 +1919,9 @@ void main() {
19171919
print(tapped.searchKey);
19181920
},
19191921
inputType: TextInputType.text,
1920-
hint: 'Search',
1922+
searchInputDecoration: SearchInputDecoration(
1923+
hintText: 'Search',
1924+
),
19211925
itemHeight: 51,
19221926
maxSuggestionBoxHeight: 100,
19231927
showEmpty: false,
@@ -2254,6 +2258,6 @@ void main() {
22542258
expect(overlayFinder, findsOneWidget);
22552259
expect(overlaySize.width, closeTo(logicalWidth, 0.1));
22562260
});
2257-
2261+
22582262
// todo: add test for `keepSearchOnSelection`
22592263
}

0 commit comments

Comments
 (0)