Added pull to refresh clients

This commit is contained in:
Juan Gilsanz Polo 2022-10-09 01:20:38 +02:00
parent e8d3e14245
commit 5fa174ffc5

View file

@ -43,6 +43,7 @@ class _ClientsListState extends State<ClientsList> {
isVisible = true;
widget.scrollController.addListener(() {
if (mounted) {
if (widget.scrollController.position.userScrollDirection == ScrollDirection.reverse) {
if (mounted && isVisible == true) {
setState(() => isVisible = false);
@ -55,6 +56,7 @@ class _ClientsListState extends State<ClientsList> {
}
}
}
}
});
}
@ -232,7 +234,9 @@ class _ClientsListState extends State<ClientsList> {
case 1:
return Stack(
children: [
Column(
RefreshIndicator(
onRefresh: widget.fetchClients,
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
Padding(
@ -296,6 +300,7 @@ class _ClientsListState extends State<ClientsList> {
),
],
),
),
AnimatedPositioned(
duration: const Duration(milliseconds: 100),
curve: Curves.easeInOut,