Skip to content
代码片段 群组 项目
提交 6f996c84 编辑于 作者: ling zhang's avatar ling zhang
浏览文件

feat: #129 Center app bar title

上级 13ddbd67
No related branches found
No related tags found
无相关合并请求
......@@ -47,24 +47,26 @@ class MyHomePage extends StatefulWidget {
class _MyHomePageState extends State<MyHomePage> {
int _currentIndex = 0;
final List<Widget> _pages = const [Backlog(), TocTree(), Trends()];
final _appBarTitles = ['待办', '目录树', '动态'];
final _appBarTitles = const ['待办', '目录树', '动态'];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(_appBarTitles[_currentIndex]),
centerTitle: true,
titleTextStyle: const TextStyle(color: Colors.black),
backgroundColor: Colors.white,
),
body: _pages[_currentIndex],
bottomNavigationBar: BottomNavigationBar(
items: const [
items: [
BottomNavigationBarItem(
icon: Icon(CustomIcons.toDoList), label: "待办"),
icon: const Icon(CustomIcons.toDoList), label: _appBarTitles[0]),
BottomNavigationBarItem(
icon: Icon(CustomIcons.catalog), label: "目录树"),
BottomNavigationBarItem(icon: Icon(CustomIcons.trends), label: "动态")
icon: const Icon(CustomIcons.catalog), label: _appBarTitles[1]),
BottomNavigationBarItem(
icon: const Icon(CustomIcons.trends), label: _appBarTitles[2])
],
type: BottomNavigationBarType.fixed,
fixedColor: const Color(0xFFFC6D26),
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册