"Update SearchPage itemBuilder to load more results and fix Checkbox layout"
The SearchPage's itemBuilder has been updated to load more results as the user scrolls down. It now checks if the current index is a multiple of
This commit is contained in:
parent
f749dbaf0e
commit
dba3668c4c
|
|
@ -30,12 +30,19 @@ class SearchPage extends StatelessWidget {
|
|||
builder: (context, state) => ListView.builder(
|
||||
padding: const EdgeInsets.all(16)
|
||||
.copyWith(top: state.selectedCats.length <= 1 ? 72 : 16),
|
||||
itemBuilder: (context, index) => Padding(
|
||||
itemBuilder: (context, index) {
|
||||
index += 2;
|
||||
if (index % 15 == 0 && state.lastPage != state.page) {
|
||||
state.searchAll(page: state.page + 1);
|
||||
}
|
||||
index -= 2;
|
||||
return Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8),
|
||||
child: SearchResultItem(
|
||||
item: state.results[index],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
itemCount: state.results.length,
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -49,7 +49,6 @@ class _DidvanCheckboxState extends State<DidvanCheckbox> {
|
|||
widget.onChanged(_value);
|
||||
},
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
DidvanText(widget.title),
|
||||
],
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in New Issue