Flutter scaffold drawer is implemented with primary material design visual layout structure. Scaffold class is important as it provides APIs for showing drawer, snack bar, and bottom sheets. For generating a multipurpose mobile application, we use a scaffold. In addition, we can say that scaffold contains mostly all the elements that a flutter application uses. We will have a look at the scaffold drawer constructor and its properties.
const Scaffold({
Key key,
this.appBar,
this.body,
this.floatingActionButton,
this.floatingActionButtonLocation,
this.persistentFooterButtons,
this.drawer,
this.endDrawer,
this.bottomNavigationBar,
this.bottomSheet,
this.floatingActionButtonAnimator,
this.backgroundColor,
this.resizeToAvoidBottomPadding = true,
this.primary = true,
})
Here scaffold widget explained using basic drawer example:
- appBar — It is an important part of the scaffold. appBar is the top horizontal bar on the application. Without appBar property, the scaffold widget is much more likely incomplete.
- body — The body appears below the appBar section. It is behind the drawer as well as floatingActionButton. If resizeToAvoidBottomInset property is set to false, then the body doesn’t resize when the on-screen keyboard appears on the screen. This widget appears at the top left of the screen by default. And in between the top appBar and the bottom part of the screen.