MarcinusX / drawer_challenge

203 stars 73 forks source link

Another implementation used in an app #5

Open ilyen85 opened 4 years ago

ilyen85 commented 4 years ago

Hey!

First of all, thank you for the examples they are really neat, nice job!

But I have a question... How would you use this as an animation between pages?

I have a hard time to implement this, because whenever I change the page, I get an error:

════════ Exception caught by gesture ══════════════
The method ‘open’ was called on null.
Receiver: null
Tried calling: open()

pointing to this line: CustomDrawer.of(context).open()

So..., how would you use the animation in between page changes?

Yassineelkasmy commented 3 years ago

I was having the same issue and i figured out that you have to wrap the widget that call open() method with a builder exactly like he did. Wrong : IconButton( icon: Icon(Icons.menu), onPressed: () { CustomDrawer.of(context).open(); }, Correct: Builder( builder: (context) { return IconButton( icon: Icon(Icons.menu), onPressed: () => CustomDrawer.of(context).open(), ); }, ),

premy commented 3 years ago

@Yassineelkasmy could you pls show an example of how you implemented navigation?

premy commented 3 years ago

@ilyen85 hi mate, were you able to implement the transition? If so, would you care to share an example? Thanks!