Tabs.dart

import 'package:flutter/material.dart';
import 'tabs/Home.dart';
import 'tabs/Category.dart';
import 'tabs/Setting.dart'; class Tabs extends StatefulWidget {
final index;
Tabs({Key key, this.index = }) : super(key: key);
_TabsState createState() => _TabsState(this.index);
} class _TabsState extends State<Tabs> {
int _currentIndex = ;
_TabsState(index) {
this._currentIndex = index;
}
List _pageList = [HomePage(), CategoryPage(), SettingPage()];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Flutter Demo'),
),
bottomNavigationBar: BottomNavigationBar(
currentIndex: this._currentIndex,
onTap: (int index) {
// print(index);
setState(() {
this._currentIndex = index;
});
},
iconSize: 36.0,
type: BottomNavigationBarType.fixed,
fixedColor: Colors.red,
items: [
BottomNavigationBarItem(icon: Icon(Icons.home), title: Text('首页')),
BottomNavigationBarItem(
icon: Icon(Icons.category), title: Text('分类')),
BottomNavigationBarItem(
icon: Icon(Icons.settings), title: Text('设置')),
]),
body: this._pageList[this._currentIndex],
drawer: Drawer(
child: Column(
children: <Widget>[
Row(
children: <Widget>[
// Expanded(
// child: DrawerHeader(
// child: Text('你好Flutter'),
// decoration: BoxDecoration(
// // color: Colors.yellow
// image: DecorationImage(
// image: NetworkImage('https://www.itying.com/images/flutter/2.png'),
// fit:BoxFit.cover
// ),
// ),
// )
// ) Expanded(
child: UserAccountsDrawerHeader(
accountName: Text('老师你好'),
accountEmail: Text('gztt@163.com'),
currentAccountPicture: CircleAvatar(
backgroundImage: NetworkImage(
'https://www.itying.com/images/flutter/3.png'),
),
decoration: BoxDecoration(
// color: Colors.yellow
image: DecorationImage(
image: NetworkImage(
'https://www.itying.com/images/flutter/2.png'),
fit: BoxFit.cover),
),
otherAccountsPictures: <Widget>[
Image.network(
'https://www.itying.com/images/flutter/5.png'),
Image.network(
'https://www.itying.com/images/flutter/4.png')
],
),
)
],
),
ListTile(
leading: CircleAvatar(
child: Icon(Icons.home),
),
title: Text('我的空间')),
Divider(),
ListTile(
leading: CircleAvatar(
child: Icon(Icons.home),
),
title: Text('用户中心'),
onTap: () {
Navigator.of(context).pop();
Navigator.pushNamed(context, '/user');
}
),
Divider(),
ListTile(
leading: CircleAvatar(
child: Icon(Icons.home),
),
title: Text('用户中心'),
)
],
),
),
endDrawer: Drawer(
child: Text('右侧侧边栏'),
),
);
}
}

最新文章

  1. Windows 2008 - 由于管理员设置的策略,该磁盘处于脱机状态
  2. javascript执行环境(执行期上下文)详解
  3. Linux0.11内核--系统调用机制分析
  4. React阶段开发总结
  5. BootStrap安装
  6. unity button
  7. 剑指offer系列54---数组中出现次数超过一半的数
  8. 机器学习 —— log-linear 模型
  9. 130道ASP.NET面试题
  10. Actor模型
  11. 判断两条直线的位置关系 POJ 1269 Intersecting Lines
  12. “海市蜃楼”般的逛街体验——VR全景智慧城市常诚
  13. 计算机网络之IP地址
  14. Struts2技术内幕 读书笔记二 web开发的基本模式
  15. PHP算法学习(4) 随机算法
  16. ELK收集tomcat状态日志
  17. Java面试题全集(上)转载
  18. 解析 ViewTreeObserver 源码(上)
  19. 运行Python出错,提示“丢失api-ms-win-crt-runtime-l1-1-0.dll”
  20. Android R文件介绍

热门文章

  1. 【转】provisional headers are shown 知多少
  2. Eclipse安装zookeeper监控插件
  3. 利用socketserver模块的简单功能来完成一个多线程消息传递
  4. 【原创】SPFA判负环
  5. PL/SQL 使用控制流程
  6. TDOA基站 之 时间同步
  7. Linux监控系统概览
  8. Appium自动化测试教程-自学网-monkeyrunner简介
  9. 【中国剩余定理-入门】-C++
  10. 三十六.MHA集群概述 、 部署MHA集群 测试配置