salkuadrat/slide_drawer

Build Context issue

Opened this issue · 1 comments

hi first of all thanks for your amazing job I'm currently using a splash screen as my home: and navigating from there to my homepage and I'm using a custom app bar class so I'm getting null pointer error because my home: is my splash screen I managed to set my home: to my main home page and send the context to app bar class for drawer opening but this means that I have to lose my splashScreen and I cant use this drawer in my other screens as well any suggestion sorry for taking your time thanks

I had the same issue, I resolve this issue using this.

use -> scaffoldKey.currentState.context instead of context
pass globalkey to the custom app bar
SlideDrawer.of(scaffoldKey.currentState!.context)!.toggle();