jonataslaw / getx

Open screens/snackbars/dialogs/bottomSheets without context, manage states and inject dependencies easily with Get.
MIT License
10.23k stars 1.61k forks source link

Hero - Router #1745

Open nagringapp opened 3 years ago

nagringapp commented 3 years ago

Describe the bug Trying to use Hero when navigating to a detailed page

**Reproduction code Parentn Widget:

return Hero(
      tag: 'post',
      child: Container(
        height: 200,
        decoration: BoxDecoration(
          image: DecorationImage(
            fit: BoxFit.fitWidth,
            image: NetworkImage(post.picture!),
          ),
        )
      )
    );

Subpage:

return Hero(
      tag: 'post',
      child: Container(
        height: 200,
        decoration: BoxDecoration(
          image: DecorationImage(
            fit: BoxFit.fitWidth,
            image: NetworkImage(this.post!.picture!),
          ),
        )
      )
    );

Expected behavior Hero should work out of the box.

Flutter Version: Enter the version of the Flutter you are using

Getx Version: Enter the version of the Getx you are using

environment: sdk: ">=2.12.0 <3.0.0"

dependencies: flutter: sdk: flutter

The following adds the Cupertino Icons font to your application.

Use with the CupertinoIcons class for iOS style icons.

cupertino_icons: ^1.0.2 get: ^4.3.4

jonataslaw commented 3 years ago

Please, insert a reproduce code

iresharma commented 2 years ago

hey, I think what @nagringapp was trying to say is the if we use Get.offNamed('/wf') or any kind of routing using Gets, it ruins the hero animation.

ibrahimcaj commented 1 year ago

Any fix for this?

fabianogadenz commented 4 months ago

Getx breaks the rescue behavior from the InheritedWidget context where Hero works. I solved it by migrating all my routes to Flutter default Navigator.