jesusrp98 / spacex-go

Simple yet powerful, open-source SpaceX launch tracker.
https://play.google.com/store/apps/details?id=com.chechu.cherry
GNU General Public License v3.0
880 stars 252 forks source link

Latest tab crash on refresh and scroll down without internet #39

Closed mneira10 closed 5 years ago

mneira10 commented 5 years ago

Environment

App version:

2.3.1

Android version:

Android 9 - API 28

Device information:

Xiaomi Mi 8 Lite

Description

Current behaviour: When there is no data (or the user turns off wifi and mobile data), refreshes the latest tab and scrolls down, the app displays a red screen with a range error.

Related to #10

Expected behaviour:

The app should not display errors if there is no data and the latest page is refreshed.

Steps to reproduce

  1. Start app
  2. Navigate to latest
  3. Turn off all data - wifi and mobile data
  4. Reload page
  5. Scroll down

Video

Bug

jesusrp98 commented 5 years ago

Planning to add connection awareness, for both loading & reloading methods in the near future. What you've implemented in the pull request is a pretty good start.

Like the image quality settings, this will be implemented in the v2.5 update. You can continue tinkering with this feature in #38 if you want to :)

Thank you very much!

jesusrp98 commented 5 years ago

Connection awareness

jesusrp98 commented 5 years ago

Changes made to control network status are now pulled to the dev branch.

This function inside the QueryModel is the one responsible for checking internet connection.

  // Checks internet connection & sets [_status] variable
  Future<bool> connectionFailure() async {
    _status =
        await Connectivity().checkConnectivity() == ConnectivityResult.none
            ? Status.error
            : Status.loading;
    return !isLoading;
  }

Once again, thanks for taking the time to help in the development of this app :)