vedartm / paginate_firestore

A flutter package to simplify pagination with firestore data 🗃
https://pub.dev/packages/paginate_firestore
MIT License
113 stars 138 forks source link

Empty display taking full height #95

Closed frhnfrq closed 2 years ago

frhnfrq commented 3 years ago

I think the empty display shouldn't take full height and be scrollable by default. I am trying to center my empty display widget at the center of the screen but it's not fully centered because it's being wrapped by the libraries' container which has a full screen height along with a scroll widget.

loki187 commented 3 years ago

I have also this problem. When there are no data I want to show image in the middle of screen. Now this image is not aligned properly -> in the center, but it is scrollable because there are other elements on the screen e.g. search bar, buttons on the bottom etc.

imamhossain94 commented 3 years ago

Here is what I did to center the emptyDisplay Widget. By adding a bottom padding you can center the emptyDisplay Widget.

emptyDisplay: Padding(
    padding: EdgeInsets.only(bottom: MediaQuery.of(context).size.height/2-100),
    child: Text('Empty'),
  ),
frhnfrq commented 3 years ago

I had solved it by forking the project and change the empty display behavior

Freyien commented 2 years ago

I had solved it by forking the project and change the empty display behavior

Send your PR for help the project

vedartm commented 2 years ago

This is now fixed in version 1.0.3 🎉 You can add anything in onEmpty or onError

kiloki-official commented 2 years ago

Problem not solved. If you have headers and/or footers, the empty display takes full height. Strange behaviour.

IvoBiaus commented 1 year ago

I solved it by following this comment at other issue: https://github.com/vedartm/paginate_firestore/issues/145#issuecomment-1203276580 But just removing the SingleChildScrollView didn't fixed it for me because the Container was being given all the screen height, which in my case made no sense, so i just changed the _buildWithScrollView function to return the onEmpty widget, which is the behavior that i was expecting. Widget _buildWithScrollView(BuildContext context, Widget child) => child