|
@@ -1,4 +1,5 @@
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
+import 'package:flutter_redux/flutter_redux.dart';
|
|
|
import '../widgets/HomeDrawer.dart';
|
|
import '../widgets/HomeDrawer.dart';
|
|
|
import './Setting.dart';
|
|
import './Setting.dart';
|
|
|
import './CreateRoom.dart';
|
|
import './CreateRoom.dart';
|
|
@@ -11,6 +12,9 @@ import '../styles/totast.dart';
|
|
|
import '../net/HttpManager.dart';
|
|
import '../net/HttpManager.dart';
|
|
|
import '../net/Result.dart';
|
|
import '../net/Result.dart';
|
|
|
import 'TipList.dart';
|
|
import 'TipList.dart';
|
|
|
|
|
+import '../plugins/ScreenStramPlugin.dart';
|
|
|
|
|
+import '../model/UserInfo.dart';
|
|
|
|
|
+import '../redux/AppState.dart';
|
|
|
|
|
|
|
|
class HomePage extends StatefulWidget {
|
|
class HomePage extends StatefulWidget {
|
|
|
@override
|
|
@override
|
|
@@ -54,18 +58,17 @@ class _HomePageState extends State<HomePage> {
|
|
|
width: double.infinity,
|
|
width: double.infinity,
|
|
|
height: double.infinity,
|
|
height: double.infinity,
|
|
|
decoration: BoxDecoration(
|
|
decoration: BoxDecoration(
|
|
|
- gradient: LinearGradient(colors: [
|
|
|
|
|
- Color.fromARGB(255, 177, 59, 56),
|
|
|
|
|
- Color.fromARGB(255, 147, 64, 61)
|
|
|
|
|
- ], begin: Alignment.topCenter, end: Alignment.bottomCenter)),
|
|
|
|
|
|
|
+ gradient: LinearGradient(
|
|
|
|
|
+ colors: [Color.fromARGB(255, 177, 59, 56), Color.fromARGB(255, 147, 64, 61)], begin: Alignment.topCenter, end: Alignment.bottomCenter)),
|
|
|
child: SafeArea(
|
|
child: SafeArea(
|
|
|
- child: centerWidget(),
|
|
|
|
|
|
|
+ child: centerWidget(context),
|
|
|
),
|
|
),
|
|
|
),
|
|
),
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- Widget centerWidget() {
|
|
|
|
|
|
|
+ Widget centerWidget(BuildContext context) {
|
|
|
|
|
+ UserInfo userInfo = StoreProvider.of<AppState>(context).state.userInfo;
|
|
|
return Column(
|
|
return Column(
|
|
|
children: <Widget>[
|
|
children: <Widget>[
|
|
|
Expanded(
|
|
Expanded(
|
|
@@ -98,15 +101,12 @@ class _HomePageState extends State<HomePage> {
|
|
|
Image.asset("images/home_icon_yuan.png"),
|
|
Image.asset("images/home_icon_yuan.png"),
|
|
|
Center(
|
|
Center(
|
|
|
child: Row(
|
|
child: Row(
|
|
|
- mainAxisAlignment:
|
|
|
|
|
- MainAxisAlignment.center,
|
|
|
|
|
- crossAxisAlignment:
|
|
|
|
|
- CrossAxisAlignment.baseline,
|
|
|
|
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.baseline,
|
|
|
textBaseline: TextBaseline.alphabetic,
|
|
textBaseline: TextBaseline.alphabetic,
|
|
|
children: <Widget>[
|
|
children: <Widget>[
|
|
|
Text(
|
|
Text(
|
|
|
- (seasonList[index].bonus / 1000)
|
|
|
|
|
- .toStringAsFixed(1),
|
|
|
|
|
|
|
+ (seasonList[index].bonus / 1000).toStringAsFixed(1),
|
|
|
style: TextStyle(
|
|
style: TextStyle(
|
|
|
color: Colors.white,
|
|
color: Colors.white,
|
|
|
fontSize: 68,
|
|
fontSize: 68,
|
|
@@ -178,10 +178,7 @@ class _HomePageState extends State<HomePage> {
|
|
|
color: Colors.transparent,
|
|
color: Colors.transparent,
|
|
|
child: InkWell(
|
|
child: InkWell(
|
|
|
onTap: () {
|
|
onTap: () {
|
|
|
- Navigator.push(
|
|
|
|
|
- context,
|
|
|
|
|
- new CupertinoPageRoute(
|
|
|
|
|
- builder: (context) => new Setting()));
|
|
|
|
|
|
|
+ Navigator.push(context, new CupertinoPageRoute(builder: (context) => new Setting()));
|
|
|
},
|
|
},
|
|
|
child: Padding(
|
|
child: Padding(
|
|
|
padding: EdgeInsets.all(12),
|
|
padding: EdgeInsets.all(12),
|
|
@@ -203,13 +200,33 @@ class _HomePageState extends State<HomePage> {
|
|
|
style: TextStyle(color: Colors.white, fontSize: 14),
|
|
style: TextStyle(color: Colors.white, fontSize: 14),
|
|
|
),
|
|
),
|
|
|
Text(
|
|
Text(
|
|
|
- seasonList.length > 0
|
|
|
|
|
- ? seasonList[nowIndex].gameInfo.gameName
|
|
|
|
|
- : '',
|
|
|
|
|
|
|
+ seasonList.length > 0 ? seasonList[nowIndex].gameInfo.gameName : '',
|
|
|
style: TextStyle(color: Colors.white, fontSize: 14),
|
|
style: TextStyle(color: Colors.white, fontSize: 14),
|
|
|
)
|
|
)
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
|
|
|
+ ),
|
|
|
|
|
+ Positioned(
|
|
|
|
|
+ bottom: 60,
|
|
|
|
|
+ left: 0,
|
|
|
|
|
+ child: FlatButton(
|
|
|
|
|
+ child: Text("stream"),
|
|
|
|
|
+ onPressed: () async {
|
|
|
|
|
+ bool success = await ScreenStreamPlugin.start('rtmp://49.4.66.233:1935/myapp/' + userInfo.id.toString() + '?playerInfoId=' + '1234');
|
|
|
|
|
+ print('stream screen:' + success.toString());
|
|
|
|
|
+ },
|
|
|
|
|
+ ),
|
|
|
|
|
+ ),
|
|
|
|
|
+ Positioned(
|
|
|
|
|
+ bottom: 60,
|
|
|
|
|
+ right: 0,
|
|
|
|
|
+ child: FlatButton(
|
|
|
|
|
+ child: Text("stop stream"),
|
|
|
|
|
+ onPressed: () async {
|
|
|
|
|
+ bool success = await ScreenStreamPlugin.stop();
|
|
|
|
|
+ print('stop stream screen:' + success.toString());
|
|
|
|
|
+ },
|
|
|
|
|
+ ),
|
|
|
)
|
|
)
|
|
|
],
|
|
],
|
|
|
),
|
|
),
|
|
@@ -227,13 +244,9 @@ class _HomePageState extends State<HomePage> {
|
|
|
Navigator.of(context).push(PageRouteBuilder(
|
|
Navigator.of(context).push(PageRouteBuilder(
|
|
|
opaque: false,
|
|
opaque: false,
|
|
|
transitionDuration: Duration(milliseconds: 300),
|
|
transitionDuration: Duration(milliseconds: 300),
|
|
|
- transitionsBuilder: (BuildContext context,
|
|
|
|
|
- Animation<double> animation,
|
|
|
|
|
- Animation<double> secondaryAnimation,
|
|
|
|
|
- Widget child) {
|
|
|
|
|
|
|
+ transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
|
|
|
return FadeTransition(
|
|
return FadeTransition(
|
|
|
- opacity: CurvedAnimation(
|
|
|
|
|
- parent: animation, curve: Curves.linear),
|
|
|
|
|
|
|
+ opacity: CurvedAnimation(parent: animation, curve: Curves.linear),
|
|
|
child: child,
|
|
child: child,
|
|
|
);
|
|
);
|
|
|
},
|
|
},
|
|
@@ -251,21 +264,14 @@ class _HomePageState extends State<HomePage> {
|
|
|
"images/home_icon_sousuo.png",
|
|
"images/home_icon_sousuo.png",
|
|
|
"搜索",
|
|
"搜索",
|
|
|
onTapHomeMenu: () {
|
|
onTapHomeMenu: () {
|
|
|
- Navigator.push(
|
|
|
|
|
- context,
|
|
|
|
|
- new CupertinoPageRoute(
|
|
|
|
|
- builder: (context) => new RoomList()));
|
|
|
|
|
|
|
+ Navigator.push(context, new CupertinoPageRoute(builder: (context) => new RoomList()));
|
|
|
},
|
|
},
|
|
|
),
|
|
),
|
|
|
HomeMenu(
|
|
HomeMenu(
|
|
|
"images/home_icon_youjian.png",
|
|
"images/home_icon_youjian.png",
|
|
|
"邮件",
|
|
"邮件",
|
|
|
onTapHomeMenu: () {
|
|
onTapHomeMenu: () {
|
|
|
- Navigator.push(
|
|
|
|
|
- context,
|
|
|
|
|
- new CupertinoPageRoute(
|
|
|
|
|
- builder: (context) => new TipList()));
|
|
|
|
|
-
|
|
|
|
|
|
|
+ Navigator.push(context, new CupertinoPageRoute(builder: (context) => new TipList()));
|
|
|
},
|
|
},
|
|
|
),
|
|
),
|
|
|
],
|
|
],
|
|
@@ -286,11 +292,8 @@ class HomeMenu extends StatelessWidget {
|
|
|
@override
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
Widget build(BuildContext context) {
|
|
|
return Container(
|
|
return Container(
|
|
|
- decoration: BoxDecoration(
|
|
|
|
|
- gradient: LinearGradient(
|
|
|
|
|
- begin: Alignment.topCenter,
|
|
|
|
|
- end: Alignment.bottomCenter,
|
|
|
|
|
- colors: [Color(0xFF626C85), Color(0xFF3D3E6C)])),
|
|
|
|
|
|
|
+ decoration:
|
|
|
|
|
+ BoxDecoration(gradient: LinearGradient(begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [Color(0xFF626C85), Color(0xFF3D3E6C)])),
|
|
|
child: AspectRatio(
|
|
child: AspectRatio(
|
|
|
aspectRatio: 1,
|
|
aspectRatio: 1,
|
|
|
child: Container(
|
|
child: Container(
|