-
Notifications
You must be signed in to change notification settings - Fork 100
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
Add scroll position saving #2019
Add scroll position saving #2019
Conversation
@@ -16,6 +17,8 @@ import 'package:pointycastle/asymmetric/api.dart'; | |||
import 'package:pointycastle/asymmetric/oaep.dart'; | |||
import 'package:pointycastle/pointycastle.dart' as pc; | |||
|
|||
import '../../ui/home/home.dart'; |
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.
TODO (later): Refactor scroll controller reset methods to campus mobile core
lib/core/providers/cards.dart
Outdated
@@ -335,6 +336,10 @@ class CardsDataProvider extends ChangeNotifier { | |||
} | |||
|
|||
void toggleCard(String card) { | |||
debugPrint("THIS IS THE CURRENT CARD BEING TOGGLED: " + card); | |||
if ((card == "student_health_wellbeing" || card == "student_info" || card == "campus_info") && _cardStates![card]!) { |
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.
Explore dynamically applying resetCardHeight
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.
Explore dynamically applying resetCardHeight in cards provider
3b919bb
to
8c63350
Compare
…reload properly if they freeze)
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.
Looks good, fully tested
Summary
-- Reimplementation of previous PR that was wrongly repealed: "Add scroll position saving #1935" --
-- Additionally includes some code changes and improvements to the original scroll position saving code --
Adds scroll position saving to the Home and Notifications app screens, fixes resizing error with home screen web cards (needed for scroll position saving), and adds loading screens to home screen web cards (prevents content flickering + looks much nice with scroll position saving).
Changelog
[General] [Add] - Adds scroll position saving to home and notifications pages (also includes code from Gradle update PR: "Update Gradle Version and Settings #2017")
Test Plan
Test the home page and notifications page for any bugs and to see if their scroll position is maintained when switching between screens using the bottom nav bar after messing around on either screen (e.g., hiding or unhiding cards on the home screen from either the home screen itself or the profile screen, toggling "I'm going" on certain free food events, etc).
Also test logging in and out of student, guest and employee accounts to make sure the scroll position on both the home and notifications pages are reset when logging in/out of an account.
If this PR is successful, the scroll position should be seamlessly saved on the notifications and home screens without any jumpy behavior when reloading these screens. Additionally, web cards (e.g., "Campus Information" and "Health & Well-being" cards) should now display a loading screen while their contents are loading in. No other behavior of the app should be affected.