【Flutter】笔记3-Scaffold(手脚架or骨架)

要了解他就从定义下手
不然你根本不知道它可以干嘛@@

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的状态。

关于作者: 网站小编

码农网专注IT技术教程资源分享平台,学习资源下载网站,58码农网包含计算机技术、网站程序源码下载、编程技术论坛、互联网资源下载等产品服务,提供原创、优质、完整内容的专业码农交流分享平台。

热门文章