要了解他就从定义下手
不然你根本不知道它可以干嘛@@
const Scaffold({ super.key, this.appBar, this.body, this.floatingActionButton, this.floatingActionButtonLocation, this.floatingActionButtonAnimator, this.persistentFooterButtons, this.persistentFooterAlignment = AlignmentDirectional.centerEnd, this.drawer, this.onDrawerChanged, this.endDrawer, this.onEndDrawerChanged, this.bottomNavigationBar, this.bottomSheet, this.backgroundColor, this.resizeToAvoidBottomInset, this.primary = true, this.drawerDragStartBehavior = DragStartBehavior.start, this.extendBody = false, this.extendBodyBehindAppBar = false, this.drawerScrimColor, this.drawerEdgeDragWidth, this.drawerEnableOpenDragGesture = true, this.endDrawerEnableOpenDragGesture = true, this.restorationId, });
super.key: 父类Widget的key,通常用于Widget的唯一识别。appBar: 显示在Scaffold顶部的AppBar Widget。body: 显示在Scaffold中央的Widget。floatingActionButton: 显示在Scaffold底部右侧的悬浮按钮。floatingActionButtonLocation: 悬浮按钮的位置。floatingActionButtonAnimator: 悬浮按钮动画。persistentFooterButtons: 显示在Scaffold底部的持久性按钮。persistentFooterAlignment: 持久性按钮对齐方式,默认为AlignmentDirectional.centerEnd。drawer: 显示在Scaffold左侧的Drawer Widget(导览列表)。onDrawerChanged: Drawer状态变化时的回调函数。endDrawer: 显示在Scaffold右侧的Drawer Widget。onEndDrawerChanged: EndDrawer状态变化时的回调函数。drawerDragStartBehavior: 拖动Drawer时的开始行为。drawerScrimColor: Drawer打开时背景的颜色。drawerEdgeDragWidth: 可以使用拖动手势启动Drawer的边缘宽度。drawerEnableOpenDragGesture: 是否启用Drawer的拖动手势,默认为true。endDrawerEnableOpenDragGesture: 是否启用EndDrawer的拖动手势,默认为true。bottomNavigationBar: 显示在Scaffold底部的NavigationBar Widget。bottomSheet: 显示在Scaffold底部的Sheet Widget。backgroundColor: Scaffold的背景颜色。resizeToAvoidBottomInset: 当有软键盘出现时,是否调整Scaffold的大小以避免被软键盘覆盖。primary: 标记Scaffold是否为整个应用程序的主要Scaffold,默认为true。extendBody: 是否将Scaffold的body Widget扩展到NavigationBar后面,默认为false。extendBodyBehindAppBar: 是否将Scaffold的body Widget扩展到AppBar后面,默认为false。restorationId: Scaffold的恢复ID,用于恢复Scaffold的状态。