indjec / Flutter-Instagram-Profile-UI-Clone

16 stars 2 forks source link

pull donw to refresh not work #1

Open theappideasankit opened 1 year ago

indjec commented 1 year ago

You can wrap the body with a RefreshIndicator (which takes a onRefresh callback to fetch data when pulled to refresh, once onRefresh is called the UI will rebuild)

RefreshIndicator(
    onRefresh: _pullRefresh,
    child: ...
),
theappideasankit commented 1 year ago

this not work you can check 1st in your code

theappideasankit commented 1 year ago

please update your code i really want this

indjec commented 1 year ago

Try wrapping the NestedScrollView with this

RefreshIndicator(
        notificationPredicate: (notification) {
            if (notification is OverscrollNotification || Platform.isIOS) {
              return notification.depth == 2;
            }
            return notification.depth == 0;
          },
          onRefresh: () => Future.value(null),
         child: NestedScrollView(...),
       ),
)

This works for me

theappideasankit commented 1 year ago

thanks it worked ,is it possible to bouncing scroll?

theappideasankit commented 1 year ago

??

rifkiard commented 7 months ago

How to keep the scroll position of each tab when moving to another tab and back again?