Skip to content

ImplicitBackButton misbehaves when Dialogs are shown #8

Description

@btrautmann

I'm making use of ImplicitBackButton in perhaps an unexpected way in that in my "flows" (flows are defined as parts of the Widget tree that contain their own ImplicitNavigator that manages 1...N screens), I have a Scaffold whose body consists of a Column that contains a Row which acts an as AppBar (without being an AppBar):

Row(
  children: [
    const ImplicitNavigatorBackButton(),
    Text(
      'Fix details',
      style: Theme.of(context).textTheme.headlineSmall,
    ),
  ],
)

The other item in the Column is an Expanded containing the ImplicitNavigator. This allows me to use the header row across all screens in the flow.

However, I noticed that when showing Dialogs in a flow like this one, ImplicitNavigatorBackButton disappears when the Dialog is shown (see video):

Simulator.Screen.Recording.-.iPhone.14.Pro.Max.-.2023-05-30.at.18.14.10.mp4

I've looked at that code before and I know it does some introspection on the Widget tree, so I suspect the displaying of the dialog is just throwing that introspection logic off.

Directly before the Dialog is shown, the tree looks like this (reminder: FixDetailsFlow uses the structure outlined above):

Screenshot 2023-05-30 at 18 04 59

Once shown, it looks like:

Screenshot 2023-05-30 at 18 05 18

As shown in the video above, the back behavior, even once the button is shown again, takes a few tappy taps to start working again 🙃

Library version:

  implicit_navigator:
    dependency: "direct main"
    description:
      name: implicit_navigator
      sha256: "661e359bd119a6ac1d69f7079096a7b0298b7140b441f256f8fa69cd01a1faad"
      url: "https://pub.dev"
    source: hosted
    version: "1.4.0"

Flutter version:

Flutter 3.10.0-12.0.pre.26 • channel master • https://github.com/flutter/flutter.git
Framework • revision d2646cf87d (6 weeks ago) • 2023-04-21 23:06:17 -0400
Engine • revision b6749106a4
Tools • Dart 3.1.0 (build 3.1.0-30.0.dev) • DevTools 2.23.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions