JagandeepBrar / lunasea

Self-hosted software controller built using Flutter
https://www.lunasea.app
GNU General Public License v3.0
1.28k stars 63 forks source link

[Bug] Back button always exits the app #211

Closed JonnyHaystack closed 4 years ago

JonnyHaystack commented 4 years ago

Describe the Bug The back button seems to exit the app in a lot of situations where it should instead go back to the previous screen.

To Reproduce

  1. Open the app
  2. Tap on Sonarr, Radarr, Lidarr or similar
  3. Press the back button and observe that the app closes

Expected Behaviour The back button should return you to the previous screen, unless you are on the home screen in which case it should exit the app.

Screenshots

Versions 2.2.0

Additional context This is on Android. I don't know about iOS.

JagandeepBrar commented 4 years ago

This is by design because of the way that routes are handled, if I push ontop of the stack a back arrow is shown instead of the drawer, so each time you change services I need to pop all current routes and push the new route.

I will investigate a way around this, maybe the back button can open the drawer instead of closing the application.

This is likely the class I need to implement, so I am leaving a link for personal reference: https://api.flutter.dev/flutter/widgets/WillPopScope-class.html

JagandeepBrar commented 4 years ago

This has now been implemented internally and will be live in the next beta update going live this week!

https://github.com/LunaSeaApp/LunaSea/commit/329768964e641d7bafc419f3d089749439685dea

Now instead of closing the application, tapping the back button on a primary/apex route will open/close the drawer instead of closing LunaSea. LunaSea will only be closed now when you hit the home or multitasking button.