Skip to content
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

fix: #2009 - product page will always pull down - and refresh #2618

Merged
merged 1 commit into from
Jul 18, 2022

Conversation

monsieurtanuki
Copy link
Contributor

For the record, tested on 3489940014075 on server world.openbeautyfacts.org.

I've also written the explanation behind the trick - perhaps that would make sense to create a wiki about nice tricks:

// /!\ Smart Dart
// `physics: const AlwaysScrollableScrollPhysics()`
// means that we will always scroll, even if it's pointless.
// Why do we need to? For the RefreshIndicator, that wouldn't be
// triggered on a ListView smaller than the screen
// (as there will be no scroll).

Impacted file:

  • new_product_page.dart: forced the page content to scroll even when not necessary

What

  • Now the product page will always pull down, and therefore refresh the data.

Fixes bug(s)

…fresh

For the record, tested on `3489940014075` on server `world.openbeautyfacts.org`.

I've also written the explanation behind the trick - perhaps that would make sense to create a wiki about nice tricks:
```dart
// /!\ Smart Dart
// `physics: const AlwaysScrollableScrollPhysics()`
// means that we will always scroll, even if it's pointless.
// Why do we need to? For the RefreshIndicator, that wouldn't be
// triggered on a ListView smaller than the screen
// (as there will be no scroll).
```

Impacted file:
 `new_product_page.dart`: forced the page content to scroll even when not necessary
Copy link
Member

@M123-dev M123-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great solution and even better comment, thanks @monsieurtanuki

@teolemon teolemon merged commit ca960ed into openfoodfacts:develop Jul 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Impossible to pull down to refresh if the content is not larger than the screen
3 participants