fix: some fixes

This commit is contained in:
2024-06-09 12:47:59 +03:00
parent 04ee6d1699
commit 9335e8e694
7 changed files with 80 additions and 85 deletions

View File

@@ -73,6 +73,7 @@ class _MainPageState extends State<MainPage> {
bool isSearching = false;
List<GymCategory> categories = [];
GymCategory? selectedCategory;
final ScrollController _scrollController = ScrollController();
@override
void initState() {
@@ -122,7 +123,7 @@ class _MainPageState extends State<MainPage> {
});
}
void _onSearch() async {
void _onSearch() {
final categoryId = selectedCategory == null ? '' : selectedCategory!.id;
_searchItems(searchText: searchText, categoryId: categoryId);
}
@@ -250,7 +251,9 @@ class _MainPageState extends State<MainPage> {
onEndOfPage: _onLoad,
isLoading: isLoading,
child: Scrollbar(
controller: _scrollController,
child: ListView(
controller: _scrollController,
children: [
filteredData.isEmpty &&
(searchText != '' || selectedCategory != null) &&