Procházet zdrojové kódy

fix:v1.3版本的UI

Primroses před 3 roky
rodič
revize
b28614b5bb

binární
lib/assets/img/mine_img_lineleft.png


binární
lib/assets/img/mine_img_lineright.png


+ 45 - 19
lib/pages/game/game_detail.dart

@@ -773,14 +773,27 @@ class _PositionedBottomState extends LifecycleState<PositionedBottom> {
       child: InkWell(
         child: Stack(
           children: <Widget>[
-            ClipRRect(
-              borderRadius: BorderRadius.circular(22.0),
-              child: SizedBox(
-                height: widget.height,
-                child: LinearProgressIndicator(
-                  backgroundColor: Color.fromRGBO(220, 220, 220, 1),
-                  valueColor: AlwaysStoppedAnimation(Theme.of(context).accentColor),
-                  value: _percent / 100,
+            Container(
+              decoration: BoxDecoration(
+                borderRadius: BorderRadius.all(Radius.circular(20.0)),
+                border: new Border.all(width: 1, color: Theme.of(context).accentColor),
+                // color: Theme.of(context).accentColor,
+                // boxShadow: [BoxShadow(offset: Offset(0.0, 3), blurRadius: 3, spreadRadius: 0, color: Color(0x82FF9100))],
+                // gradient: new LinearGradient(begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [
+                //   Color.fromRGBO(255, 196, 0, 1),
+                //   Color.fromRGBO(255, 170, 0, 1),
+                // ]),
+              ),
+              child: ClipRRect(
+                borderRadius: BorderRadius.circular(22.0),
+                child: SizedBox(
+                  height: widget.height,
+                  child: LinearProgressIndicator(
+//                        backgroundColor: Color.fromRGBO(220, 220, 220, 1),
+                    backgroundColor: Colors.white,
+                    valueColor: AlwaysStoppedAnimation(Theme.of(context).accentColor.withOpacity(0.3)),
+                    value: _percent / 100,
+                  ),
                 ),
               ),
             ),
@@ -788,7 +801,7 @@ class _PositionedBottomState extends LifecycleState<PositionedBottom> {
               alignment: Alignment.center,
               child: Text(
                 _percent >= 100.0 ? "正在校验" : "${_percent.toStringAsFixed(1)}%",
-                style: widget.textStyle,
+                style: widget.textStyle.copyWith(color:Theme.of(context).accentColor),
                 strutStyle: fixedLine,
               ),
             )
@@ -817,14 +830,27 @@ class _PositionedBottomState extends LifecycleState<PositionedBottom> {
               height: widget.height,
               child: Stack(
                 children: <Widget>[
-                  ClipRRect(
-                    borderRadius: BorderRadius.circular(22.0),
-                    child: SizedBox(
-                      height: widget.height,
-                      child: LinearProgressIndicator(
-                        backgroundColor: Color.fromRGBO(220, 220, 220, 1),
-                        valueColor: AlwaysStoppedAnimation(Theme.of(context).accentColor),
-                        value: _percent / 100,
+                  Container(
+                    decoration: BoxDecoration(
+                      borderRadius: BorderRadius.all(Radius.circular(20.0)),
+                      border: new Border.all(width: 1, color: Theme.of(context).accentColor),
+                      // color: Theme.of(context).accentColor,
+                      // boxShadow: [BoxShadow(offset: Offset(0.0, 3), blurRadius: 3, spreadRadius: 0, color: Color(0x82FF9100))],
+                      // gradient: new LinearGradient(begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [
+                      //   Color.fromRGBO(255, 196, 0, 1),
+                      //   Color.fromRGBO(255, 170, 0, 1),
+                      // ]),
+                    ),
+                    child: ClipRRect(
+                      borderRadius: BorderRadius.circular(22.0),
+                      child: SizedBox(
+                        height: widget.height,
+                        child: LinearProgressIndicator(
+//                        backgroundColor: Color.fromRGBO(220, 220, 220, 1),
+                          backgroundColor: Colors.white,
+                          valueColor: AlwaysStoppedAnimation(Theme.of(context).accentColor.withOpacity(0.3)),
+                          value: _percent / 100,
+                        ),
                       ),
                     ),
                   ),
@@ -832,7 +858,7 @@ class _PositionedBottomState extends LifecycleState<PositionedBottom> {
                     alignment: Alignment.center,
                     child: Text(
                       "继续下载",
-                      style:  widget.textStyle,
+                      style:  widget.textStyle.copyWith(color: Theme.of(context).accentColor),
                       strutStyle: fixedLine,
                     ),
                   )
@@ -874,7 +900,7 @@ class _PositionedBottomState extends LifecycleState<PositionedBottom> {
         content: "开始运动",
         width: widget.width,
         height: widget.height,
-        bold: true,
+//        bold: true,
       ),
     );
   }

+ 1 - 1
lib/pages/game/game_info.dart

@@ -199,7 +199,7 @@ class SportItem extends StatelessWidget {
                   children: <Widget>[
                     Text(
                       "${item.name}",
-                      style: Theme.of(context).textTheme.headline4.copyWith(fontSize: 20.0),
+                      style: Theme.of(context).textTheme.headline4.copyWith(fontSize: 18.0),
                     ),
                     const SizedBox(height: 5.0,),
                     Row(

+ 7 - 7
lib/pages/home/consume_page.dart

@@ -90,7 +90,7 @@ class _PageState extends State<ConsumePage> with InjectApi {
                               children: <Widget>[
                                 Text("消耗卡路里", style: Theme.of(context).textTheme.subtitle1),
                                 SizedBox(
-                                  height: 22.0,
+                                  height: 26.0,
                                 ),
                                 Row(
                                   children: <Widget>[
@@ -111,7 +111,7 @@ class _PageState extends State<ConsumePage> with InjectApi {
                                   crossAxisAlignment: CrossAxisAlignment.end,
                                 ),
                                 SizedBox(
-                                  height: 10,
+                                  height: 8,
                                 ),
                                 GestureDetector(
                                   onTap: () async {
@@ -247,7 +247,7 @@ class _PageState extends State<ConsumePage> with InjectApi {
                                           ),
                                           Text(
                                             text,
-                                            style: Theme.of(context).textTheme.bodyText2,
+                                            style: Theme.of(context).textTheme.bodyText2.copyWith(color: Color(0xff333333)),
                                             strutStyle: fixedLine,
                                           ),
                                           GestureDetector(
@@ -328,7 +328,7 @@ class _PageState extends State<ConsumePage> with InjectApi {
                                             width: 12.0,
                                           ),
                                           Padding(
-                                            padding: const EdgeInsets.all(8.0),
+                                            padding: const EdgeInsets.fromLTRB(8, 8, 8, 4),
                                             child: StaggeredGridView.extent(
                                                 maxCrossAxisExtent: (MediaQuery.of(context).size.width - 32.0) / 2,
                                                 padding: EdgeInsets.zero,
@@ -357,7 +357,7 @@ class _PageState extends State<ConsumePage> with InjectApi {
                                                                     children: <Widget>[
                                                                       Text(
                                                                         e.title,
-                                                                        style: Theme.of(context).textTheme.headline1.copyWith(fontSize: 20.0),
+                                                                        style: e.unit != "" ? Theme.of(context).textTheme.headline1.copyWith(fontSize: 20.0):Theme.of(context).textTheme.headline1.copyWith(fontSize: 16.0),
                                                                         strutStyle: fixedLine,
                                                                       ),
                                                                       Text(" ${e.unit}", style: Theme.of(context).textTheme.subtitle2),
@@ -383,10 +383,10 @@ class _PageState extends State<ConsumePage> with InjectApi {
                                                 children: <Widget>[
                                                   Text(
                                                     "日均数据",
-                                                    style: Theme.of(context).textTheme.headline1,
+                                                    style: Theme.of(context).textTheme.headline1.copyWith(fontSize: 16.0),
                                                   ),
                                                   SizedBox(
-                                                    height: 12.0,
+                                                    height: 16.0,
                                                   ),
                                                   Container(
                                                     padding: const EdgeInsets.fromLTRB(14.0, 21.0, 14.0, 21.0),

+ 19 - 14
lib/pages/home/duration_page.dart

@@ -19,6 +19,7 @@ import 'package:sport/widgets/dialog/request_dialog.dart';
 import 'package:sport/widgets/image.dart';
 import 'package:sport/widgets/loading.dart';
 import 'package:sport/widgets/misc.dart';
+import 'package:sport/widgets/space.dart';
 
 class DurationPage extends StatefulWidget {
   @override
@@ -61,6 +62,10 @@ class _PageState extends State<DurationPage> {
             ? RequestLoadingWidget()
             : CustomScrollView(
                 slivers: <Widget>[
+//                  SizeBox(),
+//                  SliverToBoxAdapter(
+//                    child: Space(height: 20.0,),
+//                  ),
                   buildSliverAppBar(context, "运动目标", backgroundColor: Theme.of(context).scaffoldBackgroundColor, actions: [
                     IconButton(
                       icon: Image.asset(
@@ -76,8 +81,8 @@ class _PageState extends State<DurationPage> {
                   ]),
                   SliverToBoxAdapter(
                     child: Container(
-                      margin: const EdgeInsets.all(12.0),
-                      padding: const EdgeInsets.all(12.0),
+                      margin: const EdgeInsets.symmetric(horizontal: 12.0),
+                      padding: const EdgeInsets.only(top:20.0,bottom: 10.0,left: 16.0,right: 16.0),
                       decoration: circular(),
                       child: Column(
                         children: <Widget>[
@@ -146,7 +151,7 @@ class _PageState extends State<DurationPage> {
                                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                   ),
                                   const SizedBox(
-                                    height: 5.0,
+                                    height: 8.0,
                                   ),
                                   Row(
                                     children: <Widget>[
@@ -162,7 +167,7 @@ class _PageState extends State<DurationPage> {
                                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                   ),
                                   const SizedBox(
-                                    height: 5.0,
+                                    height: 8.0,
                                   ),
                                   Row(
                                     children: <Widget>[
@@ -178,7 +183,7 @@ class _PageState extends State<DurationPage> {
                                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
                                   ),
                                   const SizedBox(
-                                    height: 5.0,
+                                    height: 8.0,
                                   ),
                                   Row(
                                     children: <Widget>[
@@ -201,16 +206,16 @@ class _PageState extends State<DurationPage> {
                   ),
                   SliverToBoxAdapter(
                     child: Padding(
-                      padding: const EdgeInsets.all(12.0),
+                      padding: const EdgeInsets.fromLTRB(12.0, 16.0 , 12.0,12.0),
                       child: Column(
                         crossAxisAlignment: CrossAxisAlignment.start,
                         children: <Widget>[
                           Text(
                             "达标记录",
-                            style: Theme.of(context).textTheme.headline1,
+                            style: Theme.of(context).textTheme.headline1.copyWith(fontSize: 16.0),
                           ),
                           const SizedBox(
-                            height: 12.0,
+                            height: 16.0,
                           ),
                           Container(
                             padding: const EdgeInsets.all(12.0),
@@ -240,7 +245,7 @@ class _PageState extends State<DurationPage> {
                                             ),
                                             Text(
                                               "${time.year}年${'${time.month}'.padLeft(2, '0')}月",
-                                              style: Theme.of(context).textTheme.bodyText2,
+                                              style: Theme.of(context).textTheme.bodyText2.copyWith(color: Color(0xff333333)),
                                               strutStyle: fixedLine,
                                             ),
                                             SizedBox(
@@ -375,20 +380,20 @@ class _PageState extends State<DurationPage> {
                   ),
                   SliverToBoxAdapter(
                     child: Padding(
-                      padding: const EdgeInsets.all(12.0),
+                      padding: const EdgeInsets.fromLTRB(12.0, 0.0 , 12.0,12.0),
                       child: Column(
                         crossAxisAlignment: CrossAxisAlignment.start,
                         children: <Widget>[
                           Text(
                             "本月达标奖励",
-                            style: Theme.of(context).textTheme.headline1,
+                            style: Theme.of(context).textTheme.headline1.copyWith(fontSize: 16.0),
                           ),
                           const SizedBox(
-                            height: 12.0,
+                            height: 16.0,
                           ),
                           Container(
                             decoration: circular(),
-                            padding: const EdgeInsets.all(12.0),
+                            padding: const EdgeInsets.fromLTRB(12.0, 20.0, 12.0, 12.0),
                             child: StaggeredGridView.countBuilder(
                               padding: EdgeInsets.zero,
                               shrinkWrap: true,
@@ -410,7 +415,7 @@ class _PageState extends State<DurationPage> {
                                         style: Theme.of(context).textTheme.subtitle2,
                                       ),
                                       const SizedBox(
-                                        height: 5.0,
+                                        height: 12.0,
                                       ),
                                       PrimaryButton(
                                         width: 65.0,

+ 8 - 5
lib/pages/home/duration_setting_page.dart

@@ -23,6 +23,9 @@ class _PageState extends State<DurationSettingPage> with SingleTickerProviderSta
   void initState() {
     super.initState();
     _controller = new TabController(length: 2, vsync: this);
+    _controller.addListener(() {
+//      print(_controller.index);
+    });
   }
 
   @override
@@ -36,7 +39,7 @@ class _PageState extends State<DurationSettingPage> with SingleTickerProviderSta
     return Scaffold(
       backgroundColor: Colors.white,
       appBar: AppBar(
-        titleSpacing: 0,
+        titleSpacing: -12.0,
         centerTitle: false,
         title: Text(
           "设定目标",
@@ -54,8 +57,8 @@ class _PageState extends State<DurationSettingPage> with SingleTickerProviderSta
               indicatorPadding: EdgeInsets.symmetric(horizontal: 10.0),
               indicatorWeight: 3,
               unselectedLabelColor: Color(0xff999999),
-              labelStyle: TextStyle(fontSize: 18.0, fontWeight: FontWeight.w600),
-              unselectedLabelStyle: TextStyle(fontSize: 18.0, fontWeight: FontWeight.w600),
+              labelStyle: TextStyle(fontSize: 16.0),
+              unselectedLabelStyle: TextStyle(fontSize: 16.0),
               labelPadding: EdgeInsets.symmetric(vertical: 0.0, horizontal: 30.0),
 //          indicator: const BoxDecoration(),
 //          labelPadding:  EdgeInsets.all(20.0),
@@ -191,7 +194,7 @@ class _FormState extends State<_Form> {
                 width: .5,
               ),
             ),
-            child: Center(child: Text("自定义", style: Theme.of(context).textTheme.subtitle1.copyWith(color: Theme.of(context).accentColor))),
+            child: Center(child: Text("自定义", style: Theme.of(context).textTheme.subtitle1.copyWith(color: Theme.of(context).accentColor),strutStyle: StrutStyle(forceStrutHeight: true),)),
           ),
         ),
         const SizedBox(
@@ -238,7 +241,7 @@ class _FormState extends State<_Form> {
           ),
         ),
         PrimaryButton(
-          height: 35.0,
+          height: 44.0,
           content: "确定",
           callback: () async {
             await request(context, () async {

+ 4 - 3
lib/pages/home/home_info_page.dart

@@ -184,6 +184,7 @@ class _PageState extends ViewStateLifecycle<HomeInfoPage, SportIndexModel> with
                                   content: "开始运动",
                                   width: 174,
                                   height: 40,
+//                                  bold: true,
                                   callback: () {
                                     showDialog(context: context, child: SportListPage());
                                   },
@@ -494,13 +495,13 @@ class _PageState extends ViewStateLifecycle<HomeInfoPage, SportIndexModel> with
             ),
             SliverToBoxAdapter(
               child: Container(
-                  padding: _margin,
+                  padding: EdgeInsets.fromLTRB(12.0,16.0, 12.0,4.0),
                   child: Row(
                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
                     children: <Widget>[
                       Text(
                         "今日运动",
-                        style: Theme.of(context).textTheme.headline1,
+                        style: Theme.of(context).textTheme.headline1.copyWith(fontSize: 16.0),
                       ),
                       GestureDetector(
                         onTap: () => NavigatorUtil.goPage(context, (context) => SportHistoryAllPage()),
@@ -637,7 +638,7 @@ class _PageState extends ViewStateLifecycle<HomeInfoPage, SportIndexModel> with
             //   ),
             SliverToBoxAdapter(
               child: SizedBox(
-                height: 50,
+                height: 12,
               ),
             ),
           ],

+ 4 - 1
lib/pages/home/sport_list_page.dart

@@ -36,7 +36,7 @@ class _PageState extends State<SportListPage> with InjectApi {
       //背景滤镜
       filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
       child: Scaffold(
-        backgroundColor: Colors.transparent,
+        backgroundColor: Colors.transparent.withOpacity(0.5),
         body: Center(
           child: Padding(
             padding: const EdgeInsets.fromLTRB(0, 80.0, 0, 20.0),
@@ -103,6 +103,9 @@ class _PageState extends State<SportListPage> with InjectApi {
                                                               e.name,
                                                               style: Theme.of(context).textTheme.headline3,
                                                             ),
+                                                            const SizedBox(
+                                                              height: 3,
+                                                            ),
                                                             Text(
                                                               "${e.userCount}人在练",
                                                               style: Theme.of(context).textTheme.bodyText1,

+ 3 - 3
lib/pages/home/step_page.dart

@@ -59,7 +59,7 @@ class _PageState extends State<StepPage> with TickerProviderStateMixin, InjectAp
     return Scaffold(
         backgroundColor: Colors.white,
         appBar: AppBar(
-          titleSpacing: 0,
+          titleSpacing: -12.0,
           centerTitle: false,
           title: Text(
             "运动步数",
@@ -153,7 +153,7 @@ class _PageState extends State<StepPage> with TickerProviderStateMixin, InjectAp
                               ),
                               Text(
                                 text,
-                                style: Theme.of(context).textTheme.bodyText2,
+                                style: Theme.of(context).textTheme.bodyText2.copyWith(color: Color(0xff333333)),
                                 strutStyle: fixedLine,
                               ),
                               GestureDetector(
@@ -201,7 +201,7 @@ class _PageState extends State<StepPage> with TickerProviderStateMixin, InjectAp
                                             ),
                                             Text(
                                               toType() == 0 ? "日总步数" : "日均步数",
-                                              style: Theme.of(context).textTheme.subtitle2,
+                                              style: Theme.of(context).textTheme.subtitle2.copyWith(color:Color(0xff999999)),
                                             ),
                                             SizedBox(
                                               height: 30.0,

+ 18 - 12
lib/pages/home/strength_page.dart

@@ -2,6 +2,7 @@ import 'dart:math';
 import 'dart:ui';
 import 'dart:ui' as ui;
 
+import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter_swiper/flutter_swiper.dart';
 import 'package:sport/bean/sport_detail.dart';
@@ -12,6 +13,7 @@ import 'package:sport/widgets/appbar.dart';
 import 'package:sport/widgets/decoration.dart';
 import 'package:sport/widgets/misc.dart';
 import 'package:sport/widgets/progress_bar.dart';
+import 'package:sport/widgets/space.dart';
 
 class StrengthPage extends StatefulWidget {
   @override
@@ -90,14 +92,15 @@ class _PageState extends State<StrengthPage> with InjectApi {
                       width: 15.0,
                     ),
                     Padding(
-                      padding: const EdgeInsets.symmetric(vertical: 12.0),
+                      padding: const EdgeInsets.symmetric(vertical: 6.0),
                       child: Row(
                         children: <Widget>[
                           Row(
+                            crossAxisAlignment: CrossAxisAlignment.center,
                             children: <Widget>[
                               Container(
-                                width: 10,
-                                height: 10,
+                                width: 8,
+                                height: 8,
                                 decoration: BoxDecoration(shape: BoxShape.circle, color: const Color(0xffFFE600)),
                               ),
                               const SizedBox(
@@ -112,8 +115,8 @@ class _PageState extends State<StrengthPage> with InjectApi {
                                 width: 12.0,
                               ),
                               Container(
-                                width: 10,
-                                height: 10,
+                                width: 8,
+                                height: 8,
                                 decoration: BoxDecoration(shape: BoxShape.circle, color: const Color(0xffFFAA00)),
                               ),
                               const SizedBox(
@@ -128,8 +131,8 @@ class _PageState extends State<StrengthPage> with InjectApi {
                                 width: 12.0,
                               ),
                               Container(
-                                width: 10,
-                                height: 10,
+                                width: 8,
+                                height: 8,
                                 decoration: BoxDecoration(shape: BoxShape.circle, color: const Color(0xffFF7323)),
                               ),
                               const SizedBox(
@@ -163,9 +166,10 @@ class _PageState extends State<StrengthPage> with InjectApi {
                                 "${snapshot?.data?.data?.sum?.consume ?? 0}",
                                 style: Theme.of(context).textTheme.headline2.copyWith(fontSize: 26.0),
                               ),
+                              Space(height: 4.0,),
                               Text(
-                                "运动消耗 (卡",
-                                style: Theme.of(context).textTheme.bodyText2,
+                                "运动消耗 (卡)",
+                                style: Theme.of(context).textTheme.bodyText1,
                               ),
                             ],
                             mainAxisSize: MainAxisSize.min,
@@ -177,9 +181,10 @@ class _PageState extends State<StrengthPage> with InjectApi {
                                 "${snapshot?.data?.data?.sum?.durationMinute ?? 0}",
                                 style: Theme.of(context).textTheme.headline2.copyWith(fontSize: 26.0),
                               ),
+                              Space(height: 4.0,),
                               Text(
-                                "运动时长 (分钟",
-                                style: Theme.of(context).textTheme.bodyText2,
+                                "运动时长 (分钟)",
+                                style: Theme.of(context).textTheme.bodyText1,
                               ),
                             ],
                             mainAxisSize: MainAxisSize.min,
@@ -268,7 +273,7 @@ class _PageState extends State<StrengthPage> with InjectApi {
                     loop: false,
                     itemBuilder: (BuildContext context, int index) {
                       return Container(
-                        margin: const EdgeInsets.all(12.0),
+                        margin: const EdgeInsets.only(left:12.0,right: 12.0),
                         // decoration: circular(),
                         // padding: const EdgeInsets.all(12.0),
                         child: Column(
@@ -286,6 +291,7 @@ class _PageState extends State<StrengthPage> with InjectApi {
                                   ? "感觉舒适,呼吸有节奏,能自由进行交谈。该级别适用于恢复和基础心血功能训练,可以提高心脏的泵血能力和肌肉使用氧气的能力"
                                   : index == 1 ? "该级别训练强度适中,较难以进行交谈,呼吸加重。可以适当增强心肺功能,获得更强耐力" : "感觉难受,且呼吸急促,难以长时间维持该强度训练。可以增强力量和肌肉耐力,提高厌氧能力和乳酸阈值",
                               style: Theme.of(context).textTheme.bodyText2,
+                              strutStyle: StrutStyle(height: 1.5,forceStrutHeight: true),
                             ),
                           ],
                         ),

+ 303 - 232
lib/pages/my/achievement_detail_page.dart

@@ -1,4 +1,5 @@
 import 'dart:math';
+import 'dart:ui';
 
 import 'package:cached_network_image/cached_network_image.dart';
 import 'package:flutter/cupertino.dart';
@@ -273,259 +274,329 @@ Future<bool> showSharePopup(
       context: context,
       barrierDismissible: true,
       barrierLabel: '',
-      barrierColor: Color(0xff241D19).withOpacity(0.8),
+//      barrierColor: Color(0xff241D19).withOpacity(0.8),
       transitionDuration: Duration(milliseconds: 200),
 //                              useRootNavigator: false,
       pageBuilder: (BuildContext context, Animation<double> animation,
           Animation<double> secondaryAnimation) {
-        return Material(
-          color: Colors.transparent,
-          child: Column(
+        return BackdropFilter(
+          filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
+          child: Material(
+            color: Colors.transparent.withOpacity(0.8),
+            child: Column(
 //            mainAxisSize: MainAxisSize.max,
-            children: <Widget>[
-              Space(
-                height: MediaQuery.of(context).padding.top + 31,
-              ),
-              Column(
-                mainAxisSize: MainAxisSize.max,
-                mainAxisAlignment: MainAxisAlignment.start,
-                children: <Widget>[
-                  Container(
-                      padding: EdgeInsets.symmetric(horizontal: 17.0),
-                      alignment: Alignment.centerRight,
-                      child: InkWell(
-                        child: Container(
-                          width: 22.0,
-                          height: 22.0,
-                          decoration: BoxDecoration(
-                              image: DecorationImage(
-                                  image: AssetImage(
-                                      "lib/assets/img/btn_close_white.png"))),
-                        ),
-                        onTap: () {
-                          Navigator.pop(context, false);
-                        },
-                      )),
-                  Space(
-                    height: 145,
-                  ),
-                  Stack(
+              children: <Widget>[
+                Space(
+                  height: MediaQuery.of(context).padding.top + 31,
+                ),
+                Column(
+                  mainAxisSize: MainAxisSize.max,
+                  mainAxisAlignment: MainAxisAlignment.start,
+                  children: <Widget>[
+                    Container(
+                        padding: EdgeInsets.symmetric(horizontal: 17.0),
+                        alignment: Alignment.centerRight,
+                        child: InkWell(
+                          child: Container(
+                            width: 22.0,
+                            height: 22.0,
+                            decoration: BoxDecoration(
+                                image: DecorationImage(
+                                    image: AssetImage(
+                                        "lib/assets/img/btn_close_white.png"))),
+                          ),
+                          onTap: () {
+                            Navigator.pop(context, false);
+                          },
+                        )),
+                    Space(
+                      height: 115,
+                    ),
+                    Stack(
 //                    fit: StackFit.expand,
-                    alignment: Alignment.topCenter,
-                    overflow: Overflow.visible,
-                    children: <Widget>[
-                      Container(
-                        height: 278,
-                        child: new Swiper(
+                      alignment: Alignment.topCenter,
+                      overflow: Overflow.visible,
+                      children: <Widget>[
+                        Container(
+                          height: 278,
+                          child: new Swiper(
 //                          itemWidth: MediaQuery.of(context).size.width,
-                          loop: false,
-                          index: startIndex,
-                          itemBuilder: (BuildContext context, int index) {
-                            return Column(
-                              children: <Widget>[
-                                relateAchievements[index].createdAt != ""
-                                    ? CachedNetworkImage(
-                                        imageUrl:
-                                            relateAchievements[index].logo,
-                                        width: 180,
-                                        height: 180,
-                                      )
-                                    : ColorFiltered(
-                                        colorFilter:
-                                            ColorFilter.matrix(<double>[
-                                          0.2126,
-                                          0.7152,
-                                          0.0722,
-                                          0,
-                                          0,
-                                          0.2126,
-                                          0.7152,
-                                          0.0722,
-                                          0,
-                                          0,
-                                          0.2126,
-                                          0.7152,
-                                          0.0722,
-                                          0,
-                                          0,
-                                          0,
-                                          0,
-                                          0,
-                                          1,
-                                          0,
-                                        ]),
-                                        child: CachedNetworkImage(
+                            loop: false,
+                            index: startIndex,
+                            itemBuilder: (BuildContext context, int index) {
+                              return Column(
+                                children: <Widget>[
+                                  relateAchievements[index].createdAt != ""
+                                      ? index != currentIndex
+                                          ? Opacity(
+                                              opacity: 0.5,
+                                              child: Container(
+                                                  child: CachedNetworkImage(
+                                                imageUrl:
+                                                    relateAchievements[index]
+                                                        .logo,
+                                                width: 180,
+                                                height: 180,
+                                              )))
+                                          : Container(
+                                              child: CachedNetworkImage(
+                                              imageUrl:
+                                                  relateAchievements[index]
+                                                      .logo,
+                                              width: 180,
+                                              height: 180,
+                                            ))
+                                      : index == currentIndex
+                                          ? ColorFiltered(
+                                              colorFilter:
+                                                  ColorFilter.matrix(<double>[
+                                                0.2126,
+                                                0.7152,
+                                                0.0722,
+                                                0,
+                                                0,
+                                                0.2126,
+                                                0.7152,
+                                                0.0722,
+                                                0,
+                                                0,
+                                                0.2126,
+                                                0.7152,
+                                                0.0722,
+                                                0,
+                                                0,
+                                                0,
+                                                0,
+                                                0,
+                                                1,
+                                                0,
+                                              ]),
+                                              child: CachedNetworkImage(
 //                                      width: 70.0,
 //                                      height: 70.0,
-                                            imageUrl:
-                                                relateAchievements[index]
-                                                    .logo),
-                                      ),
-                                if (index == currentIndex)
-                                  Column(
-                                    children: <Widget>[
-                                      Space(
-                                        height: 20.0,
-                                      ),
-                                      Text(
-                                        "${relateAchievements[index].name}",
-                                        style: TextStyle(
-                                            fontSize: 18.0,
-                                            color: Colors.white),
-                                      ),
-                                      Space(
-                                        height: 5.0,
-                                      ),
-                                    ],
-                                  )
-                              ],
-                            );
-                          },
-                          viewportFraction: 0.5,
-                          scale: 0.3,
-                          itemCount: relateAchievements.length,
-                          pagination: new SwiperPagination(
-                              margin: new EdgeInsets.symmetric(vertical: 0.0),
-                              builder: DotSwiperPaginationBuilder(
-                                  size: 6,
-                                  activeSize: 6,
-                                  activeColor:
-                                      Theme.of(context).accentColor)),
-                          onIndexChanged: (index) {
-                            _valueNotifierIndex.value = index;
-                            currentIndex = index;
-                          },
+                                                  imageUrl:
+                                                      relateAchievements[index]
+                                                          .logo),
+                                            )
+                                          : Opacity(
+                                              opacity: 0.5,
+                                              child: ColorFiltered(
+                                                colorFilter:
+                                                    ColorFilter.matrix(<double>[
+                                                  0.2126,
+                                                  0.7152,
+                                                  0.0722,
+                                                  0,
+                                                  0,
+                                                  0.2126,
+                                                  0.7152,
+                                                  0.0722,
+                                                  0,
+                                                  0,
+                                                  0.2126,
+                                                  0.7152,
+                                                  0.0722,
+                                                  0,
+                                                  0,
+                                                  0,
+                                                  0,
+                                                  0,
+                                                  1,
+                                                  0,
+                                                ]),
+                                                child: CachedNetworkImage(
+//                                      width: 70.0,
+//                                      height: 70.0,
+                                                    imageUrl:
+                                                        relateAchievements[
+                                                                index]
+                                                            .logo),
+                                              ),
+                                            ),
+//                                  if (index == currentIndex)
+//                                    Column(
+//                                      children: <Widget>[
+//                                        Space(
+//                                          height: 20.0,
+//                                        ),
+//                                        Space(
+//                                          height: 5.0,
+//                                        ),
+//                                      ],
+//                                    )
+                                ],
+                              );
+                            },
+                            viewportFraction: 0.5,
+                            scale: 0.3,
+                            itemCount: relateAchievements.length,
+                            pagination: new SwiperPagination(
+                                margin: new EdgeInsets.symmetric(vertical: 0.0),
+                                builder: DotSwiperPaginationBuilder(
+                                    size: 6,
+                                    activeSize: 6,
+                                    color: Colors.white.withOpacity(0.5),
+                                    activeColor:
+                                        Theme.of(context).accentColor)),
+                            onIndexChanged: (index) {
+                              _valueNotifierIndex.value = index;
+                              currentIndex = index;
+                            },
+                          ),
                         ),
-                      ),
-                      Positioned(
+                        Positioned(
 //                          top: 120.0,
-                        top: 180,
-                        child: Container(
-                          child: ValueListenableBuilder(
-                              valueListenable: _valueNotifierIndex,
-                              builder: (BuildContext context, int value,
-                                  Widget child) {
-                                if (currentIndex == value) {
-                                  return relateAchievements[value]
-                                              .createdAt !=
-                                          ""
-                                      ? Column(
-                                          mainAxisSize: MainAxisSize.min,
-                                          children: <Widget>[
-                                            Space(
-                                              height: 57.0,
-                                            ),
-                                            Container(
-                                              alignment: Alignment.center,
-                                              child: Text(
-                                                  "${relateAchievements[value].conditionDetail}",
+                          top: 175,
+                          child: Container(
+                            child: ValueListenableBuilder(
+                                valueListenable: _valueNotifierIndex,
+                                builder: (BuildContext context, int value,
+                                    Widget child) {
+                                  if (currentIndex == value) {
+                                    return relateAchievements[value]
+                                                .createdAt !=
+                                            ""
+                                        ? Column(
+                                            mainAxisSize: MainAxisSize.min,
+                                            children: <Widget>[
+                                              Space(
+                                                height: 25.0,
+                                              ),
+                                              Text(
+                                                "${relateAchievements[value].name}",
+                                                style: TextStyle(
+                                                    fontSize: 18.0,
+                                                    color: Colors.white,
+                                                    fontWeight:
+                                                        FontWeight.bold),
+                                              ),
+                                              Space(
+                                                height: 10.0,
+                                              ),
+                                              Container(
+                                                alignment: Alignment.center,
+                                                child: Text(
+                                                    "${relateAchievements[value].conditionDetail}",
+                                                    style: TextStyle(
+                                                        fontSize: 14.0,
+                                                        color: Colors.white)),
+                                              ),
+                                              Space(
+                                                height: 60.0,
+                                              ),
+                                              Text(
+                                                  "获取时间  ${relateAchievements[value].createdAt.split(" ")[0]}"),
+                                              Space(
+                                                height: 16.0,
+                                              ),
+                                              Container(
+                                                alignment: Alignment.center,
+                                                height: 37.5,
+                                                width: MediaQuery.of(context)
+                                                    .size
+                                                    .width,
+                                                decoration: BoxDecoration(
+                                                    image: DecorationImage(
+                                                        image: AssetImage(
+                                                            "lib/assets/img/bg1_pop_achievement.png"),
+                                                        fit: BoxFit.cover)),
+                                                child: Text(
+                                                  "晋级奖励 : 经验值 +${relateAchievements[value].rewardExp} 积分 +${relateAchievements[value].rewardScore}",
                                                   style: TextStyle(
-                                                      fontSize: 14.0,
-                                                      color:
-                                                          Color(0xff999999))),
-                                            ),
-                                            Space(
-                                              height: 50.0,
-                                            ),
-                                            Text(
-                                                "获取时间  ${relateAchievements[value].createdAt.split(" ")[0]}"),
-                                            Space(
-                                              height: 16.0,
-                                            ),
-                                            Container(
-                                              alignment: Alignment.center,
-                                              height: 25.0,
-//                                      width:
-//                                      MediaQuery.of(context).size.width * 0.7,
-                                              decoration: BoxDecoration(
-                                                  image: DecorationImage(
-                                                      image: AssetImage(
-                                                          "lib/assets/img/bg1_pop_achievement.png"))),
-                                              child: Text(
+                                                    fontSize: 14.0,
+                                                    color: Theme.of(context)
+                                                        .accentColor,
+                                                  ),
+                                                  strutStyle: fixedLine,
+                                                ),
+                                              ),
+                                            ],
+                                          )
+                                        : Column(
+                                            children: <Widget>[
+                                              Space(
+                                                height: 25.0,
+                                              ),
+                                              Text(
+                                                "${relateAchievements[value].name}",
+                                                style: TextStyle(
+                                                    fontSize: 18.0,
+                                                    color: Colors.white),
+                                              ),
+                                              Space(
+                                                height: 10.0,
+                                              ),
+                                              Text(
+                                                "成就条件: ${relateAchievements[value].conditionDetail}",
+                                                style: TextStyle(
+                                                    fontSize: 14.0,
+                                                    color: Colors.white),
+                                              ),
+                                              Space(
+                                                height: 60.0,
+                                              ),
+                                              Text("未获得"),
+                                              Space(
+                                                height: 12.0,
+                                              ),
+                                              Text(
                                                 "晋级奖励 : 经验值 +${relateAchievements[value].rewardExp} 积分 +${relateAchievements[value].rewardScore}",
                                                 style: TextStyle(
                                                     fontSize: 14.0,
-                                                    color: Theme.of(context)
-                                                        .accentColor),
+                                                    color: Color(0xff999999)),
                                               ),
-                                            ),
-                                          ],
-                                        )
-                                      : Column(
-                                          children: <Widget>[
-                                            Space(
-                                              height: 57.0,
-                                            ),
-                                            Text(
-                                              "成就条件: ${relateAchievements[value].conditionDetail}",
-                                              style: TextStyle(
-                                                  fontSize: 14.0,
-                                                  color: Color(0xff999999)),
-                                            ),
-                                            Space(
-                                              height: 50.0,
-                                            ),
-                                            Text("未获得"),
-                                            Space(
-                                              height: 22.0,
-                                            ),
-                                            Text(
-                                              "晋级奖励 : 经验值 +${relateAchievements[value].rewardExp} 积分 +${relateAchievements[value].rewardScore}",
-                                              style: TextStyle(
-                                                  fontSize: 14.0,
-                                                  color: Color(0xff999999)),
-                                            ),
-                                            Space(
-                                              height: 16.0,
-                                            ),
-                                            Padding(
-                                              padding: EdgeInsets.symmetric(
-                                                  vertical: 10.0),
-                                              child: ClipRRect(
-                                                borderRadius:
-                                                    BorderRadius.circular(12),
-                                                child: Container(
-                                                  width: 183.0,
-                                                  child: CustomPaint(
-                                                    painter: _ProgressBar(
-                                                      ((relateAchievements[
-                                                                          value]
-                                                                      ?.conditionProgress ??
-                                                                  0) >
-                                                              0)
-                                                          ? relateAchievements[
-                                                                      value]
-                                                                  .conditionProgress /
-                                                              relateAchievements[
-                                                                      value]
-                                                                  .conditionCount
-                                                          : 0,
-                                                    ),
-                                                    child: Container(
-                                                      height: 8,
+//                                              Space(
+//                                                height: 8.0,
+//                                              ),
+                                              Padding(
+                                                padding: EdgeInsets.symmetric(
+                                                    vertical: 10.0),
+                                                child: ClipRRect(
+                                                  borderRadius:
+                                                      BorderRadius.circular(12),
+                                                  child: Container(
+                                                    width: 183.0,
+                                                    child: CustomPaint(
+                                                      painter: _ProgressBar(
+                                                        ((relateAchievements[
+                                                                            value]
+                                                                        ?.conditionProgress ??
+                                                                    0) >
+                                                                0)
+                                                            ? relateAchievements[
+                                                                        value]
+                                                                    .conditionProgress /
+                                                                relateAchievements[
+                                                                        value]
+                                                                    .conditionCount
+                                                            : 0,
+                                                      ),
+                                                      child: Container(
+                                                        height: 8,
+                                                      ),
                                                     ),
                                                   ),
                                                 ),
                                               ),
-                                            ),
-                                            Space(
-                                              height: 5.0,
-                                            ),
-                                            Text(
-                                                "${relateAchievements[value].conditionProgress} / ${relateAchievements[value].conditionCount}")
-                                          ],
-                                        );
-                                } else {
-                                  return Container();
-                                }
-                              }),
+//                                              Space(
+//                                                height: 5.0,
+//                                              ),
+                                              Text(
+                                                  "${relateAchievements[value].conditionProgress} / ${relateAchievements[value].conditionCount}")
+                                            ],
+                                          );
+                                  } else {
+                                    return Container();
+                                  }
+                                }),
+                          ),
                         ),
-                      ),
-                    ],
-                  )
-                ],
-              ),
-            ],
+                      ],
+                    )
+                  ],
+                ),
+              ],
+            ),
           ),
         );
       });

+ 44 - 41
lib/pages/my/achievement_page.dart

@@ -71,7 +71,7 @@ class _PageState extends State<AchievementPage> {
           height: double.infinity,
         ),
         Positioned(
-          top: 0,
+          top: 10,
           left: 0,
           right: 0,
           child: Image.asset(
@@ -83,25 +83,24 @@ class _PageState extends State<AchievementPage> {
           buildSliverAppBar(
             context,
             "我的成就",
-            backgroundColor: _brightness == 0
-                ? Color(0x00000000)
-                : Color(0xffffffff),
+            backgroundColor:
+                _brightness == 0 ? Color(0x00000000) : Color(0xffffffff),
             brightness: _brightness == 0 ? 1 : 0,
             textStyle: _brightness == 0
                 ? TextStyle(
-                fontWeight: FontWeight.w600,
-                fontSize: 18.0,
-                color: Color(0xffffffff))
+                    fontWeight: FontWeight.w600,
+                    fontSize: 18.0,
+                    color: Color(0xffffffff))
                 : TextStyle(
-                fontWeight: FontWeight.w600,
-                fontSize: 18.0,
-                color: Color(0xff333333)),
+                    fontWeight: FontWeight.w600,
+                    fontSize: 18.0,
+                    color: Color(0xff333333)),
             whiteBackButton: _brightness == 0 ? true : false,
             canBack: _brightness == 0 ? false : true,
           ),
           SliverToBoxAdapter(
               child: Padding(
-            padding: EdgeInsets.symmetric(vertical: 16.0, horizontal: 13.0),
+            padding: EdgeInsets.symmetric(vertical: 0.0, horizontal: 13.0),
             child: Column(
               children: <Widget>[
                 Row(
@@ -113,7 +112,7 @@ class _PageState extends State<AchievementPage> {
                           style: Theme.of(context)
                               .textTheme
                               .bodyText2
-                              .copyWith(color: Color(0xff666666)),
+                              .copyWith(color: Color(0xffffffff)),
                           children: <TextSpan>[
                             TextSpan(
                                 text: "${widget.data.getAchievementCount}",
@@ -128,7 +127,7 @@ class _PageState extends State<AchievementPage> {
                                 style: Theme.of(context)
                                     .textTheme
                                     .bodyText2
-                                    .copyWith(color: Color(0xff666666)))
+                                    .copyWith(color: Color(0xffffffff)))
                           ],
                         ),
                       )
@@ -159,31 +158,36 @@ class _PageState extends State<AchievementPage> {
                       style: Theme.of(context)
                           .textTheme
                           .bodyText1
-                          .copyWith(fontSize: 11.0)),
+                          .copyWith(fontSize: 11.0, color: Color(0xffffffff))),
                 ),
+                Space(
+                  height: 16.0,
+                )
               ],
             ),
           )),
           SliverToBoxAdapter(
             child: BoxWidget(
+              paddingAll: false,
               body: Column(
                 children: <Widget>[
                   Padding(
-                    padding: const EdgeInsets.symmetric(vertical: 8.0),
+                    padding: const EdgeInsets.only(top: 16.0,bottom: 8.0),
                     child: Row(
                       children: <Widget>[
                         Expanded(
-                          child: Divider(
-                            endIndent: 10.0,
-                          ),
-                        ),
+                            child: Image.asset(
+                          "lib/assets/img/mine_img_lineleft.png",
+                          height: 9.0,
+                        )),
                         Text(
                           "已获得成就",
                           style: Theme.of(context).textTheme.bodyText1,
                         ),
                         Expanded(
-                            child: Divider(
-                          indent: 10.0,
+                            child: Image.asset(
+                          "lib/assets/img/mine_img_lineright.png",
+                          height: 9.0,
                         )),
                       ],
                     ),
@@ -206,22 +210,18 @@ class _PageState extends State<AchievementPage> {
                         )),
                   if (widget.data.getAchievementList.length > 0)
                     Padding(
-                      padding: EdgeInsets.symmetric(vertical: 16.0),
+                      padding: EdgeInsets.fromLTRB(0.0, 16.0, 0.0, 0.0),
                       child: StaggeredGridView.countBuilder(
                         padding: EdgeInsets.zero,
                         shrinkWrap: true,
                         physics: NeverScrollableScrollPhysics(),
                         crossAxisCount: 3,
-                        itemCount: widget.data.getAchievementList.length > 6
-                            ? widget.data.getAchievementList
-                                .sublist(0, 6)
-                                .length
-                            : widget.data.getAchievementList.length,
+                        itemCount: widget.data.getAchievementList.length * 2,
                         itemBuilder: (BuildContext context, int index) =>
-                            achievementWidget(
-                                context, widget.data.getAchievementList[index],
+                            achievementWidget(context,
+                                widget.data.getAchievementList[index % 2],
                                 isRadius: false, w: 84, showCount: true),
-                        mainAxisSpacing: 18.0,
+                        mainAxisSpacing: 20.0,
                         crossAxisSpacing: 12.0,
                         staggeredTileBuilder: (int index) =>
                             StaggeredTile.fit(1),
@@ -255,19 +255,22 @@ class _PageState extends State<AchievementPage> {
               body: Column(
                 children: <Widget>[
                   Padding(
-                    padding: EdgeInsets.only(top: 31.0),
+                    padding: const EdgeInsets.symmetric(vertical: 8.0),
                     child: Row(
                       children: <Widget>[
                         Expanded(
-                          child: Divider(
-                            endIndent: 10.0,
-                          ),
+                            child: Image.asset(
+                          "lib/assets/img/mine_img_lineleft.png",
+                          height: 9.0,
+                        )),
+                        Text(
+                          "未获得成就",
+                          style: Theme.of(context).textTheme.bodyText1,
                         ),
-                        Text("未获得成就",
-                            style: Theme.of(context).textTheme.bodyText1),
                         Expanded(
-                            child: Divider(
-                          indent: 10.0,
+                            child: Image.asset(
+                          "lib/assets/img/mine_img_lineright.png",
+                          height: 9.0,
                         )),
                       ],
                     ),
@@ -346,7 +349,8 @@ ListView getList(data) {
                           Text("距离下一级还需:",
                               style: Theme.of(context).textTheme.subtitle1),
                           Expanded(
-                            child: Text("${item.conditionCount - item.conditionProgress}${item.conditionMeasure}",
+                            child: Text(
+                                "${item.conditionCount - item.conditionProgress}${item.conditionMeasure}",
                                 style: Theme.of(context).textTheme.bodyText2),
                           ),
                         ],
@@ -382,8 +386,7 @@ ListView getList(data) {
               child: Container(
                 child: CustomPaint(
                   painter: _ProgressBar(
-                      item.conditionProgress /
-                          (item.conditionCount),
+                      item.conditionProgress / (item.conditionCount),
                       Color(0xfff1f1f1)),
                   child: Container(
                     height: 8,

+ 38 - 29
lib/pages/my/level_page.dart

@@ -42,39 +42,44 @@ class _PageState extends State<LevelPage> with InjectLoginApi {
     super.initState();
     _model = SimpleModel(
         (page) async => [(await loginApi.getAchievementInfo()).data]);
-    _controller = ScrollController()
-      ..addListener(() {
-//        print(
-//            "[_controller.position.pixels] -------------------------- ${_controller.position.pixels}");
-        print("[_brightness]--------------------------$_brightness");
-        if (_controller.position.pixels >= 70) {
-          if (_brightness == 0) {
-            setState(() {
-              _brightness = 1;
-            });
-          }
-        } else {
-          if (_brightness == 1) {
-            setState(() {
-              _brightness = 0;
-            });
-          }
-        }
-      });
+//    _controller = ScrollController()
+//      ..addListener(() {
+////        print(
+////            "[_controller.position.pixels] -------------------------- ${_controller.position.pixels}");
+//        print("[_brightness]--------------------------$_brightness");
+//        if (_controller.position.pixels >= 70) {
+//          if (_brightness == 0) {
+//            setState(() {
+//              _brightness = 1;
+//            });
+//          }
+//        } else {
+//          if (_brightness == 1) {
+//            setState(() {
+//              _brightness = 0;
+//            });
+//          }
+//        }
+//      });
   }
 
   @override
   Widget build(BuildContext context) {
     return Scaffold(
+      backgroundColor: Color(0xff241D19),
         body: Stack(
       children: <Widget>[
-        Positioned.fill(
+        Positioned(
+            top: -100,
+            left: 0,
             child: Container(
-          decoration: BoxDecoration(
-              image: DecorationImage(
-                  image: AssetImage("lib/assets/img/mylevel_bg.png"),
-                  fit: BoxFit.cover)),
-        )),
+              width: MediaQuery.of(context).size.width,
+              height: 373.0,
+              decoration: BoxDecoration(
+                  image: DecorationImage(
+                      image: AssetImage("lib/assets/img/mylevel_bg.png"),
+                      fit: BoxFit.contain)),
+            )),
         ProviderWidget<SimpleModel>(
           model: _model,
           onModelReady: (model) => model.initData(),
@@ -173,10 +178,11 @@ class _PageState extends State<LevelPage> with InjectLoginApi {
                                 padding: const EdgeInsets.only(
                                     top: 16.0, bottom: 8.0),
                                 child: Container(
-                                    width: 90.0,
-                                    height: 90.0,
+
                                     child: CachedNetworkImage(
-                                        imageUrl: _data.level.logo ?? ""))),
+                                      width: 130.0,
+                                      height: 130.0,
+                                        imageUrl: _data.level.logo ?? "",fit: BoxFit.contain,))),
                             Text(
                               "Lv.${_data.level.level}",
                               style: Theme.of(context).textTheme.headline3,
@@ -251,6 +257,7 @@ class _PageState extends State<LevelPage> with InjectLoginApi {
                                 ),
                               ],
                             ),
+                            Space(height: 10.0,),
                           ],
                         ))),
                       if (model.isIdle && _data != null)
@@ -258,6 +265,7 @@ class _PageState extends State<LevelPage> with InjectLoginApi {
                           child: BoxWidget(
                             body: Column(
                               children: <Widget>[
+
                                 Row(
                                   mainAxisAlignment:
                                       MainAxisAlignment.spaceBetween,
@@ -292,6 +300,7 @@ class _PageState extends State<LevelPage> with InjectLoginApi {
                                       ),
                                   ],
                                 ),
+                                Space(height: 10.0,),
                                 if (_data.getAchievementList.length == 0)
                                   Padding(
                                       padding: const EdgeInsets.all(30.0),
@@ -314,7 +323,7 @@ class _PageState extends State<LevelPage> with InjectLoginApi {
                                 if (_data.getAchievementList.length > 0)
                                   Padding(
                                     padding:
-                                        EdgeInsets.symmetric(vertical: 16.0),
+                                        EdgeInsets.only(top: 16.0,bottom: 0.0),
                                     child: StaggeredGridView.countBuilder(
                                       padding: EdgeInsets.zero,
                                       shrinkWrap: true,

+ 7 - 3
lib/pages/social/new_social_index_page.dart

@@ -172,13 +172,15 @@ class _PageState extends ViewStateLifecycle<NewSocialIndexPage, SocialDetailMode
   Widget _buildDrawerButtonItem(Forum data, int index, ValueNotifier<int> targetIndex, String type) {
     return InkWell(
       child: Container(
+//        height: 35.0,
         decoration: BoxDecoration(
             color: index == targetIndex.value ? Theme.of(context).accentColor : Colors.white,
             borderRadius: BorderRadius.all(Radius.circular(20.0)),
-            border: Border.all(color: index == targetIndex.value ? Colors.white : Color(0xff999999))),
-        padding: EdgeInsets.symmetric(vertical: 8.0, horizontal: 25.0),
+            border: Border.all(color: index == targetIndex.value ? Colors.white : Theme.of(context).dividerTheme.color)),
+        padding: EdgeInsets.symmetric(vertical: 8.0,horizontal: 25.0),
         child: Text(
           data.gameName,
+          strutStyle: StrutStyle(forceStrutHeight: true),
           style: TextStyle(fontSize: 14.0, color: index == targetIndex.value ? Colors.white : Color(0xff999999)),
         ),
       ),
@@ -236,6 +238,7 @@ class _PageState extends ViewStateLifecycle<NewSocialIndexPage, SocialDetailMode
       valueListenable: targetIndex,
       builder: (BuildContext context, int value, Widget child) => Wrap(
         alignment: WrapAlignment.start,
+        crossAxisAlignment: WrapCrossAlignment.start,
         spacing: 8.0,
         runSpacing: 16.0,
         children: list != null
@@ -275,13 +278,14 @@ class _PageState extends ViewStateLifecycle<NewSocialIndexPage, SocialDetailMode
   Widget _buildFilterButton(String name, ValueNotifier<int> index, String type) {
     return InkWell(
       child: Container(
-        padding: EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0),
+        padding: EdgeInsets.symmetric(vertical: 6.0, horizontal: 16.0),
         decoration: BoxDecoration(border: Border.all(color: Theme.of(context).accentColor), borderRadius: BorderRadius.all(Radius.circular(44.0))),
         child: Row(
           crossAxisAlignment: CrossAxisAlignment.center,
           children: <Widget>[
             Text(
               "$name",
+              strutStyle: StrutStyle(forceStrutHeight: true),
               style: TextStyle(color: Theme.of(context).accentColor, fontSize: 12.0),
             ),
             Space(

+ 24 - 14
lib/pages/social/post_detail_page.dart

@@ -320,21 +320,31 @@ class _PageState extends ViewStateLifecycle<PostDetailPage, PostDetailModel> wit
                                   style: Theme.of(context).textTheme.subtitle1.copyWith(fontWeight: FontWeight.w600),
                                 ),
                                 if (post?.isOfficial == "1")
+//                                  Container(
+//                                      decoration: BoxDecoration(
+//                                          color: Colors.white,
+//                                          borderRadius: BorderRadius.all(Radius.circular(2)),
+//                                          border: Border.all(
+//                                            color: Theme.of(context).accentColor,
+//                                            width: .5,
+//                                          )),
+//                                      padding: EdgeInsets.fromLTRB(2, 0, 2, 1),
+//                                      margin: EdgeInsets.fromLTRB(12.0, 0, 12, 0),
+//                                      child: Text(
+//                                        "官方认证",
+//                                        strutStyle: fixedLine,
+//                                        style: Theme.of(context).textTheme.subtitle2.copyWith(color: Theme.of(context).accentColor, fontSize: 11),
+//                                      ))
                                   Container(
-                                      decoration: BoxDecoration(
-                                          color: Colors.white,
-                                          borderRadius: BorderRadius.all(Radius.circular(2)),
-                                          border: Border.all(
-                                            color: Theme.of(context).accentColor,
-                                            width: .5,
-                                          )),
-                                      padding: EdgeInsets.fromLTRB(2, 0, 2, 1),
-                                      margin: EdgeInsets.fromLTRB(12.0, 0, 12, 0),
-                                      child: Text(
-                                        "官方认证",
-                                        strutStyle: fixedLine,
-                                        style: Theme.of(context).textTheme.subtitle2.copyWith(color: Theme.of(context).accentColor, fontSize: 11),
-                                      ))
+                                    margin: EdgeInsets.only(left: 4.0),
+                                    width: 27.0,
+                                    height: 14.0,
+                                    decoration: BoxDecoration(
+                                      image: DecorationImage(
+                                          image: AssetImage("lib/assets/img/bbs_icon_official.png")
+                                      ),
+                                    ),
+                                  ),
                               ],
                             ),
                             Space(

+ 23 - 16
lib/pages/social/post_page.dart

@@ -423,12 +423,12 @@ class _PageState extends State<PostPage> {
   Widget _labelItem(String title){
     if(title == null) return Container();
     return Container(
-      padding: EdgeInsets.symmetric(vertical: 8.0,horizontal: 16.0),
+      padding: EdgeInsets.symmetric(vertical: 6.0,horizontal: 16.0),
       decoration: BoxDecoration(border: Border.all(color: Theme.of(context).accentColor), borderRadius: BorderRadius.all(Radius.circular(44.0))),
       child: Row(
         crossAxisAlignment: CrossAxisAlignment.center,
         children: <Widget>[
-          Text(title,style: TextStyle(color: Theme.of(context).accentColor,fontSize: 12.0),),
+          Text(title,style: TextStyle(color: Theme.of(context).accentColor,fontSize: 12.0),strutStyle: StrutStyle(forceStrutHeight: true),),
           Space(width: 5.0,),
           Image.asset("lib/assets/img/btn_close_yellow.png",width: 7.0,height: 7.0,)
         ],
@@ -454,6 +454,7 @@ class _PageState extends State<PostPage> {
 //            crossAxisAlignment: CrossAxisAlignment.center,
               children: <Widget>[
                 Text("添加游戏标签",style: TextStyle(fontSize: 12.0,color: Color(0xff666666)),),
+                Divider(height: 2.0,),
                 Space(
                   width: 4.0,
                 ),
@@ -463,19 +464,24 @@ class _PageState extends State<PostPage> {
           ),
           onTap: () async {
             bool flag = await showDialog(context: context,builder: (context) => CustomAlertDialog(title: "添加游戏标签",
+              isLine: true,
               ok: () => Navigator.of(context).pop(true),
-              child: ValueListenableBuilder(
-              valueListenable: labelIndex,
-              builder: (context,index,child) => Wrap(
-                  runSpacing: 12.0,
-                  spacing: 8.0,
-                  children: widget.forums.asMap()
-                      .entries
-                      .map((e) => _buildDrawerButtonItem(
-                      e.value, e.key, labelIndex))
-                      .toList()
-              ),
-            ),));
+              child: Container(
+                padding: EdgeInsets.only(left: 20.0),
+                width: double.infinity,
+                child: ValueListenableBuilder(
+                  valueListenable: labelIndex,
+                  builder: (context,index,child) => Wrap(
+                      runSpacing: 12.0,
+                      spacing: 8.0,
+                      children: widget.forums.asMap()
+                          .entries
+                          .map((e) => _buildDrawerButtonItem(
+                          e.value, e.key, labelIndex))
+                          .toList()
+                  ),
+                ),
+              ),));
 //            print("${labelIndex}==========================================");
             if(flag){
               selectLabel = widget.forums[labelIndex.value];
@@ -500,10 +506,11 @@ class _PageState extends State<PostPage> {
             border: Border.all(
                 color: index == targetIndex.value
                     ? Colors.white
-                    : Color(0xff999999))),
-        padding: EdgeInsets.symmetric(vertical: 8.0, horizontal: 25.0),
+                    : Theme.of(context).dividerTheme.color)),
+        padding: EdgeInsets.symmetric(vertical: 8.0, horizontal: 20.0),
         child: Text(
           data.gameName,
+          strutStyle: StrutStyle(forceStrutHeight: true),
           style: TextStyle(
               fontSize: 14.0,
               color: index == targetIndex.value

+ 55 - 46
lib/pages/social/post_widget.dart

@@ -557,16 +557,41 @@ class _PostWidgetState extends State<PostWidget> with InjectApi {
                       child: _postWidget(post.quoteSubject),
                     ),
                   ),
-                if(post.gameName != null && post.gameName != "" )
-                  Container(
-                    padding: EdgeInsets.fromLTRB(12.0, 12.0, 12.0, 0.0),
-                    alignment: Alignment.centerLeft,
-                    child: Container(
-                      padding: EdgeInsets.symmetric(vertical: 4.0,horizontal: 12.0),
-                      decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(12.0)),color: Color(0xffF1F1F1)),
-                      child: Text(post.gameName,style: TextStyle(color: Color(0xff999999),fontSize: 12.0),),
-                    ),
-                  ),
+                Row(
+                  children: <Widget>[
+//                    Expanded(child:Text('${post.toJson()}')),
+                    if(post.gameName != null && post.gameName != "" )
+                      Container(
+                        padding: EdgeInsets.fromLTRB(12.0, 12.0, 6.0, 0.0),
+                        alignment: Alignment.centerLeft,
+                        child: Container(
+                          padding: EdgeInsets.only(left: 6.0,right: 6.0,bottom: 2.0,top: 1.0),
+                          decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(4.0)),color: Color(0xffF1F1F1)),
+                          child: Text(post.gameName,style: TextStyle(color: Color(0xff999999),fontSize: 12.0),strutStyle: StrutStyle(forceStrutHeight: true),),
+                        ),
+                      ),
+                    if (widget.post.isUserTop == '1')
+                      Padding(
+                        padding: post.gameName != null && post.gameName != "" ? EdgeInsets.fromLTRB(0.0, 12.0, 12.0, 0.0) : EdgeInsets.fromLTRB(12.0, 12.0, 12.0, 0.0) ,
+                        child: Container(
+                          child: Text(
+                            "已置顶",
+                            style: TextStyle(fontSize: 12 , color: Color(0xff5498FF)),
+                            strutStyle: fixedLine,
+                          ),
+                          padding: EdgeInsets.only(left: 6.0,right: 6.0,bottom: 2.0,top: 1.0),
+                          decoration: BoxDecoration(
+                            borderRadius: BorderRadius.circular(2),
+                            border: Border.all(
+                              color: Color(0xff5498FF),
+                              width: .5,
+                            ),
+                          ),
+                        ),
+                      )
+                  ],
+                ),
+
                 if(post.quoteData != null)
                   GestureDetector(
                     behavior: HitTestBehavior.opaque,
@@ -583,7 +608,7 @@ class _PostWidgetState extends State<PostWidget> with InjectApi {
                     ),
                   ),
                 Space(
-                  height: 10,
+                  height: 15,
                 ),
                 Row(
                   children: <Widget>[
@@ -595,7 +620,7 @@ class _PostWidgetState extends State<PostWidget> with InjectApi {
                             menuShareBottom(context,"social",post: post);
                         },
                         child: Container(
-                          padding: const EdgeInsets.all(5.0),
+                          padding: const EdgeInsets.symmetric(horizontal: 5.0),
                           child: Center(
                             child: Row(
                               mainAxisSize: MainAxisSize.min,
@@ -624,7 +649,7 @@ class _PostWidgetState extends State<PostWidget> with InjectApi {
                           }
                         },
                         child: Container(
-                          padding: const EdgeInsets.all(5.0),
+                          padding: const EdgeInsets.symmetric(horizontal: 5.0),
                           child: Center(
                             child: Row(
                               mainAxisSize: MainAxisSize.min,
@@ -654,7 +679,7 @@ class _PostWidgetState extends State<PostWidget> with InjectApi {
                           });
                         },
                         child: Container(
-                          padding: const EdgeInsets.all(5.0),
+                          padding: const EdgeInsets.symmetric(horizontal: 5.0),
                           child: Center(
                             child: SizedBox(
                               height: 19,
@@ -686,38 +711,22 @@ class _PostWidgetState extends State<PostWidget> with InjectApi {
             ),
           ),
         ),
-        if (widget.showForum)
-          Padding(
-            padding: const EdgeInsets.only(bottom: 12.0, left: 12.0),
-            child: Row(
-              children: <Widget>[
-//                Container(
-//                  child: Text("来自${widget.post.forumName}", style: Theme.of(context).textTheme.bodyText1),
-//                  padding: EdgeInsets.fromLTRB(8, 0, 8, 1),
-//                  decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.all(Radius.circular(20)), color: Color(0xfff1f1f1)),
-//                ),
-//                Space(
-//                  width: 10,
-//                ),
-                if (widget.post.isUserTop == '1')
-                  Container(
-                    child: Text(
-                      "已置顶",
-                      style: TextStyle(fontSize: 11, color: Color(0xff5498FF)),
-                      strutStyle: fixedLine,
-                    ),
-                    padding: EdgeInsets.symmetric(horizontal: 4),
-                    decoration: BoxDecoration(
-                      borderRadius: BorderRadius.circular(2),
-                      border: Border.all(
-                        color: Color(0xff5498FF),
-                        width: .5,
-                      ),
-                    ),
-                  ),
-              ],
-            ),
-          ),
+//        if (widget.showForum)
+//          Padding(
+//            padding: const EdgeInsets.only(bottom: 12.0, left: 12.0),
+//            child: Row(
+//              children: <Widget>[
+////                Container(
+////                  child: Text("来自${widget.post.forumName}", style: Theme.of(context).textTheme.bodyText1),
+////                  padding: EdgeInsets.fromLTRB(8, 0, 8, 1),
+////                  decoration: BoxDecoration(shape: BoxShape.rectangle, borderRadius: BorderRadius.all(Radius.circular(20)), color: Color(0xfff1f1f1)),
+////                ),
+////                Space(
+////                  width: 10,
+////                ),
+//              ],
+//            ),
+//          ),
         Divider(
           height: 1,
         ),

+ 17 - 13
lib/widgets/appbar.dart

@@ -2,25 +2,28 @@ import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:sport/widgets/image.dart';
 
+import 'misc.dart';
+
 const titleStyle = TextStyle(
     fontWeight: FontWeight.w600, fontSize: 18.0, color: Color(0xff333333));
 
 Widget buildSliverAppBar(BuildContext context, String title,
     {List<Widget> actions,
-      backgroundColor = Colors.white,
-      paddingLeading = true,
-      useClose = false,
-      canBack = true,
-      innerBoxIsScrolled = false,
-      height = 110.0,
-      brightness = -1,
-      textStyle = titleStyle,
-      whiteBackButton = false,
-      pinned = true
-    }) {
+    backgroundColor = Colors.white,
+    paddingLeading = true,
+    useClose = false,
+    canBack = true,
+    innerBoxIsScrolled = false,
+    height = 110.0,
+    brightness = -1,
+    textStyle = titleStyle,
+    whiteBackButton = false,
+    pinned = true}) {
   return SliverAppBar(
       pinned: pinned,
-      brightness: brightness ==-1? null :brightness == 1 ? Brightness.dark : Brightness.light,
+      brightness: brightness == -1
+          ? null
+          : brightness == 1 ? Brightness.dark : Brightness.light,
       expandedHeight: height,
       backgroundColor: backgroundColor,
       forceElevated: innerBoxIsScrolled,
@@ -68,10 +71,11 @@ Widget buildFlexibleSpace(
       title: paddingLeading
           ? Padding(
               padding: EdgeInsets.only(
-                  left: (settings.maxExtent - box.biggest.height) / 3 * 2),
+                  left: (settings.maxExtent - box.biggest.height) / 3 * 1.6,bottom: 1.0),
               child: Text(
                 title,
                 style: textStyle,
+//                strutStyle:fixedLine,
               ),
             )
           : Text(

+ 1 - 1
lib/widgets/button_primary.dart

@@ -79,7 +79,7 @@ class PrimaryButton extends StatelessWidget {
                 style: TextStyle(
                     color: Colors.white,
                     fontSize:
-                        height > 40 ? callback == null ? 14.0 : 16.0 : 14.0,
+                        height >= 40 ? callback == null ? 14.0 : 16.0 : 14.0,
                     fontWeight: bold ? FontWeight.w600 : FontWeight.normal),
                 strutStyle: fixedLine,
               )

+ 36 - 9
lib/widgets/dialog/alert_dialog.dart

@@ -20,6 +20,7 @@ class CustomAlertDialog extends StatelessWidget {
   final String textOk;
   final Function ok;
   final bool addClose;
+  final bool isLine;
 
   CustomAlertDialog({
     this.title,
@@ -28,6 +29,7 @@ class CustomAlertDialog extends StatelessWidget {
     this.textOk = "确定",
     this.ok,
     this.addClose = false,
+    this.isLine = false,
   });
 
   @override
@@ -59,16 +61,41 @@ class CustomAlertDialog extends StatelessWidget {
                   Stack(
                     children: <Widget>[
                       Padding(
-                        padding: EdgeInsets.fromLTRB(
-                            0, child != null ? addClose ? 0 : 16.0 : 32.0, 0, 20),
-                        child: Text(
-                          title,
-                          style: Theme.of(context).textTheme.headline3,
-                          strutStyle: fixedLine,
-                        ),
-                      )
+                          padding: EdgeInsets.fromLTRB(
+                              0,
+                              child != null ? addClose ? 0 : 16.0 : 32.0,
+                              0,
+                              isLine ? 15.0 : 20),
+                          child: Column(
+                            children: <Widget>[
+                              isLine
+                                  ? Padding(
+                                      child: Text(
+                                        title,
+                                        style: Theme.of(context)
+                                            .textTheme
+                                            .headline3,
+                                        strutStyle: fixedLine,
+                                      ),
+                                      padding: EdgeInsets.only(
+                                          top: 5.0, bottom: 8.0),
+                                    )
+                                  : Text(
+                                      title,
+                                      style:
+                                          Theme.of(context).textTheme.headline3,
+                                      strutStyle: fixedLine,
+                                    ),
+                              if (isLine)
+                                Divider(
+                                  endIndent: 20.0,
+                                  indent: 20.0,
+                                )
+                            ],
+                          ))
                     ],
                   ),
+//
                 if (child != null)
                   ConstrainedBox(
                       constraints: BoxConstraints(
@@ -77,7 +104,7 @@ class CustomAlertDialog extends StatelessWidget {
                         child: child,
                       )),
                 Padding(
-                  padding: const EdgeInsets.all(16.0),
+                  padding: const EdgeInsets.fromLTRB(16.0, 20.0, 16.0, 16.0),
                   child: Row(
                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
                     children: <Widget>[

+ 1 - 1
lib/widgets/dialog/search_device.dart

@@ -280,7 +280,7 @@ class _FindDevicesScreen extends State<FindDevicesScreen> with SingleTickerProvi
                                       ),
                                     )
                                   : Padding(
-                                      padding: const EdgeInsets.all(30.0),
+                                      padding: const EdgeInsets.symmetric(horizontal: 30.0,vertical: 65.0),
                                       child: Center(
                                         child: Column(
                                           children: <Widget>[