【发布时间】:2020-02-17 14:18:02
【问题描述】:
【问题讨论】:
-
好像是 TabLayout
标签: ios user-interface flutter mobile dart
【问题讨论】:
标签: ios user-interface flutter mobile dart
您可以简单地使用 TabBar + TabBarView 来实现这一点。
//out of build method
final TabController _controller = TabController(
length: 3
);
//inside build method
Scaffold(
body: TabBarView(
controller: _controller,
children: <Widget>[
Center(
child: Text('page one'),
),
Center(
child: Text('page two'),
),
Center(
child: Text('page three'),
),
],
),
bottomNavigationBar: TabBar(
controller: _controller,
indicator: //change decoration here,
tabs: <Widget>[
Icon(
Icons.dashboard,
),
Icon(
Icons.card_giftcard,
),
Icon(
Icons.headset,
)
],
),
);
【讨论】:
bottomNavigationBar: new Theme(
data: Theme.of(context).copyWith(
// sets the background color of the `BottomNavigationBar`
canvasColor: Colors.green,
// sets the active color of the `BottomNavigationBar` if `Brightness` is light
primaryColor: Colors.red,
textTheme: Theme
.of(context)
.textTheme
.copyWith(caption: new TextStyle(color: Colors.yellow))), // sets the inactive color of the `BottomNavigationBar`
child: new BottomNavigationBar(
type: BottomNavigationBarType.fixed,
currentIndex: 0,
items: [
new BottomNavigationBarItem(
icon: new Icon(Icons.add),
title: new Text("Add"),
),
new BottomNavigationBarItem(
icon: new Icon(Icons.delete),
title: new Text("Delete"),
)
],
),
),
【讨论】: