Closed frhnfrq closed 2 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.
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'),
),
I had solved it by forking the project and change the empty display behavior
I had solved it by forking the project and change the empty display behavior
Send your PR for help the project
This is now fixed in version 1.0.3 🎉 You can add anything in onEmpty
or onError
Problem not solved. If you have headers and/or footers, the empty display takes full height. Strange behaviour.
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
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.