chore(mobile): clean up linter problems (#1000)

This commit is contained in:
Alex
2022-11-21 06:13:14 -06:00
committed by GitHub
parent bc9ee1d611
commit 39b7ab66d4
32 changed files with 188 additions and 173 deletions

View File

@@ -39,14 +39,14 @@ class SearchPage extends HookConsumerWidget {
[],
);
_onSearchSubmitted(String searchTerm) async {
onSearchSubmitted(String searchTerm) async {
searchFocusNode.unfocus();
ref.watch(searchPageStateProvider.notifier).disableSearch();
AutoRouter.of(context).push(SearchResultRoute(searchTerm: searchTerm));
}
_buildPlaces() {
buildPlaces() {
return curatedLocation.when(
loading: () => SizedBox(
height: imageSize,
@@ -97,7 +97,7 @@ class SearchPage extends HookConsumerWidget {
);
}
_buildThings() {
buildThings() {
return curatedObjects.when(
loading: () => SizedBox(
height: imageSize,
@@ -155,7 +155,7 @@ class SearchPage extends HookConsumerWidget {
return Scaffold(
appBar: SearchBar(
searchFocusNode: searchFocusNode,
onSubmitted: _onSearchSubmitted,
onSubmitted: onSearchSubmitted,
),
body: GestureDetector(
onTap: () {
@@ -174,7 +174,7 @@ class SearchPage extends HookConsumerWidget {
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14),
).tr(),
),
_buildPlaces(),
buildPlaces(),
Padding(
padding: const EdgeInsets.all(16.0),
child: const Text(
@@ -182,11 +182,11 @@ class SearchPage extends HookConsumerWidget {
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 14),
).tr(),
),
_buildThings()
buildThings()
],
),
if (isSearchEnabled)
SearchSuggestionList(onSubmitted: _onSearchSubmitted),
SearchSuggestionList(onSubmitted: onSearchSubmitted),
],
),
),

View File

@@ -38,7 +38,7 @@ class SearchResultPage extends HookConsumerWidget {
[],
);
_onSearchSubmitted(String newSearchTerm) {
onSearchSubmitted(String newSearchTerm) {
debugPrint("Re-Search with $newSearchTerm");
searchFocusNode?.unfocus();
isNewSearch.value = false;
@@ -46,7 +46,7 @@ class SearchResultPage extends HookConsumerWidget {
ref.watch(searchResultPageProvider.notifier).search(newSearchTerm);
}
_buildTextField() {
buildTextField() {
return TextField(
controller: searchTermController,
focusNode: searchFocusNode,
@@ -60,7 +60,7 @@ class SearchResultPage extends HookConsumerWidget {
onSubmitted: (searchTerm) {
if (searchTerm.isNotEmpty) {
searchTermController.clear();
_onSearchSubmitted(searchTerm);
onSearchSubmitted(searchTerm);
} else {
isNewSearch.value = false;
}
@@ -80,7 +80,7 @@ class SearchResultPage extends HookConsumerWidget {
);
}
_buildChip() {
buildChip() {
return Chip(
label: Wrap(
spacing: 5,
@@ -108,7 +108,7 @@ class SearchResultPage extends HookConsumerWidget {
);
}
_buildSearchResult() {
buildSearchResult() {
var searchResultPageState = ref.watch(searchResultPageProvider);
var searchResultRenderList = ref.watch(searchRenderListProvider);
@@ -154,7 +154,7 @@ class SearchResultPage extends HookConsumerWidget {
isNewSearch.value = true;
searchFocusNode?.requestFocus();
},
child: isNewSearch.value ? _buildTextField() : _buildChip(),
child: isNewSearch.value ? buildTextField() : buildChip(),
),
centerTitle: false,
),
@@ -168,9 +168,9 @@ class SearchResultPage extends HookConsumerWidget {
},
child: Stack(
children: [
_buildSearchResult(),
buildSearchResult(),
if (isNewSearch.value)
SearchSuggestionList(onSubmitted: _onSearchSubmitted),
SearchSuggestionList(onSubmitted: onSearchSubmitted),
],
),
),