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

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)即可获取!**

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值