【发布时间】:2021-01-06 17:57:50
【问题描述】:
我用tabBar,
我想在选择选项卡时更改 appBar 标题,但出现错误。
我得到错误的代码。
Scaffold(
appBar: AppBar(
leading: IconButton(
icon: Icon(Icons.clear, color: Colors.black),
onPressed: () {
Navigator.pop(context);
},
),
title: TabBarView(
children: [Text("Album"), Text("사진"), Text("동영상")],
),
backgroundColor: Colors.white,
),
bottomNavigationBar: TabBar(
tabs: [
Tab(text: "앨범"),
Tab(text: "사진"),
Tab(text: "동영상"),
],
labelColor: Colors.black,
indicatorColor: Colors.black,
unselectedLabelColor: Colors.black26,
),
),
如果我去掉 appBar title,我就不会出错。
如何解决这个问题?
【问题讨论】:
标签: flutter