ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Flutter开发之——Scaffold,移动开发前景

2022-03-02 22:31:12  阅读:219  来源: 互联网

标签:Widget title Color Text Scaffold Colors 开发 抽屉 Flutter


super(key: key);

2.2 属性解释

| 属性名 | 说明 | 取值 |

| :-: | :-: | :-: |

| appBar | 导航栏 | AppBar对象 |

| backgroundColor | 背景颜色 | Color对象 |

| body | 内容 | Widget |

| bottomNavigationBar | 底部导航栏 | Widget |

| bottomSheet | 持久化显示的底部抽屉 | Widget |

| drawer | 左侧抽屉 | Widget |

| endDrawer | 右侧抽屉 | Widget |

| floatingActionButton | 悬浮按钮 | Widget |

| persistentFooterButtons | 底部按钮组件 | List |

| primary | appBar是否从屏幕顶部布局 | bool对象 |

2.3 Scaffold中组件

2.3.1 AppBar

| 属性名 | 说明 | 取值 |

| :-: | :-: | :-: |

| actions | 按钮列表 | List |

| backgroundColor | 背景颜色 | Color |

| centerTitle | 是否居中 | bool |

| leading | 标题左侧组件 | Widget |

| title | 标题 | Widget |

2.3.2 BottomNavigationBar

| 属性名 | 说明 | 取值 |

| :-: | :-: | :-: |

| items | 标签组(多个值) | List |

| onTap | 点击标签的回调 | Func |

| BottomNavigationBarType | 设置类型 | fixed-自适应宽度

shifting-位置和尺寸都有单击动画 |

| fixedColor | 选中颜色 | Color |

| backgroundColor | 背景颜色 | Color |

| inconSize | 图标尺寸,默认24 | 数值 |

| selectedItemColor | 选中标签颜色 | Color |

| unselectedItemColor | 未选中标签颜色 | Color |

| selectedIconTheme | 选中风格 | |

| unselectedIconTheme | 未选中风格 | |

三 示例


3.1 代码

Scaffold(

appBar: AppBar(title: Text(widget.title),

backgroundColor:Colors.orange ,

centerTitle: true,

//leading: Text(“左侧组件”),

),

bottomNavigationBar: BottomNavigationBar(items: [

BottomNavigationBarItem(icon: Icon(Icons.print),title: Text(“打印”)),

BottomNavigationBarItem(icon: Icon(Icons.stop),title: Text(“停止”)),

],

type: BottomNavigationBarType.fixed,

backgroundColor: Colors.blue,

iconSize: 34,

selectedItemColor: Colors.red,

unselectedItemColor: Colors.cyan,

),

//bottomSheet: Text(“持久化显示底部抽屉”),

resizeToAvoidBottomPadding: true,

resizeToAvoidBottomInset: true,

drawer: Drawer(

child: Center(

child: Container(

color: Colors.orange,

child: Text(‘左侧边栏’,style: TextStyle(color: Colors.white,fontSize: 24.0),),

),

)

),

onDrawerChanged: _drawLeftChange ,

onEndDrawerChanged: _drawEndChange,

endDrawer: Drawer(

child: Column(

mainAxisAlignment: MainAxisAlignment.center,

children: [

Text(“右侧抽屉”),

Text(“右侧抽屉”),

Text(“右侧抽屉”),

],

)

),

最后

**要想成为高级安卓工程师,必须掌握许多基础的知识。**在工作中,这些原理可以极大的帮助我们理解技术,在面试中,更是可以帮助我们应对大厂面试官的刁难。


【Android核心高级技术PDF文档,BAT大厂面试真题解析】点击:Android架构视频+BAT面试专题PDF+学习笔记即可获取!

/github.com/a120464/Android-P7/blob/master/Android%E5%BC%80%E5%8F%91%E4%B8%8D%E4%BC%9A%E8%BF%99%E4%BA%9B%EF%BC%9F%E5%A6%82%E4%BD%95%E9%9D%A2%E8%AF%95%E6%8B%BF%E9%AB%98%E8%96%AA%EF%BC%81.md)即可获取!**

标签:Widget,title,Color,Text,Scaffold,Colors,开发,抽屉,Flutter
来源: https://blog.csdn.net/m0_66684915/article/details/123242129

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有