Flutter常见UI组件使用

// listView中的View可以不一样 可以直接往里面放入多个不同的View

Scaffold

Scaffold 翻译过来就是脚手架的意思,就是一个基础界面,打包了一个界面需要的的常见元素,比如标题栏,FloatButton 抽屉菜单,底部工具栏等
const Scaffold({
Key key,
this.appBar, // 标题栏
this.body, // 用于显示当前界面主要内容的Widget
this.floatingActionButton, // 一个悬浮在body上的按钮,默认显示在右下角
this.floatingActionButtonLocation, // 用于设置floatingActionButton显示的位置
this.floatingActionButtonAnimator, // floatingActionButton移动到一个新的位置时的动画
this.persistentFooterButtons, // 多状态按钮
this.drawer, // 左侧的抽屉菜单
this.endDrawer, // 右’侧的抽屉菜单
this.bottomNavigationBar,// 底部导航栏。
this.bottomSheet, // 显示在底部的工具栏
this.backgroundColor,// 内容的背景颜色
this.resizeToAvoidBottomPadding = true, // 控制界面内容 body 是否重新布局来避免底部被覆盖,比如当键盘显示的时候,重新布局避免被键盘盖住内容。
this.primary = true,// Scaffold是否显示在页面的顶部
})

Scaffold可以嵌套,并不是只能放在整个页面才行。

UI组件

需要的组件可以从这里看

https://github.com/Solido/awesome-flutter

Toast

https://github.com/ponnamkarthik/FlutterToast
OKToast

你可能感兴趣的:(Flutter,ui,flutter,android)