x1ongzhu 6 лет назад
Родитель
Сommit
7605bbaac8
5 измененных файлов с 193 добавлено и 190 удалено
  1. 11 1
      android/app/build.gradle
  2. BIN
      android/app/debug.jks
  3. 180 188
      lib/pages/HomePage.dart
  4. 0 0
      lib/widget/HomeDrawer.dart
  5. 2 1
      pubspec.yaml

+ 11 - 1
android/app/build.gradle

@@ -39,10 +39,13 @@ android {
         versionName flutterVersionName
         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
         ndk {
-            abiFilters 'armeabi-v7a'
+            // abiFilters 'armeabi-v7a'
         }
     }
     signingConfigs {
+        debug {
+            storeFile file('debug.jks')
+        }
         release {
             storeFile file('zouma.jks')
             storePassword "zouma123"
@@ -51,6 +54,9 @@ android {
         }
     }
     buildTypes {
+        debug {
+            signingConfig signingConfigs.debug
+        }
         release {
             signingConfig signingConfigs.release
             minifyEnabled false
@@ -58,6 +64,10 @@ android {
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
         }
     }
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_1_8
+        targetCompatibility JavaVersion.VERSION_1_8
+    }
 }
 
 flutter {

BIN
android/app/debug.jks


+ 180 - 188
lib/pages/HomePage.dart

@@ -1,8 +1,7 @@
 import 'package:flutter/material.dart';
-import 'package:flutter_redux/flutter_redux.dart';
-import '../widgets/HomeDrawer.dart';
-import './Setting.dart';
-import './CreateRoom.dart';
+import '../widget/HomeDrawer.dart';
+import 'Setting.dart';
+import 'CreateRoom.dart';
 import 'RoomList.dart'; //房间列表
 import 'package:flutter/cupertino.dart';
 import 'package:flutter_swiper/flutter_swiper.dart';
@@ -12,8 +11,6 @@ import '../styles/totast.dart';
 import '../net/HttpManager.dart';
 import '../net/Result.dart';
 import 'TipList.dart';
-import '../model/UserInfo.dart';
-import '../redux/AppState.dart';
 
 class HomePage extends StatefulWidget {
   @override
@@ -66,197 +63,192 @@ class _HomePageState extends State<HomePage> {
     );
   }
 
-  Widget centerWidget(BuildContext context) {
-    UserInfo userInfo = StoreProvider.of<AppState>(context).state.userInfo;
-    return Column(
-      children: <Widget>[
-        Expanded(
-          child: Stack(
-            children: <Widget>[
-              Container(
-                  child: seasonList.length > 0
-                      ? Swiper(
-                          index: nowIndex,
-                          itemCount: seasonList.length,
-                          scrollDirection: Axis.horizontal,
-                          loop: true,
-                          onTap: (index) {
-                            setState(() {
-                              nowIndex = index;
-                            });
-                          },
-                          onIndexChanged: (index) {
-                            setState(() {
-                              nowIndex = index;
-                            });
-                          },
-                          itemBuilder: (context, index) {
-                            return Center(
-                              child: SizedBox(
-                                  width: 214,
-                                  height: 214,
-                                  child: Stack(
-                                    children: <Widget>[
-                                      Image.asset("images/home_icon_yuan.png"),
-                                      Center(
-                                        child: Row(
-                                          mainAxisAlignment: MainAxisAlignment.center,
-                                          crossAxisAlignment: CrossAxisAlignment.baseline,
-                                          textBaseline: TextBaseline.alphabetic,
-                                          children: <Widget>[
-                                            Text(
-                                              (seasonList[index].bonus / 1000).toStringAsFixed(1),
-                                              style: TextStyle(
-                                                color: Colors.white,
-                                                fontSize: 68,
-                                                fontFamily: 'DINEngschrift',
-                                              ),
+  Widget centerWidget(BuildContext context) => Column(
+        children: <Widget>[
+          Expanded(
+            child: Stack(
+              children: <Widget>[
+                Container(
+                    child: seasonList.length > 0
+                        ? Swiper(
+                            index: nowIndex,
+                            itemCount: seasonList.length,
+                            scrollDirection: Axis.horizontal,
+                            loop: true,
+                            onTap: (index) {
+                              setState(() {
+                                nowIndex = index;
+                              });
+                            },
+                            onIndexChanged: (index) {
+                              setState(() {
+                                nowIndex = index;
+                              });
+                            },
+                            itemBuilder: (context, index) => Center(
+                                  child: SizedBox(
+                                      width: 214,
+                                      height: 214,
+                                      child: Stack(
+                                        children: <Widget>[
+                                          Image.asset("images/home_icon_yuan.png"),
+                                          Center(
+                                            child: Row(
+                                              mainAxisAlignment: MainAxisAlignment.center,
+                                              crossAxisAlignment: CrossAxisAlignment.baseline,
+                                              textBaseline: TextBaseline.alphabetic,
+                                              children: <Widget>[
+                                                Text(
+                                                  (seasonList[index].bonus / 1000).toStringAsFixed(1),
+                                                  style: TextStyle(
+                                                    color: Colors.white,
+                                                    fontSize: 68,
+                                                    fontFamily: 'DINEngschrift',
+                                                  ),
+                                                ),
+                                                Text(
+                                                  "K",
+                                                  style: TextStyle(
+                                                    color: Colors.white,
+                                                    fontSize: 36,
+                                                    fontFamily: 'DINEngschrift',
+                                                  ),
+                                                )
+                                              ],
                                             ),
-                                            Text(
-                                              "K",
-                                              style: TextStyle(
-                                                color: Colors.white,
-                                                fontSize: 36,
-                                                fontFamily: 'DINEngschrift',
-                                              ),
-                                            )
-                                          ],
-                                        ),
-                                      ),
-                                      Positioned(
-                                        bottom: 30,
-                                        left: 0,
-                                        right: 0,
-                                        child: Column(
-                                          children: <Widget>[
-                                            // Text(
-                                            //   "当前排名",
-                                            //   style: TextStyle(
-                                            //       color: Colors.white, fontSize: 13),
-                                            // ),
-                                            // Text(
-                                            //   "98686",
-                                            //   style: TextStyle(
-                                            //       color: Colors.white, fontSize: 13),
-                                            // )
-                                          ],
-                                        ),
-                                      )
-                                    ],
-                                  )),
-                            );
-                          },
-                        )
-                      : Container()),
-              Positioned(
-                left: 0,
-                top: 0,
-                width: 48,
-                height: 48,
-                child: Material(
-                  color: Colors.transparent,
-                  child: Builder(
-                    builder: (context) => InkWell(
-                          onTap: () {
-                            Scaffold.of(context).openDrawer();
-                          },
-                          child: Padding(
-                            padding: EdgeInsets.all(12),
-                            child: Image.asset("images/home_icon_wode.png"),
+                                          ),
+                                          Positioned(
+                                            bottom: 30,
+                                            left: 0,
+                                            right: 0,
+                                            child: Column(
+                                              children: <Widget>[
+                                                // Text(
+                                                //   "当前排名",
+                                                //   style: TextStyle(
+                                                //       color: Colors.white, fontSize: 13),
+                                                // ),
+                                                // Text(
+                                                //   "98686",
+                                                //   style: TextStyle(
+                                                //       color: Colors.white, fontSize: 13),
+                                                // )
+                                              ],
+                                            ),
+                                          )
+                                        ],
+                                      )),
+                                ),
+                          )
+                        : Container()),
+                Positioned(
+                  left: 0,
+                  top: 0,
+                  width: 48,
+                  height: 48,
+                  child: Material(
+                    color: Colors.transparent,
+                    child: Builder(
+                      builder: (context) => InkWell(
+                            onTap: () {
+                              Scaffold.of(context).openDrawer();
+                            },
+                            child: Padding(
+                              padding: EdgeInsets.all(12),
+                              child: Image.asset("images/home_icon_wode.png"),
+                            ),
                           ),
-                        ),
+                    ),
                   ),
                 ),
-              ),
-              Positioned(
-                right: 0,
-                top: 0,
-                width: 48,
-                height: 48,
-                child: Material(
-                  color: Colors.transparent,
-                  child: InkWell(
-                    onTap: () {
-                      Navigator.push(context, new CupertinoPageRoute(builder: (context) => new Setting()));
-                    },
-                    child: Padding(
-                      padding: EdgeInsets.all(12),
-                      child: Image.asset("images/home_icon_shezhi.png"),
+                Positioned(
+                  right: 0,
+                  top: 0,
+                  width: 48,
+                  height: 48,
+                  child: Material(
+                    color: Colors.transparent,
+                    child: InkWell(
+                      onTap: () {
+                        Navigator.push(context, new CupertinoPageRoute(builder: (context) => new Setting()));
+                      },
+                      child: Padding(
+                        padding: EdgeInsets.all(12),
+                        child: Image.asset("images/home_icon_shezhi.png"),
+                      ),
                     ),
                   ),
                 ),
-              ),
-              Positioned(
-                bottom: 11,
-                left: 0,
-                right: 0,
-                child: Column(
-                  mainAxisAlignment: MainAxisAlignment.center,
-                  crossAxisAlignment: CrossAxisAlignment.center,
-                  children: <Widget>[
-                    Text(
-                      seasonList.length > 0 ? seasonList[nowIndex].season : '',
-                      style: TextStyle(color: Colors.white, fontSize: 14),
-                    ),
-                    Text(
-                      seasonList.length > 0 ? seasonList[nowIndex].gameInfo.gameName : '',
-                      style: TextStyle(color: Colors.white, fontSize: 14),
-                    )
-                  ],
+                Positioned(
+                  bottom: 11,
+                  left: 0,
+                  right: 0,
+                  child: Column(
+                    mainAxisAlignment: MainAxisAlignment.center,
+                    crossAxisAlignment: CrossAxisAlignment.center,
+                    children: <Widget>[
+                      Text(
+                        seasonList.length > 0 ? seasonList[nowIndex].season : '',
+                        style: TextStyle(color: Colors.white, fontSize: 14),
+                      ),
+                      Text(
+                        seasonList.length > 0 ? seasonList[nowIndex].gameInfo.gameName : '',
+                        style: TextStyle(color: Colors.white, fontSize: 14),
+                      )
+                    ],
+                  ),
                 ),
-              ),
-            ],
-          ),
-        ),
-        Container(
-          child: GridView.count(
-            physics: new BouncingScrollPhysics(),
-            shrinkWrap: true,
-            crossAxisCount: 2,
-            children: <Widget>[
-              HomeMenu(
-                "images/home_icon_fangjian.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();
-                      }));
-                },
-              ),
-              HomeMenu(
-                "images/home_icon_kuaisu.png",
-                "快速进入",
-                onTapHomeMenu: () {},
-              ),
-              HomeMenu(
-                "images/home_icon_sousuo.png",
-                "搜索",
-                onTapHomeMenu: () {
-                  Navigator.push(context, new CupertinoPageRoute(builder: (context) => new RoomList()));
-                },
-              ),
-              HomeMenu(
-                "images/home_icon_youjian.png",
-                "邮件",
-                onTapHomeMenu: () {
-                  Navigator.push(context, new CupertinoPageRoute(builder: (context) => new TipList()));
-                },
-              ),
-            ],
+              ],
+            ),
           ),
-        )
-      ],
-    );
-  }
+          Container(
+            child: GridView.count(
+              physics: new BouncingScrollPhysics(),
+              shrinkWrap: true,
+              crossAxisCount: 2,
+              children: <Widget>[
+                HomeMenu(
+                  "images/home_icon_fangjian.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();
+                        }));
+                  },
+                ),
+                HomeMenu(
+                  "images/home_icon_kuaisu.png",
+                  "快速进入",
+                  onTapHomeMenu: () {},
+                ),
+                HomeMenu(
+                  "images/home_icon_sousuo.png",
+                  "搜索",
+                  onTapHomeMenu: () {
+                    Navigator.push(context, new CupertinoPageRoute(builder: (context) => new RoomList()));
+                  },
+                ),
+                HomeMenu(
+                  "images/home_icon_youjian.png",
+                  "邮件",
+                  onTapHomeMenu: () {
+                    Navigator.push(context, new CupertinoPageRoute(builder: (context) => new TipList()));
+                  },
+                ),
+              ],
+            ),
+          )
+        ],
+      );
 }
 
 typedef int OnTapHomeMenu();

+ 0 - 0
lib/widgets/HomeDrawer.dart → lib/widget/HomeDrawer.dart


+ 2 - 1
pubspec.yaml

@@ -27,8 +27,9 @@ dependencies:
   intl: "^0.15.6"
   file_picker: ^1.1.1
   json_serializable: ^2.0.2
-  shared_preferences: ^0.5.1+1
+  shared_preferences: ^0.5.1
   package_info: ^0.4.0
+  video_player: ^0.10.0
 
 dev_dependencies:
   build_runner: ^1.1.1