question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Displaying back button in the scaffold

See original GitHub issue

This is more of a feature request and less of a bug/issue.

Problem How to know that the current screen is a top screen and there is no need to show back button. The counter-part of this issue is also true, which would be how to know the current screen has a predecessor or not.

Requested feature There should be a way to know when to show the back button in the scaffold, this way we can show the back button based on the graph dynamically instead of hard-coding it in the scaffold.

Suggestion Add a method in Navigator to check if the current screen has a predecessor or not, if it has then it can return true, else false.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
5AbhishekSaxenacommented, Jan 25, 2022

Hi @raamcosta

No, I haven’t tried it with Jetpack Compose Navigation, but I have done it with the Jetpack Navigation library, maybe that’ll give you some insights.

Please refer to these links

The Navigation component includes a NavigationUI class. This class contains static methods that manage navigation with the top app bar, the navigation drawer, and the bottom navigation.

With the help of NavigationUI API, we can manage the content of the UI components w.r.t navigation from a central location like MainActivity.

0reactions
raamcostacommented, Apr 7, 2022

Let me know if this is helpful at all. I am eager to help you guys further if there is any other related point. Peace! ✌️

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flutter Scaffold Appbar not showing the back button
For the app bar to show a back button there has to be somewhere to go back to ie. there has to be...
Read more >
BackButton class - material library - Flutter - Dart API docs
A BackButton is an IconButton with a "back" icon appropriate for the current TargetPlatform. When pressed, the back button calls Navigator.maybePop to return...
Read more >
How to Change Back Button Icon in Flutter
In this example, we are going to show you how to change the back button which appears on AppBar while you navigate to...
Read more >
Flutter! Handle back button in a flutter Application - Medium
We want to show a pop-up before the close app or close some connection that app using. That can be used to confirm...
Read more >
Flutter Scaffold Appbar not showing the back button-Flutter
In order for the back key to come, the part that goes to that page is "Navigator.pushNamed (context, '/ brand new');" For example,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found