123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- import 'package:flutter/cupertino.dart';
- import 'package:flutter/material.dart';
- import 'package:flutterappfuyou/code/YSUserInfo.dart';
- import 'package:flutterappfuyou/code/base/YSBase.dart';
- import 'package:flutterappfuyou/code/base/YSTools.dart';
- import 'package:flutterappfuyou/code/version2/YSMineLiveAdd.dart';
- import 'package:flutterappfuyou/code/version2/view/YSMineLiveDataView.dart';
- class YSMineLive extends StatefulWidget {
- const YSMineLive({Key key}) : super(key: key);
- @override
- _YSMineLiveState createState() => _YSMineLiveState();
- }
- class _YSMineLiveState extends State<YSMineLive> with SingleTickerProviderStateMixin{
- List _titleArray = [
- {'title':'全部'},
- {'title':'预告'},
- {'title':'直播中'},
- {'title':'已结束'}
- ];
- TabController _tabController;
- @override
- void initState() {
- _tabController = TabController(
- vsync: this,
- length: _titleArray.length
- );
- super.initState();
- }
- @override
- Widget build(BuildContext context) {
- return YSBase(
- ystitle: '直播',
- yschild: Container(
- padding: EdgeInsets.only(top: 20),
- child: DefaultTabController(
- length: _titleArray.length,
- child: Column(
- children: [
- Container(
- height: 80,
- decoration: BoxDecoration(
- border: Border(bottom: BorderSide(color: Color(0xFFE26085),width: 0.1))
- ),
- padding: EdgeInsets.only(left: 20,right: 20),
- child: Row(
- children: [
- Container(
- height: 50,
- width: 50,
- decoration: BoxDecoration(
- image: DecorationImage(image: NetworkImage(User().avatar),fit: BoxFit.cover),
- color: Color(0xFFE26085),
- borderRadius: BorderRadius.all(Radius.circular(50))
- ),
- ),
- Container(
- height: 80,
- width: ysWidth(context)-170,
- padding: EdgeInsets.only(left: 10,right: 10),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- mainAxisAlignment: MainAxisAlignment.center,
- mainAxisSize: MainAxisSize.min,
- children: [
- Text(User().name,style: TextStyle(fontSize: 16,color: Color(0xFF222222),fontWeight: FontWeight.normal),),
- Container(
- padding: EdgeInsets.only(top: 3),
- child: Text('主讲老师',style: TextStyle(fontSize: 12,color: Color(0xFFB4B4B4)),),
- )
- ],
- ),
- ),
- GestureDetector(
- onTap: (){
- Navigator.of(context).push(
- CupertinoPageRoute(builder: (context){
- return YSMineLiveAdd();
- })
- ).then((value) {
- liveDataKey.currentState.refresh();
- });
- },
- child: Container(
- width: 80,
- height: 30,
- decoration: BoxDecoration(
- color: Color(0xFFE26085),
- borderRadius: BorderRadius.all(Radius.circular(2))
- ),
- alignment: Alignment.center,
- child: Text('我要直播',style: TextStyle(fontSize: 12,color: Colors.white),),
- ),
- )
- ],
- ),
- ),
- Container(
- height: ysHeight(context)-ysTOP(context)-150,
- width: ysWidth(context),
- color: Color(0xFFF0F0F1),
- child: YSMineLiveDataView(f: {'title':'全部'},key: liveDataKey,),
- )
- // Container(
- // width: ysWidth(context),
- // height: 50,
- // child: TabBar(
- // controller: _tabController,
- // isScrollable: true,
- // indicatorColor: Color(0xFFFA4444),
- // labelColor: Color(0xFFFA4444),
- // indicatorWeight: 2,
- // indicatorSize: TabBarIndicatorSize.label,
- // labelStyle: TextStyle(fontSize: 15),
- // unselectedLabelColor: Color(0xFF5D6978),
- // tabs: _titleArray.map((f) {
- // return Tab(text: '${f['title']}');
- // }).toList(),
- // )
- // ,
- // ),
- // Container(
- // height: ysHeight(context)-ysTOP(context)-200,
- // width: ysWidth(context),
- // color: Color(0xFFF0F0F1),
- // child: TabBarView(
- // controller: _tabController,
- // children: _titleArray.map((f) {
- // return YSMineLiveDataView(f: f,);
- // }).toList(),
- // ),
- // )
- ],
- ),
- ),
- ),
- );
- }
- }
|