|
|
@@ -16,8 +16,7 @@ import 'package:flutter_redux/flutter_redux.dart';
|
|
|
import '../redux/AppState.dart';
|
|
|
import 'Setting.dart';
|
|
|
import '../widget/Dialog.dart';
|
|
|
-import 'package:redux/redux.dart';
|
|
|
-import '../model/UserInfo.dart';
|
|
|
+import '../pages/openRoom.dart';
|
|
|
|
|
|
class HomePage extends StatefulWidget {
|
|
|
@override
|
|
|
@@ -37,7 +36,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
|
|
});
|
|
|
Toast.hide();
|
|
|
if (res.success) {
|
|
|
- List<GameInfoSeasons> list = [];
|
|
|
+ List<GameInfoSeasons> list = [];
|
|
|
for (var item in res.data) {
|
|
|
list.add(GameInfoSeasons.fromJson(item));
|
|
|
}
|
|
|
@@ -49,20 +48,38 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
|
|
|
|
|
void showBackDialog() {
|
|
|
MyDialog.showDialog(context, '暂时没有进行中的房间,敬请期待...');
|
|
|
+ // showDialog<Null>(
|
|
|
+ // context: context,
|
|
|
+ // barrierDismissible: false,
|
|
|
+ // builder: (BuildContext context) {
|
|
|
+ // return AlertDialog(
|
|
|
+ // content: Container(
|
|
|
+ // height: 50,
|
|
|
+ // child: Text(
|
|
|
+
|
|
|
+ // style: TextStyle(color: Colors.black),
|
|
|
+ // ),
|
|
|
+ // ),
|
|
|
+ // actions: <Widget>[
|
|
|
+ // FlatButton(
|
|
|
+ // child: Text('确定'),
|
|
|
+ // onPressed: () {
|
|
|
+ // Navigator.of(context).pop();
|
|
|
+ // },
|
|
|
+ // ),
|
|
|
+ // ],
|
|
|
+ // );
|
|
|
+ // },
|
|
|
+ // ).then((val) {});
|
|
|
}
|
|
|
|
|
|
Future<void> getOneRoom() async {
|
|
|
Toast.show(context, '加载中', -1, 'loading');
|
|
|
- Result res =
|
|
|
- await HttpManager.get('houseInfo/getOne', data: {'statusFlag': 0});
|
|
|
+ Result res = await HttpManager.get('houseInfo/getOne', data: {'statusFlag': 0});
|
|
|
Toast.hide();
|
|
|
if (res.success) {
|
|
|
if (res.data != null) {
|
|
|
- Navigator.push(
|
|
|
- context,
|
|
|
- CupertinoPageRoute(
|
|
|
- builder: (context) =>
|
|
|
- RoomInfo(roomId: res.data['id'].toString())));
|
|
|
+ Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomInfo(roomId: res.data['id'].toString())));
|
|
|
} else {
|
|
|
showBackDialog();
|
|
|
}
|
|
|
@@ -70,10 +87,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
|
|
}
|
|
|
|
|
|
Future<void> getUnreadMsg() async {
|
|
|
- Result res = await HttpManager.get('systemNotice/unread', data: {
|
|
|
- 'userId': StoreProvider.of<AppState>(context).state.userInfo.id,
|
|
|
- 'statusFlag': 0
|
|
|
- });
|
|
|
+ Result res = await HttpManager.get('systemNotice/unread', data: {'userId': StoreProvider.of<AppState>(context).state.userInfo.id, 'statusFlag': 0});
|
|
|
if (res.success && res.data != null) {
|
|
|
if (res.data > 0) {
|
|
|
setState(() {
|
|
|
@@ -113,45 +127,31 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
|
|
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
- return StoreConnector<AppState, UserInfo>(
|
|
|
- converter: (Store store) => store.state.userInfo,
|
|
|
- builder: (context, userInfo) {
|
|
|
- return Scaffold(
|
|
|
- drawer: HomeDrawer(),
|
|
|
- body: WillPopScope(
|
|
|
- child: Container(
|
|
|
- width: double.infinity,
|
|
|
- height: double.infinity,
|
|
|
- decoration: BoxDecoration(
|
|
|
- gradient: LinearGradient(
|
|
|
- colors: [
|
|
|
- Color(0xFFC0C0C0),
|
|
|
- Color(0xFF3D4043),
|
|
|
- Color(0xFF383C40)
|
|
|
- ],
|
|
|
- begin: Alignment.topCenter,
|
|
|
- end: Alignment.bottomCenter,
|
|
|
- stops: [0.0, 0.15, 1.0])),
|
|
|
- child: SafeArea(
|
|
|
- child: centerWidget(context, userInfo),
|
|
|
- ),
|
|
|
- ),
|
|
|
- onWillPop: () {
|
|
|
- Future.value(true);
|
|
|
- },
|
|
|
- ),
|
|
|
- // floatingActionButton: floatWidget(),
|
|
|
- // floatingActionButtonLocation:
|
|
|
- // FloatingActionButtonLocation.centerDocked,
|
|
|
- );
|
|
|
- });
|
|
|
+ return Scaffold(
|
|
|
+ drawer: HomeDrawer(),
|
|
|
+ body: WillPopScope(
|
|
|
+ child: Container(
|
|
|
+ width: double.infinity,
|
|
|
+ height: double.infinity,
|
|
|
+ decoration: BoxDecoration(
|
|
|
+ gradient: LinearGradient(
|
|
|
+ colors: [Color.fromARGB(255, 177, 59, 56), Color.fromARGB(255, 147, 64, 61)], begin: Alignment.topCenter, end: Alignment.bottomCenter)),
|
|
|
+ child: SafeArea(
|
|
|
+ child: centerWidget(context),
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ onWillPop: () {
|
|
|
+ Future.value(true);
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ // floatingActionButton: floatWidget(),
|
|
|
+ // floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
Widget floatWidget() {
|
|
|
return Container(
|
|
|
- decoration: BoxDecoration(
|
|
|
- borderRadius: BorderRadius.all(Radius.circular(100)),
|
|
|
- border: Border.all(width: 1, color: Color(0xFF1B1C28))),
|
|
|
+ decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(100)), border: Border.all(width: 1, color: Color(0xFF1B1C28))),
|
|
|
width: 166,
|
|
|
height: 166,
|
|
|
margin: EdgeInsets.only(bottom: 84),
|
|
|
@@ -177,15 +177,14 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- Widget centerWidget(BuildContext context, UserInfo userInfo) {
|
|
|
+ Widget centerWidget(BuildContext context) {
|
|
|
double width = MediaQuery.of(context).size.width;
|
|
|
double height = MediaQuery.of(context).size.height;
|
|
|
String endSTring = '';
|
|
|
if (seasonList.isNotEmpty) {
|
|
|
- int _time = seasonList[nowIndex].competitionSeason.endTime -
|
|
|
- DateTime.now().millisecondsSinceEpoch;
|
|
|
+ int _time = seasonList[nowIndex].competitionSeason.endTime - DateTime.now().millisecondsSinceEpoch;
|
|
|
_time = _time ~/ 1000 ~/ 3600 ~/ 24;
|
|
|
- endSTring = _time.toString();
|
|
|
+ endSTring = '倒计时 ' + _time.toString() + ' 天';
|
|
|
}
|
|
|
|
|
|
return Column(
|
|
|
@@ -204,13 +203,8 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
|
|
Navigator.push(
|
|
|
context,
|
|
|
CupertinoPageRoute(
|
|
|
- builder: (context) => RankList(
|
|
|
- raceId: seasonList[index]
|
|
|
- .competitionSeason
|
|
|
- .id,
|
|
|
- gameId: seasonList[index]
|
|
|
- .competitionSeason
|
|
|
- .gameId)));
|
|
|
+ builder: (context) =>
|
|
|
+ RankList(raceId: seasonList[index].competitionSeason.id, gameId: seasonList[index].competitionSeason.gameId)));
|
|
|
},
|
|
|
onIndexChanged: (index) {
|
|
|
setState(() {
|
|
|
@@ -220,29 +214,15 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
|
|
itemBuilder: (context, index) {
|
|
|
return Center(
|
|
|
child: Container(
|
|
|
- // width: 0.64 * (height - 334),
|
|
|
- // height: 0.64 * (height - 334),
|
|
|
-
|
|
|
- // decoration: BoxDecoration(image: DecorationImage(image: AssetImage('images/home_icon_yuan.png'), fit: BoxFit.contain)),
|
|
|
+ width: 0.64 * (height - 334),
|
|
|
+ height: 0.64 * (height - 334),
|
|
|
+ decoration: BoxDecoration(image: DecorationImage(image: AssetImage('images/home_icon_yuan.png'), fit: BoxFit.contain)),
|
|
|
child: Column(
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
children: <Widget>[
|
|
|
+ Text('赛季奖金', style: TextStyle(color: Color(0xFFFFFFFF), fontSize: 13)),
|
|
|
Container(
|
|
|
- width: double.infinity,
|
|
|
- height: 52,
|
|
|
- decoration: BoxDecoration(
|
|
|
- image: DecorationImage(
|
|
|
- image: AssetImage(
|
|
|
- 'images/img_guang_home.png'))),
|
|
|
- child: Text(
|
|
|
- '赛季奖金',
|
|
|
- style: TextStyle(
|
|
|
- color: Color(0xFFFFFFFF),
|
|
|
- fontSize: 26,
|
|
|
- fontFamily: 'Pangmen',
|
|
|
- ),
|
|
|
- textAlign: TextAlign.center,
|
|
|
- ),
|
|
|
+ height: 0.1 * (height - 334),
|
|
|
),
|
|
|
Row(
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
@@ -250,58 +230,24 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
|
|
children: _moneyList(),
|
|
|
),
|
|
|
Container(
|
|
|
- height: 15,
|
|
|
+ height: 0.06 * (height - 334),
|
|
|
),
|
|
|
- seasonList[index]
|
|
|
- .competitionSeason
|
|
|
- .playerInfo
|
|
|
- .rank !=
|
|
|
- null
|
|
|
- ? Text(
|
|
|
- '当前排名 ' +
|
|
|
- seasonList[index]
|
|
|
+ Column(
|
|
|
+ children: <Widget>[
|
|
|
+ Text('当前排名',
|
|
|
+ style: TextStyle(
|
|
|
+ color: Color(0xFFFFFFFF),
|
|
|
+ fontSize: 13)),
|
|
|
+ Text( seasonList[index]
|
|
|
.competitionSeason
|
|
|
.playerInfo
|
|
|
.rank
|
|
|
.toString(),
|
|
|
style: TextStyle(
|
|
|
color: Color(0xFFFFFFFF),
|
|
|
- fontSize: 24,
|
|
|
- fontFamily: 'Pangmen'))
|
|
|
- : Container(),
|
|
|
- Container(
|
|
|
- height: 12,
|
|
|
- ),
|
|
|
- Text.rich(TextSpan(
|
|
|
- children: [
|
|
|
- TextSpan(text: "倒计时 "),
|
|
|
- TextSpan(
|
|
|
- text: endSTring,
|
|
|
- style: TextStyle(fontSize: 27),
|
|
|
- ),
|
|
|
- TextSpan(
|
|
|
- text: ' 天',
|
|
|
- ),
|
|
|
- ],
|
|
|
- style: TextStyle(
|
|
|
- color: Color(0xFFFFFFFF),
|
|
|
- fontSize: 16,
|
|
|
- fontFamily: 'Pangmen')))
|
|
|
- // Container(
|
|
|
- // height: 0.06 * (height - 334),
|
|
|
- // ),
|
|
|
- // Column(
|
|
|
- // children: <Widget>[
|
|
|
- // Text('当前排名',
|
|
|
- // style: TextStyle(
|
|
|
- // color: Color(0xFFFFFFFF),
|
|
|
- // fontSize: 13)),
|
|
|
- // Text('2',
|
|
|
- // style: TextStyle(
|
|
|
- // color: Color(0xFFFFFFFF),
|
|
|
- // fontSize: 13))
|
|
|
- // ],
|
|
|
- // )
|
|
|
+ fontSize: 13))
|
|
|
+ ],
|
|
|
+ )
|
|
|
],
|
|
|
),
|
|
|
));
|
|
|
@@ -309,45 +255,30 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
|
|
)
|
|
|
: Container()),
|
|
|
Positioned(
|
|
|
- left: 26,
|
|
|
- top: 10,
|
|
|
+ left: 10,
|
|
|
+ top: 0,
|
|
|
width: 48,
|
|
|
height: 48,
|
|
|
child: Material(
|
|
|
color: Colors.transparent,
|
|
|
child: Builder(
|
|
|
builder: (context) => InkWell(
|
|
|
- onTap: () {
|
|
|
- Scaffold.of(context).openDrawer();
|
|
|
- },
|
|
|
- child: Container(
|
|
|
- width: 48,
|
|
|
- height: 48,
|
|
|
- padding: EdgeInsets.all(5),
|
|
|
- decoration: BoxDecoration(
|
|
|
- gradient: LinearGradient(
|
|
|
- colors: [Color(0xFFFEFEFE), Color(0xFFBFBFBF)],
|
|
|
- begin: Alignment.topCenter,
|
|
|
- end: Alignment.bottomCenter,
|
|
|
- ),
|
|
|
- borderRadius:
|
|
|
- BorderRadius.all(Radius.circular(100)),
|
|
|
- boxShadow: [
|
|
|
- //阴影
|
|
|
- BoxShadow(
|
|
|
- color: Colors.black45,
|
|
|
- offset: Offset(0, 2.0),
|
|
|
- blurRadius: 6.0)
|
|
|
- ]),
|
|
|
- child: CircleAvatar(
|
|
|
- backgroundImage: NetworkImage(userInfo.icon),
|
|
|
+ onTap: () {
|
|
|
+ Scaffold.of(context).openDrawer();
|
|
|
+ },
|
|
|
+ child: Padding(
|
|
|
+ padding: EdgeInsets.all(12),
|
|
|
+ child: Image.asset(
|
|
|
+ 'images/person.png',
|
|
|
+ width: 24,
|
|
|
+ ),
|
|
|
),
|
|
|
- )),
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
Positioned(
|
|
|
- right: 12,
|
|
|
+ right: 10,
|
|
|
top: 0,
|
|
|
width: 48,
|
|
|
height: 48,
|
|
|
@@ -355,16 +286,51 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
|
|
color: Colors.transparent,
|
|
|
child: InkWell(
|
|
|
onTap: () {
|
|
|
- Navigator.push(context,
|
|
|
- CupertinoPageRoute(builder: (context) => Setting()));
|
|
|
+ Navigator.push(context, CupertinoPageRoute(builder: (context) => Setting()));
|
|
|
},
|
|
|
child: Padding(
|
|
|
padding: EdgeInsets.all(12),
|
|
|
- child: Image.asset('images/setting.png', width: 19),
|
|
|
+ child: Image.asset('images/setting.png', width: 24),
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
+ Positioned(
|
|
|
+ top: 15,
|
|
|
+ left: 0,
|
|
|
+ right: 0,
|
|
|
+ child: Column(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: <Widget>[
|
|
|
+ // Text(
|
|
|
+ // seasonList.length > 0
|
|
|
+ // ? seasonList[nowIndex].competitionSeason.season
|
|
|
+ // : '',
|
|
|
+ // style: TextStyle(color: Colors.white, fontSize: 14),
|
|
|
+ // ),
|
|
|
+ Text(
|
|
|
+ seasonList.isNotEmpty ? seasonList[nowIndex].gameName : '',
|
|
|
+ style: TextStyle(color: Colors.white, fontSize: 14),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
+ Positioned(
|
|
|
+ bottom: 20,
|
|
|
+ left: 0,
|
|
|
+ right: 0,
|
|
|
+ child: Column(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: <Widget>[
|
|
|
+ Text(
|
|
|
+ endSTring,
|
|
|
+ style: TextStyle(color: Colors.white, fontSize: 14),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
+ ),
|
|
|
],
|
|
|
),
|
|
|
),
|
|
|
@@ -373,108 +339,57 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
|
|
double aspectRatio = 1;
|
|
|
aspectRatio = width / 334;
|
|
|
return Container(
|
|
|
- height: 338,
|
|
|
- padding: EdgeInsets.fromLTRB(16, 34, 16, 26),
|
|
|
- width: double.infinity,
|
|
|
- decoration: BoxDecoration(
|
|
|
- gradient: LinearGradient(
|
|
|
- colors: [
|
|
|
- Color(0xFF394247),
|
|
|
- Color(0xFF1C272D),
|
|
|
- Color(0xFF08141A)
|
|
|
- ],
|
|
|
- begin: Alignment.topCenter,
|
|
|
- end: Alignment.bottomCenter,
|
|
|
- )),
|
|
|
- child: Column(
|
|
|
+ child: GridView.count(
|
|
|
+ physics: BouncingScrollPhysics(),
|
|
|
+ shrinkWrap: true,
|
|
|
+ crossAxisCount: 2,
|
|
|
+ childAspectRatio: aspectRatio,
|
|
|
children: <Widget>[
|
|
|
- Container(
|
|
|
- width: double.infinity,
|
|
|
- height: 108,
|
|
|
- child: HomeMenu(
|
|
|
- '开始游戏',
|
|
|
- onTapHomeMenu: () {
|
|
|
- Navigator.push(
|
|
|
- context,
|
|
|
- CupertinoPageRoute(
|
|
|
- builder: (context) => RoomList()));
|
|
|
- },
|
|
|
- ),
|
|
|
+ HomeMenu(
|
|
|
+ 'images/home_icon_01.png',
|
|
|
+ '加入比赛',
|
|
|
+ onTapHomeMenu: () {
|
|
|
+ // Navigator.of(context).push(PageRouteBuilder(
|
|
|
+ // opaque: false,
|
|
|
+ // transitionDuration: Duration(milliseconds: 300),
|
|
|
+ // transitionsBuilder: (BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) {
|
|
|
+ // return FadeTransition(
|
|
|
+ // opacity: CurvedAnimation(parent: animation, curve: Curves.linear),
|
|
|
+ // child: child,
|
|
|
+ // );
|
|
|
+ // },
|
|
|
+ // pageBuilder: (BuildContext context, _, __) {
|
|
|
+ // return CreateRoom();
|
|
|
+ // }));
|
|
|
+
|
|
|
+ Navigator.push(context, CupertinoPageRoute(builder: (context) => OpenRoom(roomFlag: '0')));
|
|
|
+ },
|
|
|
),
|
|
|
- Container(
|
|
|
- height: 28,
|
|
|
+ HomeMenu(
|
|
|
+ 'images/home_icon_02.png',
|
|
|
+ '发起赛事',
|
|
|
+ onTapHomeMenu: () {
|
|
|
+ Navigator.push(context, CupertinoPageRoute(builder: (context) => RoomList()));
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ HomeMenu(
|
|
|
+ 'images/home_icon_03.png',
|
|
|
+ '系统通知',
|
|
|
+ onTapHomeMenu: () async {
|
|
|
+ bool result = await Navigator.push(context, CupertinoPageRoute(builder: (context) => TipList()));
|
|
|
+ if (result) {
|
|
|
+ getUnreadMsg();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ showBadge: showBadge,
|
|
|
+ ),
|
|
|
+ HomeMenu(
|
|
|
+ 'images/home_icon_04.png',
|
|
|
+ '充值',
|
|
|
+ onTapHomeMenu: () {
|
|
|
+ Navigator.push(context, CupertinoPageRoute(builder: (context) => ShoppingMall()));
|
|
|
+ },
|
|
|
),
|
|
|
- Row(
|
|
|
- children: <Widget>[
|
|
|
- Expanded(
|
|
|
- flex: 1,
|
|
|
- child: Column(
|
|
|
- children: <Widget>[
|
|
|
- Container(
|
|
|
- height: 67,
|
|
|
- child: HomeMenu(
|
|
|
- '新增',
|
|
|
- onTapHomeMenu: () {
|
|
|
- Navigator.of(context).push(PageRouteBuilder(
|
|
|
- opaque: false,
|
|
|
- transitionDuration:
|
|
|
- Duration(milliseconds: 300),
|
|
|
- transitionsBuilder: (BuildContext context,
|
|
|
- Animation<double> animation,
|
|
|
- Animation<double> secondaryAnimation,
|
|
|
- Widget child) {
|
|
|
- return FadeTransition(
|
|
|
- opacity: CurvedAnimation(
|
|
|
- parent: animation,
|
|
|
- curve: Curves.linear),
|
|
|
- child: child,
|
|
|
- );
|
|
|
- },
|
|
|
- pageBuilder:
|
|
|
- (BuildContext context, _, __) {
|
|
|
- return CreateRoom();
|
|
|
- }));
|
|
|
- },
|
|
|
- ),
|
|
|
- ),
|
|
|
- Container(
|
|
|
- height: 8,
|
|
|
- ),
|
|
|
- Container(
|
|
|
- height: 67,
|
|
|
- child: HomeMenu(
|
|
|
- '邮件',
|
|
|
- onTapHomeMenu: () {
|
|
|
- Navigator.push(
|
|
|
- context,
|
|
|
- CupertinoPageRoute(
|
|
|
- builder: (context) => TipList()));
|
|
|
- },
|
|
|
- ),
|
|
|
- )
|
|
|
- ],
|
|
|
- ),
|
|
|
- ),
|
|
|
- Container(
|
|
|
- width: 14,
|
|
|
- ),
|
|
|
- Expanded(
|
|
|
- flex: 1,
|
|
|
- child: Container(
|
|
|
- height: 142,
|
|
|
- child: HomeMenu(
|
|
|
- '商城',
|
|
|
- onTapHomeMenu: () {
|
|
|
- Navigator.push(
|
|
|
- context,
|
|
|
- CupertinoPageRoute(
|
|
|
- builder: (context) => ShoppingMall()));
|
|
|
- },
|
|
|
- ),
|
|
|
- ),
|
|
|
- )
|
|
|
- ],
|
|
|
- )
|
|
|
],
|
|
|
),
|
|
|
);
|
|
|
@@ -488,13 +403,12 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
|
|
double height = MediaQuery.of(context).size.height;
|
|
|
List<Widget> _list = [];
|
|
|
|
|
|
- String bouns = (seasonList[nowIndex].competitionSeason.bonus / 1000)
|
|
|
- .toStringAsFixed(1);
|
|
|
+ String bouns = (seasonList[nowIndex].competitionSeason.bonus / 1000).toStringAsFixed(1);
|
|
|
|
|
|
- // String bouns = (6002222100 / 1000).toStringAsFixed(1);
|
|
|
+ // String bouns = (900000000100 / 1000).toStringAsFixed(1);
|
|
|
// print(bouns);
|
|
|
// print(bouns.indexOf('.0'));
|
|
|
- if (bouns.indexOf('.0') != -1 || num.parse(bouns) > 99) {
|
|
|
+ if (bouns.indexOf('.0') != -1 || num.parse(bouns) > 999) {
|
|
|
bouns = bouns.substring(0, bouns.length - 2);
|
|
|
}
|
|
|
|
|
|
@@ -533,9 +447,7 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
|
|
_imageList.add('images/9.png');
|
|
|
break;
|
|
|
case '.':
|
|
|
- _imageList.add('kong');
|
|
|
- _imageList.add('images/dian.png');
|
|
|
- _imageList.add('kong');
|
|
|
+ _imageList.add('.');
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -544,41 +456,26 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
|
|
}
|
|
|
|
|
|
for (var item in _imageList) {
|
|
|
- if (item == 'kong') {
|
|
|
- _list.add(Container(
|
|
|
- width: 5,
|
|
|
- ));
|
|
|
- } else {
|
|
|
- if (_bounsList.length > 4) {
|
|
|
- _list.add(Image.asset(item, height: 300 / _bounsList.length));
|
|
|
+ if (item != '.') {
|
|
|
+ if (_imageList.length > 4) {
|
|
|
+ double _scale = 1 - (_imageList.length - 4) * 0.2;
|
|
|
+ _list.add(Image.asset(item, height: 0.18 * 0.64 * (height - 334) * _scale));
|
|
|
} else {
|
|
|
- _list.add(Image.asset(item));
|
|
|
+ _list.add(Image.asset(item, height: 0.18 * 0.64 * (height - 334)));
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- // if (item != '.') {
|
|
|
- // // if (_imageList.length > 4) {
|
|
|
- // // double _scale = 1 - (_imageList.length - 4) * 0.2;
|
|
|
- // // _list.add(Image.asset(item, height: 0.18 * 0.64 * (height - 334) * _scale));
|
|
|
- // // } else {
|
|
|
- // // _list.add(Image.asset(item, height: 0.18 * 0.64 * (height - 334)));
|
|
|
- // // }
|
|
|
- // _list.add(Image.asset(item));
|
|
|
|
|
|
- // } else {
|
|
|
- // _list.add(Text(
|
|
|
- // '.',
|
|
|
- // style: TextStyle(color: Colors.white, fontSize: 36, fontFamily: 'DINEngschrift', height: 0),
|
|
|
- // ));
|
|
|
- // }
|
|
|
- }
|
|
|
- _list.add(Container(width: 5));
|
|
|
- if (_bounsList.length > 4) {
|
|
|
- _list.add(Image.asset('images/K.png', height: 300 / _bounsList.length));
|
|
|
- } else {
|
|
|
- _list.add(Image.asset('images/K.png'));
|
|
|
+ // _list.add(Container(width: 5));
|
|
|
+ } else {
|
|
|
+ _list.add(Text(
|
|
|
+ '.',
|
|
|
+ style: TextStyle(color: Colors.white, fontSize: 36, fontFamily: 'DINEngschrift', height: 1),
|
|
|
+ ));
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
+ _list.add(Text(
|
|
|
+ 'K',
|
|
|
+ style: TextStyle(color: Colors.white, fontSize: 24, fontFamily: 'DINEngschrift', height: .5),
|
|
|
+ ));
|
|
|
return _list;
|
|
|
}
|
|
|
}
|
|
|
@@ -586,38 +483,47 @@ class _HomePageState extends State<HomePage> with WidgetsBindingObserver {
|
|
|
typedef void OnTapHomeMenu();
|
|
|
|
|
|
class HomeMenu extends StatelessWidget {
|
|
|
- final String title;
|
|
|
+ final String icon;
|
|
|
+ final String name;
|
|
|
final OnTapHomeMenu onTapHomeMenu;
|
|
|
final bool showBadge;
|
|
|
- HomeMenu(this.title, {this.onTapHomeMenu, this.showBadge = false});
|
|
|
+ HomeMenu(this.icon, this.name, {this.onTapHomeMenu, this.showBadge = false});
|
|
|
@override
|
|
|
Widget build(BuildContext context) {
|
|
|
return Container(
|
|
|
- padding: EdgeInsets.all(5),
|
|
|
decoration: BoxDecoration(
|
|
|
gradient: LinearGradient(
|
|
|
begin: Alignment.topCenter,
|
|
|
end: Alignment.bottomCenter,
|
|
|
- colors: [Color(0xFFDFCF74), Color(0xFF6FB692)])),
|
|
|
+ stops: [0.0, 0.01, 0.8],
|
|
|
+ colors: [Color(0xFF7E89B7), Color(0xFF4E536F), Color(0xFF333558)])),
|
|
|
child: Container(
|
|
|
decoration: BoxDecoration(
|
|
|
- gradient: LinearGradient(
|
|
|
- begin: Alignment.topCenter,
|
|
|
- end: Alignment.bottomCenter,
|
|
|
- colors: [Color(0xFFFFC30F), Color(0xFFFFA54C)])),
|
|
|
+ border: Border(
|
|
|
+ // top: BorderSide(width: 2,color: Color(0xFF7E89B7)),
|
|
|
+ left: BorderSide(width: 0.5, color: Color(0x80000000)),
|
|
|
+ right: BorderSide(width: 0.5, color: Color(0x80000000)),
|
|
|
+ bottom: BorderSide(width: 1, color: Color(0x80000000)))),
|
|
|
child: Material(
|
|
|
color: Colors.transparent,
|
|
|
child: InkWell(
|
|
|
onTap: onTapHomeMenu,
|
|
|
child: Container(
|
|
|
- child: Center(
|
|
|
- child: Text(
|
|
|
- title,
|
|
|
- style: TextStyle(
|
|
|
- color: Color(0xFFFFFFFF),
|
|
|
- fontSize: 43,
|
|
|
- fontFamily: 'Pangmen'),
|
|
|
- )),
|
|
|
+ child: Column(
|
|
|
+ mainAxisAlignment: MainAxisAlignment.center,
|
|
|
+ crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
+ children: <Widget>[
|
|
|
+ Image.asset(
|
|
|
+ icon,
|
|
|
+ fit: BoxFit.contain,
|
|
|
+ ),
|
|
|
+ Container(height: 5,),
|
|
|
+ Text(
|
|
|
+ name,
|
|
|
+ style: TextStyle(color: Colors.white, fontSize: 13),
|
|
|
+ )
|
|
|
+ ],
|
|
|
+ ),
|
|
|
),
|
|
|
),
|
|
|
),
|