Przeglądaj źródła

fix:v1.3版本的bug

Primroses 3 lat temu
rodzic
commit
3b518e9365

+ 1 - 1
lib/pages/my/achievement_page.dart

@@ -383,7 +383,7 @@ ListView getList(data) {
                 child: CustomPaint(
                   painter: _ProgressBar(
                       item.conditionProgress /
-                          (item.conditionCount + item.conditionProgress),
+                          (item.conditionCount),
                       Color(0xfff1f1f1)),
                   child: Container(
                     height: 8,

+ 8 - 3
lib/pages/social/chat_page.dart

@@ -529,9 +529,14 @@ class _ChatPageState extends State<ChatPage>
   Widget build(BuildContext context) {
     return Scaffold(
         appBar: AppBar(
-          title: Text(
-            "${widget.user.name}",
-            style: titleStyle,
+          title: InkWell(
+            child: Text(
+              "${widget.user.name}",
+              style: titleStyle,
+            ),
+            onTap: (){
+              NavigatorUtil.goPage(context, (context) => UserDetailPage(PostUser.fromJson({"id":"${widget.user.id}"})));
+            },
           ),
           leading: buildBackButton(context),
         ),

+ 3 - 3
lib/pages/social/post_share_page.dart

@@ -139,12 +139,12 @@ class _PostShareFriendsPageState extends State<PostShareFriendsPage>
         centerTitle: false,
         titleSpacing: 0,
       ),
-      body: FutureBuilder<RespList<UserFriend>>(
-        future: api.userFriends(),
+      body: FutureBuilder<RespListTest<UserFriend>>(
+        future: api.userFriendsTest(),
         builder: (_, snapshot) {
           if (snapshot.connectionState != ConnectionState.done)
             return RequestLoadingWidget();
-          var list = snapshot.data?.results ?? [];
+          var list = snapshot.data?.results?.list ?? [];
           return ListView.separated(
             itemBuilder: (BuildContext context, int index) => ListTile(
               leading: CircleAvatar(

+ 10 - 10
lib/pages/social/post_widget.dart

@@ -557,6 +557,16 @@ 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),),
+                    ),
+                  ),
                 if(post.quoteData != null)
                   GestureDetector(
                     behavior: HitTestBehavior.opaque,
@@ -708,16 +718,6 @@ class _PostWidgetState extends State<PostWidget> with InjectApi {
               ],
             ),
           ),
-        if(post.gameName != null && post.gameName != "" )
-        Container(
-            padding: EdgeInsets.fromLTRB(12.0, 0, 12.0, 16.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),),
-            ),
-          ),
         Divider(
           height: 1,
         ),

+ 51 - 38
lib/pages/social/user_friend_page.dart

@@ -1,6 +1,7 @@
 import 'package:azlistview/azlistview.dart';
 import 'package:cached_network_image/cached_network_image.dart';
-import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart';
+import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart' as extended;
+import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart' hide NestedScrollView;
 import 'package:flutter_easyrefresh/easy_refresh.dart';
 import 'package:sport/bean/login.dart';
@@ -61,7 +62,7 @@ class _PageState extends State<UserFriendPage> {
       length: 3,
       child: Scaffold(
         backgroundColor: Colors.white,
-        body: NestedScrollView(
+        body: extended.NestedScrollView(
           pinnedHeaderSliverHeightBuilder: () {
             return pinnedHeaderHeight;
           },
@@ -221,48 +222,56 @@ class _PageDetailState
               ? Column(
                   children: <Widget>[
                     _searchWidget(context),
-                    Space(
-                      height: 16.0,
-                    ),
+                    if (!isSeach)
+                      Space(
+                        height: 16.0,
+                      ),
                     isSeach
                         ? model.items.length > 0
                             ? Expanded(
-                                child: ListView.builder(
-                                  itemBuilder: (context, index) => ListTile(
-                                    leading: InkWell(
-                                      child: Container(
-                                        width: 44,
-                                        height: 44,
-                                        decoration: BoxDecoration(
-                                          shape: BoxShape.rectangle,
-                                          borderRadius:
+                                child:
+                                ListView.builder(
+                                  padding: EdgeInsets.zero,
+                                  itemBuilder: (context, index) => Column(
+                                    children: <Widget>[
+                                      ListTile(
+                                        leading: InkWell(
+                                          child: Container(
+                                            width: 44,
+                                            height: 44,
+                                            decoration: BoxDecoration(
+                                              shape: BoxShape.rectangle,
+                                              borderRadius:
                                               BorderRadius.circular(4.0),
-                                          image: DecorationImage(
-                                              image: CachedNetworkImageProvider(
-                                            model.items[index].user.avatar,
-                                          )),
-                                        ),
-                                      ),
-                                      onTap: () {
-                                        NavigatorUtil.goPage(
-                                            context,
-                                            (context) => UserDetailPage(
+                                              image: DecorationImage(
+                                                  image: CachedNetworkImageProvider(
+                                                    model.items[index].user.avatar,
+                                                  )),
+                                            ),
+                                          ),
+                                          onTap: () {
+                                            NavigatorUtil.goPage(
+                                                context,
+                                                    (context) => UserDetailPage(
                                                     PostUser.fromJson({
-                                                  "id":
+                                                      "id":
                                                       "${model.items[index].user.uid}"
-                                                })));
-                                      },
-                                    ),
-                                    title:
+                                                    })));
+                                          },
+                                        ),
+                                        title:
                                         Text("${model.items[index].user.name}"),
-                                    onTap: () {
-                                      NavigatorUtil.goPage(
-                                          context,
-                                          (context) => ChatPage(
-                                              UserInfo.fromJson(model
-                                                  .items[index].user
-                                                  .toJson())));
-                                    },
+                                        onTap: () {
+                                          NavigatorUtil.goPage(
+                                              context,
+                                                  (context) => ChatPage(
+                                                  UserInfo.fromJson(model
+                                                      .items[index].user
+                                                      .toJson())));
+                                        },
+                                      ),
+                                      Divider()
+                                    ],
                                   ),
                                   itemCount: model.items.length,
                                 ),
@@ -462,7 +471,11 @@ class _PageDetailState
                               )
                             : TextSpan(
                                 text: '通过扫码',
-                                style: Theme.of(context).textTheme.bodyText1,
+                                style: Theme.of(context)
+                                    .textTheme
+                                    .bodyText1
+                                    .copyWith(
+                                        color: Theme.of(context).accentColor),
                               ),
                         TextSpan(
                           text: "关注了你",