-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor ListState and paginated screens #334
base: master
Are you sure you want to change the base?
Conversation
It's now used only for the calendar, as that will be refactored a lot soon.
88b536d
to
259946e
Compare
final state = cubit.state; | ||
if (state is ResultsListState && | ||
state is! DoneListState && | ||
state is! LoadingMoreListState) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed as more
already checks this.
slivers = [ | ||
...resultSlivers, | ||
if (state is LoadingMoreListState) | ||
const SliverPadding( | ||
padding: EdgeInsets.only(top: 16), | ||
sliver: SliverToBoxAdapter( | ||
child: Center(child: CircularProgressIndicator()), | ||
), | ||
), | ||
const SliverSafeArea( | ||
minimum: EdgeInsets.only(bottom: 8), | ||
sliver: SliverPadding(padding: EdgeInsets.zero), | ||
), | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This only adds a safe area at the bottom, and if there needs to be a safearea at the top it will also add that in this widget.
Maybe just use the scrollview from #264 since that handles all the padding? or merge that first but this could result in weird UI in some phones, like maybe the samsung fold when rotated
Part of #99.
Summary
This replaces the old ListState in a way similar to what I did in #325. Introduces
PaginatedScrollView
and aPaginatedCubit
abstract class to handle most logic for paginated lists/grids.How to test
Steps to test the changes you made:
SafeArea
.