go-flutter-desktop / go-flutter

Flutter on Windows, MacOS and Linux - based on Flutter Embedding, Go and GLFW.
https://hover.build/
BSD 3-Clause "New" or "Revised" License
5.85k stars 283 forks source link

A `back` key(button) to return to previous page when current page broken. #640

Closed zw963 closed 2 years ago

zw963 commented 2 years ago

Is your feature request related to a problem?

There exist case swhich one page broken because some reason, at this case, there is no a back button(as android emulator) which can let me back to previous page (as the back button in the browser)

Describe the feature you'd like

I don't know, if we have a back keybinding (as r/R), which can back to previous page?

for now, i have to pressing R to restart the app entirely to back to the app first page, that enough because go-flutter is very quickly.

but, i am curious if we have exists solution for this?

pchampio commented 2 years ago

Pressing the escape button should call to https://api.flutter.dev/flutter/widgets/PopNavigatorRouterDelegateMixin/popRoute.html https://github.com/go-flutter-desktop/go-flutter/blob/6c65ecd9e1d4dbb41f70cd9c8b947001156a1d56/text-input.go#L162-L168 having the same effect as the back button on an android.