Is there a way to add a curve to a flutter scaffold drawer? For example Curves.ElasticOut.
I thought about extending the Drawer or DrawerControllerState class to create a custom version that allows a curve input however there doesn't seem to be an obvious way to do this.
There is a useful plugin that gives curve functionality using its own sidemenu class but I would like to do this using the scaffold drawer as it doesn't seem like it should be a difficult extension (alternative plugin https://github.com/GabrieleCicconetti/uts_sidemenu/blob/master/lib/uts_sidemenu.dart)
I have researched existing SO questions and cannot find one duplicating this topic however this is my first time question on Stack Overflow so apologies if I have made any errors here.
I have tried more about what you wanna do, but of course i couldn't do it. But i have create custom drawer with something different animation. here you can give your
duration,curve. So is it more complex and beautiful drawer than you wanna create. Here is source code and expains:First we need to create two Stateful widget,
CustomDrawerandHomeScreem: After creating this widgets, we need to createWrapperwidget which one will controle our screen changes.Wrapperwidget:And then we have to create our
CustomDrawerwidget:CustomDrawerwidget:Alright time to create
HomeScreenwidget which one will manage animations. so everthing we have to do is here. Here we need to Create a Stateful wideget and returnAnimatedContainer. as you can see:And now we gonna make methods and some calculatings for manage our screen. First create this variables on down to
_HomeScreenState:Then we need two method,
openDrawerandcloseDrawer.openDrawer:closeDrawer:And time to fill our
AnimatedContainerfor do changes:AnimatedContainerafter filling:And now we need appBar to use our methods, so for
openDrawerandcloseDrawer:If you was complete this steps then you can use and enjoy! just give
Wrapperin to your main.dart > MaterialApp's home.HomeScreen:When you complete everthing you'll get result like this:
