Scaffold(脚手架):是Flutter开发中很常用到的组件。
官方的描述:Creates a visual scaffold for material design widgets.
为Material Design Widgets创建可视化的脚手架。
const Scaffold({
Key key,//Controls how one widget replaces another widget in the tree.//不懂,有空研究下。
this.appBar,//一般传入AppBar类。例:AppBar();this.body,//主体内容<Widget>
this.floatingActionButton,//一个浮动在body上的按钮。默认悬浮在右下角
this.floatingActionButtonLocation,//控制浮动按钮的位置。例如FloatingActionButtonLocation.centerDocked,浮动按钮在下方中间
this.floatingActionButtonAnimator,//浮动按钮改变位置时的动画。默认为FloatingActionButtonAnimator.scaling
this.persistentFooterButtons,//多状态按钮。(在底部创建一组按钮,不随body滚动。)
this.drawer,// 左侧的抽屉菜单<Widget>,点击之后从左侧滑出。
this.endDrawer,//右侧的抽屉菜单<Widget>,
this.bottomNavigationBar,//底部导航栏
this.bottomSheet,//底部工具栏
this.backgroundColor,//背景颜色
this.resizeToAvoidBottomPadding,//**官方建议不要使用此属性**,请改用resizeToAvoidBottomInset
this.resizeToAvoidBottomInset,//如果为true,则body和脚手架的浮动小部件应自行调整大小,以避免屏幕键盘的高度由 MediaQuery的MediaQueryData.viewInsets bottom属性定义。
this.primary = true,//会不会影响到应用栏
this.drawerDragStartBehavior = DragStartBehavior.start,
this.extendBody = false,//如果为true,并且指定了bottomNavigationBar或persistentFooterButtons,则将body扩展到脚手架的底部,而不是仅扩展到bottomNavigationBar或persistentFooterButtons的顶部。
this.extendBodyBehindAppBar = false,//如果为true,并且指定了appBar,则body的高度将扩展为包括应用栏的高度,并且body的顶部与应用栏的顶部对齐
this.drawerScrimColor,//设置在打开Drawer时蒙层的颜色。默认是灰蒙蒙的。
this.drawerEdgeDragWidth,//Drawer的宽度。
}) : assert(primary != null),
assert(extendBody != null),
assert(extendBodyBehindAppBar != null),
assert(drawerDragStartBehavior != null),
super(key: key);
明晚有空继续编辑。学习一下怎么使用简书的编辑器。