Skip to content

Drawer Hack #113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ahmedkassem opened this issue Jul 1, 2018 · 5 comments
Open

Drawer Hack #113

ahmedkassem opened this issue Jul 1, 2018 · 5 comments

Comments

@ahmedkassem
Copy link

ahmedkassem commented Jul 1, 2018

can we assign the hidden attribute to the state and create a function to toggle between hidden = true and hidden = false , to hide the webview rect when the drawer is opened
and we use the leading in Appbar to control that

State and function to toggle visibility
bool _visibility = false; _handleDrawer(){ _scaffoldKey.currentState.openDrawer(); setState(() { _visibility = true; }); }

appBar: new AppBar( centerTitle: true, leading: new IconButton(icon: new Icon( Icons.menu ),onPressed:_handleDrawer,), title: new Text('Plugin example app'), ),
so when the drawer is opened the state of the webview hidden is true , and when drawer is closed hidden is false

I am a beginner and i cant make the toggle function to work

@zoechi
Copy link

zoechi commented Jul 2, 2018

Isn't this what #86 added? (didn't have a closer look myself)

@ghost
Copy link

ghost commented Jul 2, 2018

Yeah #86 looks like it allows toggling the webview being hidden OR displayed.

But it's going to be clunky because the transition will look weird. You hide the webview and the screen goes white and the drawer starts to slide across from left to right.
What is needed maybe is the ability to fade the webview out as the drawer opens. It might be enough to do the trick.
Or you could take a screenshot of the webview and put that on after you hide the webview and then slide the drawer across.
Then when the drawer has fully closed you turn off the screenshot and turn on the webview.

What do you think ?

@ahmedkassem
Copy link
Author

what is the function to show and hide the webview because i tried these and they are not right :
flutterWebviewPlugin.hide();
flutterWebviewPlugin.show();

@lejard-h
Copy link
Collaborator

lejard-h commented Aug 1, 2018

@gedw99 I thought about taking a screenshot but never had the chance to test it and I don't know if it is possible.

@ahmedkassem try to upgrade the package, functions you are trying to use are correct

@ahmedkassem
Copy link
Author

@lejard-h i will give it a try , but can you help with the function when the drawer is open and the user clicks on the screen itself not the drawer (on drawer dismiss i want to fire the flutterWebviewPlugin.hide(); function)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants