瀏覽代碼

feat:v1.3的版本

Primroses 3 年之前
父節點
當前提交
84dbc2a69a

二進制
lib/assets/img/2.0x/bg_pop_achievement.png


二進制
lib/assets/img/bg1_pop_achievement.png


二進制
lib/assets/img/bg_pop_achievement.png


二進制
lib/assets/img/chat.png


二進制
lib/assets/img/untrace.png


+ 3 - 0
lib/bean/post.dart

@@ -146,5 +146,8 @@ class Post {
   bool isFriend(){
     return followStatus == "friends" || followStatus == "followed";
   }
+  bool isMe(int userId){
+    return int.parse(this.userId)  == userId;
+  }
 }
 

+ 1 - 1
lib/pages/home/sport_detail_page.dart

@@ -154,7 +154,7 @@ class _PageState extends State<SportDetailPage> with TickerProviderStateMixin, I
                                   String hash;
                                   print("------------------------------------------------------------");
                                   await request(context, () async {
-                                    ShareInfo _info = (await api.getshareCreateSport("year",50.0)).data;
+                                    ShareInfo _info = (await api.getshareCreateSport("day",50.0)).data;
                                     hash = _info.hash;
                                     print("[hash:]---------------------------${_info.hash}");
                                   });

+ 3 - 3
lib/pages/my/feedback_page.dart

@@ -333,9 +333,9 @@ class _PageState extends State<FeedbackPage> with InjectLoginApi, InjectApi {
                           maxLines: 3,
                           maxLength: 200,
                           onChanged: (value) {
-                            // setState(() {
-                            _textFieldValue = value;
-                            // });
+                             setState(() {
+                              _textFieldValue = value;
+                             });
                           },
                           decoration: InputDecoration(
                               counterText: "", hintText: "提交你的反馈...", contentPadding: EdgeInsets.symmetric(vertical: 16.0), border: InputBorder.none),

+ 41 - 28
lib/pages/my/my_page.dart

@@ -15,6 +15,7 @@ import 'package:sport/utils/toast.dart';
 import 'package:sport/widgets/image.dart';
 import 'package:sport/widgets/list_tile.dart';
 import 'package:sport/widgets/space.dart';
+import 'package:sport/widgets/dialog/search_device.dart';
 
 class MyPage extends StatefulWidget {
   @override
@@ -90,7 +91,7 @@ class _MyPageState extends State<MyPage> with InjectApi {
                                           mainAxisAlignment: MainAxisAlignment.center,
                                           crossAxisAlignment: CrossAxisAlignment.start,
                                           children: <Widget>[
-                                            Text(model.user.name ?? "", style: TextStyle(color: Color(0xff333333), fontSize: 18)),
+                                            Text(model.user.name ?? "", style: TextStyle(color: Color(0xff333333), fontSize: 18,fontWeight: FontWeight.bold)),
                                             Space(
                                               height: 7,
                                             ),
@@ -148,16 +149,28 @@ class _MyPageState extends State<MyPage> with InjectApi {
                             ),
                             onTap:() => NavigatorUtil.go(context, Routes.userInfo),
                           ),
-                          ListTile(
-                            leading: Padding(padding: EdgeInsets.only(bottom: 10, top: 5), child: Image.asset("lib/assets/img/mine_image_shoe.png")),
-                            title: Padding(
-                                padding: EdgeInsets.fromLTRB(12.0, 0, 12.0, 10),
-                                child: Selector<Bluetooth, BluetoothDevice>(
-                                  selector: (_, bluetooth) => bluetooth.device,
-                                  builder: (_, device, ___) {
-                                    return device == null
-                                        ? Container()
-                                        : ValueListenableBuilder(
+                          Selector<Bluetooth, BluetoothDevice>(
+                            selector: (_, bluetooth) => bluetooth.device,
+                            builder: (_, device, ___) {
+                              return device == null
+                                  ? ListTile(
+                                title: Row(
+                                  mainAxisAlignment:MainAxisAlignment.spaceBetween,
+                                  children: <Widget>[
+                                    Text("暂无连接设备",style: TextStyle(color: Color(0xff999999),fontSize: 16),),
+                                    Text("前往连接",style: TextStyle(color: Color(0xff999999),fontSize: 14),)
+                                  ],
+                                ),
+                                contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
+                                trailing: arrowRight5(),
+                                onTap: () => showDialog(context: context, child: SearchDeviceDialog())
+                              )
+                                  : ListTile(
+                                leading: Padding(padding: EdgeInsets.only(bottom: 10, top: 5), child: Image.asset("lib/assets/img/mine_image_shoe.png")),
+                                title: Padding(
+                                    padding: EdgeInsets.fromLTRB(0, 0, 12.0, 10),
+                                    child:
+                                    ValueListenableBuilder(
                                         valueListenable: Provider.of<Bluetooth>(context, listen: false).electricityNotifier,
                                         builder: (_, data, ___) => Column(
                                           crossAxisAlignment: CrossAxisAlignment.start,
@@ -182,34 +195,34 @@ class _MyPageState extends State<MyPage> with InjectApi {
                                               ),
                                             )
                                           ],
-                                        ));
-                                  },
-                                )),
-                            trailing: arrowRight5(),
-                            contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
-                            onTap: () {
-                              var device = Provider.of<Bluetooth>(context, listen: false).device;
-                              if (device == null) {
-                                ToastUtil.show("没连接设备!");
-                                return;
-                              }
-                              NavigatorUtil.go(context, Routes.deviceInfo);
+                                        ))),
+                                trailing: arrowRight5(),
+                                contentPadding: EdgeInsets.symmetric(horizontal: 0.0,vertical: 10.0),
+                                onTap: () {
+                                  var device = Provider.of<Bluetooth>(context, listen: false).device;
+                                  if (device == null) {
+                                    ToastUtil.show("没连接设备!");
+                                    return;
+                                  }
+                                  NavigatorUtil.go(context, Routes.deviceInfo);
+                                },
+                              );
                             },
                           ),
                           ListTile(
-                            title: Text("我的等级"),
+                            title: Text("我的等级",style: TextStyle(fontSize: 16),),
                             contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
                             trailing: arrowRight5(),
                             onTap: () => NavigatorUtil.go(context, Routes.level),
                           ),
                           ListTile(
-                            title: Text("我的运动"),
+                            title: Text("我的运动",style: TextStyle(fontSize: 16)),
                             contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
                             trailing: arrowRight5(),
                             onTap: () => NavigatorUtil.go(context, Routes.gamelistpage),
                           ),
                           ListTile(
-                            title: Text("我的帖子"),
+                            title: Text("我的帖子",style: TextStyle(fontSize: 16)),
                             contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
                             trailing: arrowRight5(),
                             onTap: () {
@@ -219,13 +232,13 @@ class _MyPageState extends State<MyPage> with InjectApi {
                             },
                           ),
                           ListTile(
-                            title: Text("用户反馈"),
+                            title: Text("用户反馈",style: TextStyle(fontSize: 16)),
                             contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
                             trailing: arrowRight5(),
                             onTap: () => NavigatorUtil.go(context, Routes.feedback),
                           ),
                           ListTile(
-                            title: Text("设置"),
+                            title: Text("设置",style: TextStyle(fontSize: 16)),
                             contentPadding: EdgeInsets.symmetric(horizontal: 0.0),
                             trailing: arrowRight5(),
                             onTap: () => NavigatorUtil.go(context, Routes.setting),

+ 6 - 6
lib/pages/my/user_info_page.dart

@@ -67,7 +67,7 @@ class _PageState extends State<UserInfoPage> with InjectLoginApi {
                   title: Row(
                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
                     children: <Widget>[
-                      Text("头像"),
+                      Text("头像",style: TextStyle(fontSize: 16.0),),
                       Consumer<UserModel>(
                         builder: (_, model, __) {
                           // 没有头像就为空...
@@ -103,7 +103,7 @@ class _PageState extends State<UserInfoPage> with InjectLoginApi {
                   title: Row(
                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
                     children: <Widget>[
-                      Text("用户名称"),
+                      Text("用户名称",style: TextStyle(fontSize: 16.0),),
                       Consumer<UserModel>(
                         builder: (_, model, __) {
                           return Text(model.user.name,
@@ -131,7 +131,7 @@ class _PageState extends State<UserInfoPage> with InjectLoginApi {
                   title: Row(
                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
                     children: <Widget>[
-                      Text("性别"),
+                      Text("性别",style: TextStyle(fontSize: 16.0),),
                       Consumer<UserModel>(
                         builder: (_, model, __) {
                           return Text(model.user.gender == 1 ? "男" : "女",
@@ -161,7 +161,7 @@ class _PageState extends State<UserInfoPage> with InjectLoginApi {
                   title: Row(
                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
                     children: <Widget>[
-                      Text("年龄"),
+                      Text("年龄",style: TextStyle(fontSize: 16.0),),
                       Consumer<UserModel>(
                         builder: (_, model, __) {
                           return Text(
@@ -197,7 +197,7 @@ class _PageState extends State<UserInfoPage> with InjectLoginApi {
                   title: Row(
                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
                     children: <Widget>[
-                      Text("城市"),
+                      Text("城市",style: TextStyle(fontSize: 16.0),),
                       Consumer<UserModel>(
                         builder: (_, model, __) {
                           String province = model.user.province;
@@ -271,7 +271,7 @@ class _PageState extends State<UserInfoPage> with InjectLoginApi {
                   title: Row(
                     mainAxisAlignment: MainAxisAlignment.spaceBetween,
                     children: <Widget>[
-                      Text("二维码名片"),
+                      Text("二维码名片",style: TextStyle(fontSize: 16.0),),
                       Container(
                         width: 22.0,
                         height: 22.0,

+ 6 - 6
lib/pages/setting/setting_page.dart

@@ -133,13 +133,13 @@ class _PageState extends State<SettingPage> with InjectApi {
                     includeLast: true,
                     tiles: [
                       ListTile(
-                        title: Text('消息提醒'),
+                        title: Text('消息提醒',style: TextStyle(fontSize: 16.0),),
                         trailing: arrowRight5(),
                         contentPadding: contentPadding,
                         onTap: () => NavigatorUtil.go(context, Routes.messageSetting),
                       ),
                       ListTile(
-                        title: Text('帐号管理'),
+                        title: Text('帐号管理',style: TextStyle(fontSize: 16.0),),
                         trailing: arrowRight5(),
                         contentPadding: contentPadding,
                         onTap: () => NavigatorUtil.go(context, Routes.account),
@@ -148,7 +148,7 @@ class _PageState extends State<SettingPage> with InjectApi {
                         title: Row(
                           mainAxisAlignment: MainAxisAlignment.spaceBetween,
                           children: <Widget>[
-                            Text('清理缓存'),
+                            Text('清理缓存',style: TextStyle(fontSize: 16.0),),
                             Text(
                               "$_cacheSizeStr",
                               style: Theme.of(context).textTheme.bodyText2,
@@ -160,13 +160,13 @@ class _PageState extends State<SettingPage> with InjectApi {
                         contentPadding: contentPadding,
                       ),
                       ListTile(
-                        title: Text('用户协议'),
+                        title: Text('用户协议',style: TextStyle(fontSize: 16.0),),
                         trailing: arrowRight5(),
                         contentPadding: contentPadding,
                         onTap: () => NavigatorUtil.go(context, Routes.serviceagreement),
                       ),
                       ListTile(
-                        title: Text('隐私协议'),
+                        title: Text('隐私协议',style: TextStyle(fontSize: 16.0),),
                         trailing: arrowRight5(),
                         contentPadding: contentPadding,
                         onTap: () => NavigatorUtil.go(context, Routes.privacypolicy),
@@ -175,7 +175,7 @@ class _PageState extends State<SettingPage> with InjectApi {
                         title: Row(
                           children: <Widget>[
                             Expanded(
-                              child: Text(Platform.isAndroid ? '检查新版本' : '版本信息'),
+                              child: Text(Platform.isAndroid ? '检查新版本' : '版本信息',style: TextStyle(fontSize: 16.0),),
                             ),
                             Text("当前版本:V$_version")
                           ],

+ 151 - 163
lib/pages/social/chat_page.dart

@@ -8,6 +8,7 @@ import 'package:flutter/material.dart';
 import 'package:flutter/rendering.dart';
 import 'package:flutter/scheduler.dart';
 import 'package:flutter/services.dart';
+import 'package:flutter/widgets.dart';
 import 'package:shared_preferences/shared_preferences.dart';
 import 'package:sport/bean/image.dart' as photo;
 import 'package:sport/bean/message.dart';
@@ -137,6 +138,8 @@ class _ChatPageState extends State<ChatPage>
       MessageInstance _instance = (await api.shareForwardSubject(
               int.parse(widget.post.id), widget.user.id))
           .data;
+      print(
+          "[_instance]${_instance.toJson()}---------------------------------------");
 
       await MessageDB().insert(new MessageItem(
           message: _instance, status: 0, curId: 0, userId: widget.user.id));
@@ -217,7 +220,10 @@ class _ChatPageState extends State<ChatPage>
       return Padding(
         padding: EdgeInsets.symmetric(vertical: 5.0),
         child: Center(
-          child: Text("${item.dateTime}"),
+          child: Text(
+            "${item.dateTime}",
+            style: TextStyle(fontSize: 12.0),
+          ),
         ),
       );
     }
@@ -247,7 +253,6 @@ class _ChatPageState extends State<ChatPage>
                     .textTheme
                     .subtitle1
                     .copyWith(fontSize: 16, color: Colors.black),
-                key: anchorKey,
               ),
             if (data.data.url != null)
               InkWell(
@@ -256,7 +261,11 @@ class _ChatPageState extends State<ChatPage>
                     maxHeight: MediaQuery.of(context).size.height,
                     maxWidth: MediaQuery.of(context).size.width,
                   ),
-                  child: CachedNetworkImage(imageUrl: data.data.url),
+                  child: CachedNetworkImage(
+                    imageUrl:
+                        data.data.url + "?x-oss-process=image/resize,p_10",
+                    height: 100,
+                  ),
                 ),
                 onTap: () {
                   Navigator.push(
@@ -281,75 +290,43 @@ class _ChatPageState extends State<ChatPage>
       }
       // 论坛消息 ...
       if (type == "forum-forward") {
+        print("[forum-forward]${item.toJson()}----------------------");
         return InkWell(
-          child: Column(
+          child: Row(
+            crossAxisAlignment: CrossAxisAlignment.center,
             children: <Widget>[
-              RichText(
-                text: TextSpan(children: [
-                  TextSpan(
-                      text: data.data.user.name,
-                      style: Theme.of(context)
-                          .textTheme
-                          .headline6
-                          .copyWith(color: Color(0xFFFFC400))),
-                  TextSpan(
-                      text: data.data.subject.content,
-                      style: Theme.of(context).textTheme.subtitle1),
-                ]),
+              ClipRRect(
+                child: Image.asset(
+                  "lib/assets/img/chat.png",
+                  width: 40,
+                  height: 40,
+                  fit: BoxFit.cover,
+                ),
+                borderRadius: BorderRadius.circular(10),
               ),
               Space(
-                height: 5.0,
+                width: 10.0,
               ),
-              if (data.data.subject.images.length > 0)
-                GridView.count(
-                    physics: new NeverScrollableScrollPhysics(),
-                    shrinkWrap: true,
-                    padding: EdgeInsets.zero,
-                    crossAxisSpacing: 10.0,
-                    crossAxisCount: data.data.subject.images.length > 3
-                        ? 3
-                        : data.data.subject.images.length,
-                    mainAxisSpacing: 10.0,
-                    childAspectRatio: 9 / 6,
-                    children: data.data.subject.images
-                        .asMap()
-                        .keys
-                        .map(
-                          (i) => CachedNetworkImage(
-                            alignment: Alignment.centerLeft,
-                            imageUrl: data.data.subject.images[i],
-                            fit: BoxFit.cover,
-//                        width: data.data.subject.images[i]
-                          ),
-                        )
-                        .toList()),
-              Divider(),
-              Row(
-                children: <Widget>[
-                  Container(
-                    width: 20.0,
-                    height: 20.0,
-                    child: ClipRRect(
-                      borderRadius: BorderRadius.circular(6),
-                      child: CachedNetworkImage(
-                        imageUrl: data.data.forum.cover,
-                      ),
-                    ),
-                  ),
-                  Space(
-                    width: 5,
-                  ),
-                  Text(
-                    data.data.forum.name,
-                  )
-                ],
+              Expanded(
+                child: RichText(
+                  text: TextSpan(children: [
+                    TextSpan(
+                        text: "@" + data.data.user.name + ":",
+                        style: Theme.of(context)
+                            .textTheme
+                            .headline6
+                            .copyWith(color: Color(0xFFFFC400))),
+                    TextSpan(
+                        text: "分享了一篇帖子",
+                        style: Theme.of(context).textTheme.subtitle1),
+                  ]),
+                ),
               )
             ],
           ),
           onTap: () async {
             Post post =
                 (await api.getPostDetail("${data.data.subject.id}")).data;
-            print(post);
             NavigatorUtil.goPage(
                 context, (context) => PostDetailPage(post, false, null));
           },
@@ -357,13 +334,12 @@ class _ChatPageState extends State<ChatPage>
       }
       // 链接..
       if (type == "share") {
-        print("${data.toJson()}--------------------------------------");
         return InkWell(
           child: Row(
               crossAxisAlignment: CrossAxisAlignment.start,
               children: <Widget>[
                 CachedNetworkImage(
-                  imageUrl: avatarList[9],
+                  imageUrl: avatarList[8],
                   width: 60.0,
                   height: 60.0,
                 ),
@@ -398,104 +374,115 @@ class _ChatPageState extends State<ChatPage>
       }
     }
 
-    Widget customPoint = CustomPaint(
-        painter: who == 1 ? _BubblePainterRight() : _BubblePainter(),
-        child: ConstrainedBox(
-          constraints:
-              BoxConstraints(maxWidth: MediaQuery.of(context).size.width * 0.6),
-          child: Container(
-              padding: who == 1
-                  ? EdgeInsets.fromLTRB(12, 6, 20, 8)
-                  : EdgeInsets.fromLTRB(20, 6, 12, 8),
-              child: GestureDetector(
-                  behavior: HitTestBehavior.opaque,
-                  onLongPressStart: (e) {
-                    RenderBox renderBox =
-                        anchorKey.currentContext.findRenderObject();
-                    var offset = renderBox
-                        .localToGlobal(Offset(0.0, renderBox.size.height));
-                    final RelativeRect position = RelativeRect.fromLTRB(
-                        e.globalPosition.dx, //取点击位置坐弹出x坐标
-                        offset.dy, //取text高度做弹出y坐标(这样弹出就不会遮挡文本)
-                        e.globalPosition.dx,
-                        offset.dy);
-
-                    PopupMenuEntry menuItem(
-                            {String imgUrl, String text, Function callBack}) =>
-                        menu.PopupMenuItem(
-                          child: InkWell(
-                            onTap: () {
-                              callBack();
-                              Navigator.pop(context);
-                            },
-                            child: Row(
-                              mainAxisSize: MainAxisSize.min,
+    Widget chatContent(){
+      return ConstrainedBox(
+        constraints:
+        BoxConstraints(maxWidth: MediaQuery.of(context).size.width * 0.6),
+        child: Container(
+            padding: who == 1
+                ? EdgeInsets.fromLTRB(12, 6, 20, 8)
+                : EdgeInsets.fromLTRB(20, 6, 12, 8),
+            key: anchorKey,
+            child: GestureDetector(
+                behavior: HitTestBehavior.opaque,
+                onLongPressStart: (e) {
+                  RenderBox renderBox =
+                  anchorKey.currentContext.findRenderObject();
+                  var offset = renderBox
+                      .localToGlobal(Offset(0.0, renderBox.size.height));
+                  final RelativeRect position = RelativeRect.fromLTRB(
+                      e.globalPosition.dx, //取点击位置坐弹出x坐标
+                      offset.dy, //取text高度做弹出y坐标(这样弹出就不会遮挡文本)
+                      e.globalPosition.dx,
+                      offset.dy);
+
+                  PopupMenuEntry menuItem(
+                      {String imgUrl, String text, Function callBack}) =>
+                      menu.PopupMenuItem(
+                        child: InkWell(
+                          onTap: () {
+                            callBack();
+                            Navigator.pop(context);
+                          },
+                          child: Row(
+                            mainAxisSize: MainAxisSize.min,
+                            children: <Widget>[
+                              Image.asset(
+                                "lib/assets/img/$imgUrl",
+                                width: 24,
+                              ),
+                              SizedBox(
+                                width: 4,
+                              ),
+                              Text(
+                                text,
+                              )
+                            ],
+                          ),
+                        ),
+                      );
+
+                  showMenu(
+                    context: context,
+                    position: position,
+                    items: <PopupMenuEntry>[
+                      PopupMenuItem(
+                          child: Container(
+                            child: Column(
                               children: <Widget>[
-                                Image.asset(
-                                  "lib/assets/img/$imgUrl",
-                                  width: 24,
-                                ),
-                                SizedBox(
-                                  width: 4,
-                                ),
-                                Text(
-                                  text,
+                                menuItem(
+                                    imgUrl: "linkpop_icon_copy.png",
+                                    text: "复制",
+                                    callBack: () {
+                                      Clipboard.setData(ClipboardData(
+                                          text: '${data.data.text}'));
+                                      ToastUtil.show("复制成功");
+                                    }),
+                                who == 1
+                                    ? menuItem(
+                                  imgUrl: "linkpop_icon_del.png",
+                                  text: "删除",
+                                  callBack: () async {
+                                    await MessageDB()
+                                        .deleteMessageIdMessage(
+                                        item.messageId);
+                                    messageList.remove(item);
+                                    setState(() {
+                                      messageList = messageList;
+                                    });
+                                  },
                                 )
+                                    : menuItem(
+                                    imgUrl: "linkpop_icon_modify_1.png",
+                                    text: "举报",
+                                    callBack: () async {
+                                      await api.postForumReport(
+                                          userId: item.userId,
+                                          content:
+                                          "该用户涉嫌发送不良消息内容为:${item.message.data.text}");
+                                      ToastUtil.show("举报已受理...");
+                                    }),
+                                menuItem(
+                                    imgUrl: "linkpop_icon_cancel.png", text: "取消")
                               ],
                             ),
-                          ),
-                        );
-
-                    showMenu(
-                      context: context,
-                      position: position,
-                      items: <PopupMenuEntry>[
-                        PopupMenuItem(
-                            child: Container(
-                          child: Column(
-                            children: <Widget>[
-                              menuItem(
-                                  imgUrl: "linkpop_icon_copy.png",
-                                  text: "复制",
-                                  callBack: () {
-                                    Clipboard.setData(ClipboardData(
-                                        text: '${data.data.text}'));
-                                    ToastUtil.show("复制成功");
-                                  }),
-                              who == 1
-                                  ? menuItem(
-                                      imgUrl: "linkpop_icon_del.png",
-                                      text: "删除",
-                                      callBack: () async {
-                                        await MessageDB()
-                                            .deleteMessageIdMessage(
-                                                item.messageId);
-                                        messageList.remove(item);
-                                        setState(() {
-                                          messageList = messageList;
-                                        });
-                                      },
-                                    )
-                                  : menuItem(
-                                      imgUrl: "linkpop_icon_modify_1.png",
-                                      text: "举报",
-                                      callBack: () async {
-                                        await api.postForumReport(
-                                            userId: item.userId,
-                                            content:
-                                                "该用户涉嫌发送不良消息内容为:${item.message.data.text}");
-                                        ToastUtil.show("举报已受理...");
-                                      }),
-                              menuItem(
-                                  imgUrl: "linkpop_icon_cancel.png", text: "取消")
-                            ],
-                          ),
-                        ))
-                      ],
-                    );
-                  },
-                  child: chatItemOfType(data.type))),
-        ));
+                          ))
+                    ],
+                  );
+                },
+                child: chatItemOfType(data.type))),
+      );
+    }
+
+    Widget customPoint(){
+      print("[data.type]:${data.type}--------------------");
+      if(data.type != "image"){
+        return CustomPaint(
+            painter: who == 1 ? _BubblePainterRight() : _BubblePainter(),
+            child: chatContent());
+      }
+      return chatContent();
+    };
 
     Widget spaceItem = Space(
       width: 12,
@@ -524,9 +511,9 @@ class _ChatPageState extends State<ChatPage>
       ),
     );
 
-    List<Widget> chatContentUsr = [customPoint, spaceItem, avatar];
+    List<Widget> chatContentUsr = [customPoint(), spaceItem, avatar];
 
-    List<Widget> chatContentOther = [avatar, spaceItem, customPoint];
+    List<Widget> chatContentOther = [avatar, spaceItem, customPoint()];
 
     return Padding(
         padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 12.0),
@@ -552,9 +539,10 @@ class _ChatPageState extends State<ChatPage>
         body: WillPopScope(
             onWillPop: () async {
               // 这是分享.... 只能一步一步pop 出去
-              if(widget.post != null || widget.hash != null || widget.image != null){
-                print("${widget.post}=============");
-                Navigator.pop(context,true);
+              if (widget.post != null ||
+                  widget.hash != null ||
+                  widget.image != null) {
+                Navigator.pop(context, true);
                 return false;
               }
               return true;
@@ -620,7 +608,7 @@ class _BubblePainter extends CustomPainter {
 
 class _BubblePainterRight extends CustomPainter {
   final circular = Radius.circular(10);
-  final Paint _paint = Paint()..color = Colors.white;
+  final Paint _paint = Paint()..color = Color(0xffffe400).withOpacity(0.7);
   final double _bubbleWidth = 10;
 
   @override

+ 147 - 134
lib/pages/social/message_list_subpage.dart

@@ -28,25 +28,28 @@ class MessageListSubPage extends StatefulWidget {
 }
 
 class _MessageListSubPageState extends State<MessageListSubPage>
-    with InjectApi, UserId {
+    with InjectApi, UserId, AutomaticKeepAliveClientMixin {
   List<MessageItem> messageList;
   StreamSubscription _streamSubscription;
   bool isLoading = true;
   @override
+  // TODO: implement wantKeepAlive
+  bool get wantKeepAlive => true;
+  @override
   void initState() {
     // TODO: implement initState
     super.initState();
-    getChatIndex().then((value){
+    getChatIndex().then((value) {
       setState(() {
         isLoading = false;
-        messageList = messageList;
+        messageList = value;
       });
     });
     initListen();
   }
 
   // MessageInstance 类型是 服务器请求回来的类型 MessageItem 是本地 存储后的类型...
-  Future getChatIndex() async {
+  Future<List<MessageItem>> getChatIndex() async {
     //    List<ChatMessageInstance> list = (await api.getChatIndex()).results;
 //    var list = await MessageDB().getMessageList();
     messageList = [];
@@ -81,7 +84,7 @@ class _MessageListSubPageState extends State<MessageListSubPage>
         messageList.add(item);
       }
     }
-//    return messageList;
+    return messageList;
   }
 
   // 在本页中如果收到了就 ...
@@ -108,7 +111,7 @@ class _MessageListSubPageState extends State<MessageListSubPage>
       onTap: () async {
         UserInfo info = (await api.getUserInfo("$id")).data;
         await NavigatorUtil.goPage(context, (context) => ChatPage(info));
-        getChatIndex().then((value){
+        getChatIndex().then((value) {
           setState(() {
             isLoading = false;
             messageList = messageList;
@@ -183,146 +186,156 @@ class _MessageListSubPageState extends State<MessageListSubPage>
           }
         }
       },
-      child: Padding(
-        padding: const EdgeInsets.all(12.0),
-        child: Column(
-          children: <Widget>[
-            Padding(
-                padding: const EdgeInsets.all(12.0),
-                child: Row(
-                  children: <Widget>[
-                    !online
-                        ? ColorFiltered(
-                            colorFilter:
-                                ColorFilter.mode(Colors.white, BlendMode.color),
-                            child: CircleAvatar(
-                              backgroundImage: userAvatarProvider(avatar),
-                              radius: 22,
-                            ),
-                          )
-                        : CircleAvatar(
+      child: Column(
+        children: <Widget>[
+          Padding(
+              padding: const EdgeInsets.only(top: 12.0, bottom: 12.0),
+              child: Row(
+                children: <Widget>[
+                  !online
+                      ? ColorFiltered(
+                          colorFilter:
+                              ColorFilter.mode(Colors.white, BlendMode.color),
+                          child: CircleAvatar(
                             backgroundImage: userAvatarProvider(avatar),
                             radius: 22,
                           ),
-                    SizedBox(
-                      width: 8,
-                    ),
-                    Expanded(
-                      flex: 3,
-                      child: Column(
-                        crossAxisAlignment: CrossAxisAlignment.start,
-                        children: <Widget>[
-                          Row(
-                            children: <Widget>[
-                              Expanded(
-                                child: Text(
-                                  "$name",
-                                  style: Theme.of(context).textTheme.headline3,
-                                  maxLines: 1,
-                                  overflow: TextOverflow.ellipsis,
-                                ),
-                              ),
-                              SizedBox(
-                                width: 4.0,
+                        )
+                      : CircleAvatar(
+                          backgroundImage: userAvatarProvider(avatar),
+                          radius: 22,
+                        ),
+                  SizedBox(
+                    width: 8,
+                  ),
+                  Expanded(
+                    flex: 3,
+                    child: Column(
+                      crossAxisAlignment: CrossAxisAlignment.start,
+                      mainAxisAlignment:MainAxisAlignment.center,
+                      children: <Widget>[
+                        Row(
+                          mainAxisAlignment: MainAxisAlignment.start,
+                          children: <Widget>[
+                            Flexible(
+                              child: Text(
+                                "$name",
+                                style: Theme.of(context)
+                                    .textTheme
+                                    .headline3
+                                    .copyWith(fontWeight: FontWeight.normal),
+                                maxLines: 1,
+                                overflow: TextOverflow.ellipsis,
+                                strutStyle: StrutStyle(forceStrutHeight: true),
                               ),
-                              messageList[index].message.relate != 'friends'
-                                  ? Container(
-                                      padding:
-                                          EdgeInsets.symmetric(horizontal: 5.0),
-                                      decoration: BoxDecoration(
-                                          border: Border.all(
-                                              color: Color(0xffffc400)),
-                                          borderRadius: BorderRadius.all(
-                                              Radius.circular(8.0))),
-                                      child: Text(
-                                        "未关注",
-                                        style: Theme.of(context)
-                                            .textTheme
-                                            .bodyText1
-                                            .copyWith(color: Color(0xffffc400)),
-                                      ))
-                                  : Container()
-                            ],
-                          ),
-                          SizedBox(
-                            height: 4,
-                          ),
-                          if (messageList[index].message.type == "text")
-                            Text(
-                              "${messageList[index].message.data.text}",
-                              style: Theme.of(context).textTheme.bodyText1,
-                              maxLines: 1,
-                              overflow: TextOverflow.ellipsis,
-                            ),
-                          if (messageList[index].message.type ==
-                              "forum-forward")
-                            Text(
-                              "${messageList[index].message.data.subject.content}",
-                              style: Theme.of(context).textTheme.bodyText1,
-                              maxLines: 1,
-                              overflow: TextOverflow.ellipsis,
                             ),
-                          if (messageList[index].message.type == "image")
-                            Text(
-                              "分享图片",
-                              style: Theme.of(context).textTheme.bodyText1,
-                              maxLines: 1,
-                              overflow: TextOverflow.ellipsis,
+                            SizedBox(
+                              width: 4.0,
                             ),
-                          if (messageList[index].message.type == "share")
-                            Text(
-                              "分享链接",
-                              style: Theme.of(context).textTheme.bodyText1,
-                              maxLines: 1,
-                              overflow: TextOverflow.ellipsis,
-                            )
-                        ],
-                      ),
-                    ),
-                    SizedBox(
-                      width: 8,
-                    ),
-                    Expanded(
-                      flex: 1,
-                      child: Column(
-                        crossAxisAlignment: CrossAxisAlignment.end,
-                        mainAxisAlignment: MainAxisAlignment.center,
-                        children: <Widget>[
+                            messageList[index].message.relate != 'friends'
+                                ? 
+//                            Container(
+//                                    padding:
+//                                        EdgeInsets.symmetric(horizontal: 5.0),
+//                                    decoration: BoxDecoration(
+//                                        border: Border.all(
+//                                            color: Color(0xffffc400)),
+//                                        borderRadius: BorderRadius.all(
+//                                            Radius.circular(8.0))),
+//                                    child: Text(
+//                                      "未关注",
+//                                      style: Theme.of(context)
+//                                          .textTheme
+//                                          .bodyText1
+//                                          .copyWith(color: Color(0xffffc400),fontSize: 11.0),
+//                                    ))
+                            Image.asset("lib/assets/img/untrace.png",width: 44.0,height: 22.0,)
+                                : Container()
+                          ],
+                        ),
+                        SizedBox(
+                          height: 4,
+                        ),
+                        if (messageList[index].message.type == "text")
                           Text(
-                            "${DateFormat.format(DateTime.parse(messageList[index].message.createdAt))}",
+                            "${messageList[index].message.data.text}",
                             style: Theme.of(context).textTheme.bodyText1,
+                            maxLines: 1,
+                            overflow: TextOverflow.ellipsis,
                           ),
-                          SizedBox(
-                            height: 3,
+                        if (messageList[index].message.type ==
+                            "forum-forward")
+                          Text(
+                            "${messageList[index].message.data.subject.content}",
+                            style: Theme.of(context).textTheme.bodyText1,
+                            maxLines: 1,
+                            overflow: TextOverflow.ellipsis,
                           ),
-                          if (messageList[index].unReadCount > 0)
-                            ClipOval(
-                                child: Container(
-                              width: 21.0,
-                              height: 21.0,
-                              color: Color(0xffff5B1D),
-                              child: Center(
-                                child: Text(
-                                  '${messageList[index].unReadCount}',
-                                  style: TextStyle(
-                                      color: Colors.white, fontSize: 12.0),
-                                ),
+                        if (messageList[index].message.type == "image")
+                          Text(
+                            "分享图片",
+                            style: Theme.of(context).textTheme.bodyText1,
+                            maxLines: 1,
+                            overflow: TextOverflow.ellipsis,
+                          ),
+                        if (messageList[index].message.type == "share")
+                          Text(
+                            "分享链接",
+                            style: Theme.of(context).textTheme.bodyText1,
+                            maxLines: 1,
+                            overflow: TextOverflow.ellipsis,
+                          )
+                      ],
+                    ),
+                  ),
+                  SizedBox(
+                    width: 8,
+                  ),
+                  Expanded(
+                    flex: 1,
+                    child: Column(
+                      crossAxisAlignment: CrossAxisAlignment.end,
+                      mainAxisAlignment: MainAxisAlignment.center,
+                      children: <Widget>[
+                        Text(
+                          "${DateFormat.format(DateTime.parse(messageList[index].message.createdAt))}",
+                          style: Theme.of(context).textTheme.bodyText1,
+                        ),
+                        SizedBox(
+                          height: 3,
+                        ),
+                        if (messageList[index].unReadCount > 0)
+                          ClipOval(
+                              child: Container(
+                            width: 21.0,
+                            height: 21.0,
+                            color: Color(0xffff5B1D),
+                            child: Center(
+                              child: Text(
+                                '${messageList[index].unReadCount}',
+                                style: TextStyle(
+                                    color: Colors.white, fontSize: 12.0),
                               ),
-                            ))
-                        ],
-                      ),
-                    )
-                  ],
-                )),
-          ],
-        ),
+                            ),
+                          ))
+                      ],
+                    ),
+                  )
+                ],
+              )),
+          Divider(height: 1,)
+        ],
       ),
     );
   }
 
   @override
   Widget build(BuildContext context) {
-    if (isLoading) return LoadingWidget();
+    super.build(context);
+    if (isLoading)
+      return LoadingWidget(
+        child: Text("loading"),
+      );
     // TODO: implement build
     return messageList.length <= 0
         ? Center(
@@ -332,11 +345,11 @@ class _MessageListSubPageState extends State<MessageListSubPage>
               assets: RequestErrorWidget.ASSETS_NO_COMMENT,
             ),
           )
-        : ListView.separated(
-            padding: EdgeInsets.zero,
-            separatorBuilder: (context, index) => Divider(
-                  height: 1,
-                ),
+        : ListView.builder(
+            padding: EdgeInsets.symmetric(horizontal: 12.0),
+//            separatorBuilder: (context, index) => Divider(
+//                  height: 1,
+//                ),
             itemCount: messageList?.length ?? 0,
             itemBuilder: (context, index) {
               // 这里可能有得后续看看怎么写比较好 ... 判断是否是自己 ...

+ 6 - 6
lib/pages/social/message_notice_detail_page.dart

@@ -48,7 +48,7 @@ class _PageState extends State<MessageNoticeDetailPage> with InjectApi {
                   ),
                   Text(
                     "${widget.notice.createdAt}",
-                    style: Theme.of(context).textTheme.bodyText2,
+                    style: Theme.of(context).textTheme.bodyText1,
                   ),
                   SizedBox(
                     height: 5,
@@ -57,11 +57,11 @@ class _PageState extends State<MessageNoticeDetailPage> with InjectApi {
                   SizedBox(
                     height: 5,
                   ),
-                  Text("${widget.notice.content}", style: Theme.of(context).textTheme.bodyText2),
+                  Text("${widget.notice.content}", style: Theme.of(context).textTheme.bodyText2.copyWith(color: Color(0xff666666))),
                   if (widget.notice.type == "receive")
                     Padding(
                       padding: const EdgeInsets.only(top: 40.0),
-                      child: Text("注:邮件超过7天未查收将自动领取奖励", style: Theme.of(context).textTheme.bodyText2),
+                      child: Text("注:邮件超过7天未查收将自动领取奖励", style: Theme.of(context).textTheme.bodyText2.copyWith(color: Color(0xff666666))),
                     ),
                   if (widget.notice.type == "receive" && widget.notice.receiveDetail != null)
                     Column(
@@ -96,9 +96,9 @@ class _PageState extends State<MessageNoticeDetailPage> with InjectApi {
                             )
                           ],
                         ),
-                        Divider(
-                          height: 32,
-                        ),
+//                        Divider(
+//                          height: 32,
+//                        ),
                       ],
                     )
                 ],

+ 29 - 16
lib/pages/social/message_page.dart

@@ -14,6 +14,7 @@ import 'package:sport/db/message_db.dart';
 import 'package:sport/pages/social/chat_page.dart';
 import 'package:sport/pages/social/message_notice_detail_page.dart';
 import 'package:sport/pages/social/user_detail_page.dart';
+import 'package:sport/pages/social/user_friend_page.dart';
 import 'package:sport/provider/message_model.dart';
 import 'package:sport/router/navigator_util.dart';
 import 'package:sport/router/routes.dart';
@@ -162,7 +163,16 @@ class _PageState extends State<MessagePage>
             headerSliverBuilder: (context, innerBoxIsScrolled) {
               return <Widget>[
                 buildSliverAppBar(context, "社区消息",
-                    innerBoxIsScrolled: innerBoxIsScrolled),
+                    innerBoxIsScrolled: innerBoxIsScrolled,
+                  actions: [
+                    IconButton(
+                      icon: Image.asset("lib/assets/img/topbar_friendslist.png"),
+                      onPressed: () {
+                        NavigatorUtil.goPage(context, (context) => UserFriendPage());
+                      },
+                    ),
+                  ]
+                ),
                 SliverPersistentHeader(
                   delegate: PersistentHeader(
                       min: tabHeader,
@@ -211,13 +221,13 @@ class _PageState extends State<MessagePage>
               NestedScrollViewInnerScrollPositionKeyWidget(
                   const Key('Tab0'),
                   ListView.separated(
-                    padding: EdgeInsets.zero,
+                    padding: EdgeInsets.symmetric(horizontal: 12.0),
                     itemBuilder: (context, index) => index == 0
                         ? InkWell(
                             onTap: () => NavigatorUtil.go(context,
                                 "${Routes.socialMessageDetail}?data=comment"),
                             child: Padding(
-                              padding: const EdgeInsets.all(12.0),
+                              padding: const EdgeInsets.symmetric(vertical: 12.0),
                               child: Row(children: <Widget>[
                                 Image.asset(
                                     "lib/assets/img/bbsmessage_icon_reply.png"),
@@ -274,7 +284,7 @@ class _PageState extends State<MessagePage>
                                 onTap: () => NavigatorUtil.go(context,
                                     "${Routes.socialMessageDetail}?data=like"),
                                 child: Padding(
-                                  padding: const EdgeInsets.all(12.0),
+                                  padding: const EdgeInsets.symmetric(vertical: 12.0),
                                   child: Row(children: <Widget>[
                                     Image.asset(
                                         "lib/assets/img/bbsmessage_icon_like.png"),
@@ -335,7 +345,6 @@ class _PageState extends State<MessagePage>
                     ),
                     itemCount: 3,
                   )),
-
               NestedScrollViewInnerScrollPositionKeyWidget(
                   const Key('Tab0'),
                   Container(
@@ -345,7 +354,7 @@ class _PageState extends State<MessagePage>
                         if (snapshot == null || snapshot.data == null)
                           return RequestLoadingWidget();
                         return ListView.separated(
-                          padding: EdgeInsets.zero,
+                          padding: EdgeInsets.symmetric(horizontal: 12.0),
                           itemBuilder: (context, index) {
                             if (index >= snapshot.data.length)
                               return Container();
@@ -360,25 +369,29 @@ class _PageState extends State<MessagePage>
                                 }
                               },
                               child: Padding(
-                                padding: const EdgeInsets.all(12.0),
+                                padding: const EdgeInsets.symmetric(vertical: 12.0),
                                 child: Row(children: <Widget>[
                                   Image.asset(
                                       "lib/assets/img/${(item.type == "rank" || item.type == "receive") ? 'bbsmessage_icon_rank' : 'bbsmessage_icon_notice'}.png"),
                                   SizedBox(
-                                    width: 16.0,
+                                    width: 8.0,
                                   ),
                                   Expanded(
                                     child: Column(
                                       crossAxisAlignment:
                                           CrossAxisAlignment.start,
                                       children: <Widget>[
-                                        Text(
-                                          "${item.title}",
-                                          style: Theme.of(context)
-                                              .textTheme
-                                              .subtitle1
-                                              .copyWith(fontSize: 16),
-                                          strutStyle: fixedLine,
+                                        Container(
+                                          height:18.0,
+                                          child: Text(
+                                            "${item.title}",
+                                            style: Theme.of(context)
+                                                .textTheme
+                                                .subtitle1
+                                                .copyWith(fontSize: 16),
+                                            strutStyle: fixedLine,
+                                            overflow: TextOverflow.ellipsis,
+                                          ),
                                         ),
                                         SizedBox(
                                           height: 4,
@@ -389,7 +402,7 @@ class _PageState extends State<MessagePage>
                                           overflow: TextOverflow.ellipsis,
                                           style: Theme.of(context)
                                               .textTheme
-                                              .bodyText2,
+                                              .bodyText1,
                                         )
                                       ],
                                     ),

+ 84 - 41
lib/pages/social/post_detail_page.dart

@@ -6,6 +6,7 @@ import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
 import 'package:flutter_easyrefresh/easy_refresh.dart';
+import 'package:provider/provider.dart';
 import 'package:sport/bean/comment.dart';
 import 'package:sport/bean/post.dart';
 import 'package:sport/bean/post_user.dart';
@@ -17,6 +18,7 @@ import 'package:sport/pages/social/share_webview.dart';
 import 'package:sport/provider/lib/provider_widget.dart';
 import 'package:sport/provider/lib/view_state_lifecycle.dart';
 import 'package:sport/provider/post_detail_model.dart';
+import 'package:sport/provider/user_model.dart';
 import 'package:sport/router/navigator_util.dart';
 import 'package:sport/services/userid.dart';
 import 'package:sport/utils/DateFormat.dart';
@@ -346,27 +348,28 @@ class _PageState extends ViewStateLifecycle<PostDetailPage, PostDetailModel> wit
                     post.isFriend()
                         ? GestureDetector(
                       child: Container(
-                        width: 90,
+//                        width: 70,
                         height: 35,
                         alignment: Alignment.center,
-                        child: Row(mainAxisSize: MainAxisSize.min, children: <Widget>[
-                          Image.asset("lib/assets/img/mine_icon_followed.png"),
-                          Space(
-                            width: 6,
-                          ),
-                          Text(
-                            "已关注",
-                            strutStyle: fixedLine,
-                            style: Theme.of(context).textTheme.subtitle1.copyWith(color: Theme.of(context).accentColor),
-                          )
-                        ]),
-                        decoration: BoxDecoration(
-                          borderRadius: BorderRadius.circular(20),
-                          border: Border.all(
-                            color: Theme.of(context).accentColor,
-                            width: .5,
-                          ),
-                        ),
+                        child: Text(
+                              "已关注",
+                              strutStyle: fixedLine,
+                              style: Theme.of(context).textTheme.subtitle1.copyWith(color: Color(0xff999999)),
+                            ),
+//                        Row(mainAxisSize: MainAxisSize.min, children: <Widget>[
+//                          Image.asset("lib/assets/img/mine_icon_followed.png"),
+//                          Space(
+//                            width: 6,
+//                          ),
+//
+//                        ]),
+//                        decoration: BoxDecoration(
+//                          borderRadius: BorderRadius.circular(20),
+//                          border: Border.all(
+//                            color: Theme.of(context).accentColor,
+//                            width: .5,
+//                          ),
+//                        ),
                       ),
                       onTap: () async {
                         await request(context, () async {
@@ -380,10 +383,59 @@ class _PageState extends ViewStateLifecycle<PostDetailPage, PostDetailModel> wit
                         });
                       },
                     )
-                        : PrimaryButton(
-                      width: 90,
-                      height: 35,
-                      callback: () async {
+                        : post.isMe(Provider.of<UserModel>(context,listen: false).user.id)? Container() :
+//                    PrimaryButton(
+//                      width: 90,
+//                      height: 35,
+//                      callback: () async {
+//                        await request(context, () async {
+//                          var resp = await model.api.userFollow(uid: int.parse(post.userId)).catchError((onError) {});
+//                          if (resp?.code == 0) {
+//                            post.followStatus = "followed";
+//                            // 修改本地的不知道为什么这里不要 先保留...
+////                            var db = widget.userFriends?.firstWhere((element) => element.uid == user.id);
+////                            if (db != null) {
+////                              db.isFriends = "1";
+////                              db.isIgnore = 0;
+////                            }
+//                            setState(() {});
+//                            ToastUtil.show("关注成功");
+//                          }
+//                        });
+//                      },
+//                      content: '',
+//                      shadow: false,
+//                      child: Row(mainAxisSize: MainAxisSize.min, children: <Widget>[
+//                        Image.asset("lib/assets/img/mine_icon_follow.png"),
+//                        Space(
+//                          width: 6,
+//                        ),
+//                        Text(
+//                          "关注",
+//                          strutStyle: fixedLine,
+//                          style: Theme.of(context).textTheme.subtitle1.copyWith(color: Colors.white),
+//                        )
+//                      ]),
+//                    ),
+                    GestureDetector(
+                      child: Container(
+                        width: 70,
+                        height: 30,
+                        alignment: Alignment.center,
+                        child: Text(
+                          "关注",
+                          strutStyle: fixedLine,
+                          style: Theme.of(context).textTheme.subtitle1.copyWith(color: Theme.of(context).accentColor),
+                        ),
+                        decoration: BoxDecoration(
+                          borderRadius: BorderRadius.circular(20),
+                          border: Border.all(
+                            color: Theme.of(context).accentColor,
+                            width: .5,
+                          ),
+                        ),
+                      ),
+                      onTap: () async {
                         await request(context, () async {
                           var resp = await model.api.userFollow(uid: int.parse(post.userId)).catchError((onError) {});
                           if (resp?.code == 0) {
@@ -398,21 +450,8 @@ class _PageState extends ViewStateLifecycle<PostDetailPage, PostDetailModel> wit
                             ToastUtil.show("关注成功");
                           }
                         });
-                      },
-                      content: '',
-                      shadow: false,
-                      child: Row(mainAxisSize: MainAxisSize.min, children: <Widget>[
-                        Image.asset("lib/assets/img/mine_icon_follow.png"),
-                        Space(
-                          width: 6,
-                        ),
-                        Text(
-                          "关注",
-                          strutStyle: fixedLine,
-                          style: Theme.of(context).textTheme.subtitle1.copyWith(color: Colors.white),
-                        )
-                      ]),
-                    ),
+                      }
+                    )
                   ],
                 ),
               ),
@@ -545,9 +584,13 @@ class _PageState extends ViewStateLifecycle<PostDetailPage, PostDetailModel> wit
     return Scaffold(
       backgroundColor: Colors.white,
       appBar: AppBar(
-        title: Text(
-          "帖子详情",
-          style: titleStyle,
+        titleSpacing: -5,
+        title: Container(
+          alignment: Alignment.centerLeft,
+          child: Text(
+            "帖子详情",
+            style: titleStyle,
+          ),
         ),
         leading: buildBackButton(context),
         actions: <Widget>[

+ 7 - 4
lib/pages/social/post_page.dart

@@ -51,8 +51,11 @@ class _PageState extends State<PostPage> {
     _focusNode = FocusNode();
     _controller = TextEditingController()..addListener(() {});
     //...
-    if(widget.post != null) _controller.text = "转发帖子";
-    _valueNotifier.value ="转发帖子";
+    if(widget.post != null) {
+      _controller.text = "转发帖子";
+      _valueNotifier.value ="转发帖子";
+    }
+
   }
 
   @override
@@ -355,8 +358,8 @@ class _PageState extends State<PostPage> {
           ),
           child: ClipRRect(
               borderRadius: BorderRadius.circular(6),
-              child:Image.asset(
-                image,
+              child:Image.file(
+                File(image),
                 fit: BoxFit.cover,
               )
           ),

+ 40 - 28
lib/pages/social/post_share_page.dart

@@ -1,3 +1,5 @@
+import 'dart:io';
+
 import 'package:cached_network_image/cached_network_image.dart';
 import 'package:flutter/material.dart';
 import 'package:provider/provider.dart';
@@ -25,7 +27,7 @@ class PostSharePage extends StatefulWidget {
   final String hash;
   // Img
   final String image;
-  const PostSharePage({this.post,this.url,this.hash,this.image});
+  const PostSharePage({this.post, this.url, this.hash, this.image});
 
   @override
   State<StatefulWidget> createState() => _PageState();
@@ -85,7 +87,7 @@ class _PageState extends State<PostSharePage> with InjectApi {
                           forum: list[index],
                           url: widget.url,
                           hash: widget.hash,
-                          image:widget.image,
+                          image: widget.image,
                         ));
                 if (result == true) {
                   Navigator.of(context).pop(true);
@@ -106,7 +108,7 @@ class PostShareFriendsPage extends StatefulWidget {
   final Post post; // 应该是二选一...
   final String hash; // 二选一 ...
   final String image;
-  const PostShareFriendsPage({this.post, this.hash,this.image});
+  const PostShareFriendsPage({this.post, this.hash, this.image});
 
   @override
   State<StatefulWidget> createState() => _PostShareFriendsPageState();
@@ -184,19 +186,18 @@ class _PostShareFriendsPageState extends State<PostShareFriendsPage>
                             Space(
                               height: 8.0,
                             ),
-                            _buildPostWidget(context, widget.post, widget.hash,widget.image)
+                            _buildPostWidget(
+                                context, widget.post, widget.hash, widget.image)
                           ],
                         ),
                         textOk: "分享",
                         ok: () async {
                           bool result = await NavigatorUtil.goPage(
                               context,
-                              (context) => ChatPage(
-                                    list[index].socialInfo,
-                                    post: widget.post,
-                                    hash: widget.hash,
-                                  image:widget.image
-                                  ));
+                              (context) => ChatPage(list[index].socialInfo,
+                                  post: widget.post,
+                                  hash: widget.hash,
+                                  image: widget.image));
                           if (result == true) {
                             Navigator.of(context).pop(true);
                             Navigator.of(context).pop(true);
@@ -214,7 +215,8 @@ class _PostShareFriendsPageState extends State<PostShareFriendsPage>
   }
 }
 
-Widget _buildPostWidget(BuildContext context, Post post, String hash,String image) {
+Widget _buildPostWidget(
+    BuildContext context, Post post, String hash, String image) {
   Widget imageWidget(String image) {
     return ClipRRect(
         child: CachedNetworkImage(
@@ -239,28 +241,34 @@ Widget _buildPostWidget(BuildContext context, Post post, String hash,String imag
     );
   }
 
-  Widget contentMoreWidget(){
+  Widget contentMoreWidget() {
     return Expanded(
       child: Container(
         margin: const EdgeInsets.all(5.0),
-        child:RichText(
-          text: TextSpan(
-            children: [
-              TextSpan(text: Provider.of<UserModel>(context, listen: false).user.name,style: Theme.of(context).textTheme.headline6.copyWith(color: Color(0xffffc400))),
-              TextSpan(text:"分享了他的运动记录,快来围观吧~",style: Theme.of(context).textTheme.subtitle1)
-            ]
-          ),
+        child: RichText(
+          text: TextSpan(children: [
+            TextSpan(
+                text: Provider.of<UserModel>(context, listen: false).user.name,
+                style: Theme.of(context)
+                    .textTheme
+                    .headline6
+                    .copyWith(color: Color(0xffffc400))),
+            TextSpan(
+                text: "分享了他的运动记录,快来围观吧~",
+                style: Theme.of(context).textTheme.subtitle1)
+          ]),
         ),
       ),
     );
   }
 
   Widget sharePostWidget() {
+    print("$image----------------------------");
     if (post != null) {
       return Row(
         children: <Widget>[
-          if(post?.images != null && post.images.isNotEmpty)
-          imageWidget(post?.images[0].src),
+          if (post?.images != null && post.images.isNotEmpty)
+            imageWidget(post?.images[0].src),
           contentWidget(post.content),
         ],
       );
@@ -271,21 +279,25 @@ Widget _buildPostWidget(BuildContext context, Post post, String hash,String imag
           contentMoreWidget(),
         ],
       );
-    } else if(image != null){
+    } else if (image != null) {
       return Container(
-        constraints: BoxConstraints(
-          maxHeight: 300,
-          maxWidth: 200
-        ),
+        decoration: BoxDecoration(
+            image: DecorationImage(
+          image: FileImage(File(image)),
+          fit: BoxFit.cover,
+        )),
+        constraints: BoxConstraints(maxHeight: 300, maxWidth: 200),
         child: CachedNetworkImage(
-          imageUrl: image,
+          imageUrl:image,
         ),
       );
-    }else {
+    } else {
       return Container();
     }
   }
 
+//  file unload asset
+
   return Container(
       margin: const EdgeInsets.symmetric(horizontal: 8.0),
       padding: const EdgeInsets.symmetric(vertical: 7.0, horizontal: 8.0),

+ 2 - 2
lib/pages/social/search_page.dart

@@ -129,7 +129,7 @@ class _PageState extends State<SearchPage> with UserId, InjectApi {
                       decoration: InputDecoration(
                           hintText: '请输入搜索内容',
                           contentPadding: EdgeInsets.symmetric(
-                              vertical: 11.0, horizontal: 16.0),
+                              vertical: 11.5, horizontal: 6.0),
                           border: InputBorder.none,
                           hintStyle: TextStyle(color: Color(0xff999999))),
                       onChanged: debounceValueChanged((value) {
@@ -170,7 +170,7 @@ class _PageState extends State<SearchPage> with UserId, InjectApi {
             actions: <Widget>[
               buildActionButton("取消", () {
                 Navigator.of(context).pop();
-              }),
+              },textColor: Color(0xff333333)),
             ],
           ),
           body: AnimatedSwitcher(

+ 35 - 19
lib/pages/social/share_achievement.dart

@@ -23,10 +23,15 @@ class ShareAchievementPage extends StatelessWidget {
     // TODO: implement build
     return Scaffold(
         appBar: AppBar(
-          title: Text(
-            "成就分享",
-            style: titleStyle,
+          titleSpacing: -5,
+          title: Container(
+            child: Text(
+              "成就分享",
+              style: titleStyle,
+            ),
+            alignment: Alignment.centerLeft,
           ),
+          leading: buildBackButton(context),
           actions: <Widget>[
             IconButton(
               icon: Image.asset("lib/assets/img/bbs_icon_share.png"),
@@ -55,7 +60,7 @@ class ShareAchievementPage extends StatelessWidget {
                           width: MediaQuery.of(context).size.width * 0.65,
                           decoration: BoxDecoration(
                             borderRadius:
-                                BorderRadius.all(Radius.circular(20.0)),
+                                BorderRadius.all(Radius.circular(10.0)),
                             color: Colors.white,
                           ),
                           child: Column(
@@ -78,10 +83,18 @@ class ShareAchievementPage extends StatelessWidget {
                               Space(
                                 height: 16.0,
                               ),
-                              CachedNetworkImage(
-                                imageUrl: achievement.logo,
-                                width: 120.0,
-                                height: 120.0,
+                              Container(
+                                width: double.infinity,
+                                decoration: BoxDecoration(
+                                    image: DecorationImage(
+                                        image: AssetImage("lib/assets/img/bg_pop_achievement.png")
+                                    )
+                                ),
+                                child: CachedNetworkImage(
+                                  imageUrl: achievement.logo,
+                                  width: 120.0,
+                                  height: 120.0,
+                                ),
                               ),
                               Space(
                                 height: 8.0,
@@ -91,7 +104,7 @@ class ShareAchievementPage extends StatelessWidget {
                                 style: Theme.of(context).textTheme.headline1,
                               ),
                               Space(
-                                height: 16.0,
+                                height: 12.0,
                               ),
                               Text(
                                 "使用智能鞋运动${achievement.conditionDetail}",
@@ -106,12 +119,15 @@ class ShareAchievementPage extends StatelessWidget {
 //                                color: Color(0xffFFC400).withOpacity(0.3),
                                 alignment: Alignment.center,
                                 decoration: BoxDecoration(
-                                  gradient: new RadialGradient(
-                                      radius: 4,
-                                      colors: [
-                                        Color.fromRGBO(255, 196, 0, 1).withAlpha(80),
-                                        Color(0x00ffffff),
-                                      ]),
+//                                  gradient: new RadialGradient(
+//                                      radius: 4,
+//                                      colors: [
+//                                        Color.fromRGBO(255, 196, 0, 1).withAlpha(80),
+//                                        Color(0x00ffffff),
+//                                      ]),
+                                      image: DecorationImage(
+                                        image: AssetImage("lib/assets/img/bg1_pop_achievement.png")
+                                      )
                                 ),
                                 child: Text(
                                   "经验值+${achievement.rewardExp}  积分+${achievement.rewardScore}",
@@ -150,13 +166,13 @@ class ShareAchievementPage extends StatelessWidget {
                               Container(
                                 margin: EdgeInsets.only(top: 8.0),
                                 width: MediaQuery.of(context).size.width * 1,
-                                padding: EdgeInsets.fromLTRB(12, 9, 8, 9),
+                                padding: EdgeInsets.fromLTRB(12, 9,12, 9),
 //                                color: Colors.black,
                                 decoration: BoxDecoration(
                                     color: Colors.black,
                                     borderRadius: BorderRadius.only(
-                                        bottomLeft: Radius.circular(20),
-                                        bottomRight: Radius.circular(20))),
+                                        bottomLeft: Radius.circular(10),
+                                        bottomRight: Radius.circular(10))),
                                 child: Row(
                                   mainAxisAlignment:
                                       MainAxisAlignment.spaceBetween,
@@ -176,7 +192,7 @@ class ShareAchievementPage extends StatelessWidget {
                                           "这是一段产品sloagn",
                                           style: Theme.of(context)
                                               .textTheme
-                                              .bodyText2,
+                                              .bodyText1,
                                         )
                                       ],
                                     ),

+ 2 - 1
lib/pages/social/share_webview.dart

@@ -37,7 +37,8 @@ class _WebViewSharePageState extends State<WebViewSharePage> {
                 height: MediaQuery.of(context).size.height * 1,
                 child: WebView(
                   initialUrl:
-                      'http://shoes-web.hiyd.com/share?h=${widget.hash}',
+//                      'http://shoes-web.hiyd.com/share?h=${widget.hash}&t=${DateTime.now()}',
+                  "http://172.16.14.23:9090/share?h=${widget.hash}&t=${DateTime.now()}",
                   javascriptMode: JavascriptMode.unrestricted,
                   onWebViewCreated: (WebViewController webViewController) {
                     _controller.complete(webViewController);

+ 1 - 9
lib/pages/social/social_index_page.dart

@@ -77,15 +77,6 @@ class _PageState extends ViewStateLifecycle<SocialIndexPage, SocialIndexModel> w
                       buildSliverAppBar(context, "社区",
                           canBack: false,
                           actions: <Widget>[
-                            IconButton(
-                              icon: Image.asset("lib/assets/img/topbar_friendslist.png"),
-                              onPressed: () {
-                                NavigatorUtil.goPage(context, (context) => UserFriendPage());
-                              },
-                            ),
-                            SizedBox(
-                              width: 20,
-                            ),
                             Selector<SocialIndexModel, ViewState>(
                               selector: (_, SocialIndexModel model) => model.viewState,
                               shouldRebuild: (_, v) => v == ViewState.idle,
@@ -188,6 +179,7 @@ class _PageState extends ViewStateLifecycle<SocialIndexPage, SocialIndexModel> w
             ),
             Text(
               "输入关键词",
+              strutStyle: StrutStyle(forceStrutHeight: true),
               style: TextStyle(fontSize: 14, color: Color(0xff999999)),
             ),
           ],

+ 29 - 19
lib/pages/social/user_friend_add_page.dart

@@ -151,9 +151,13 @@ class _PageState extends ViewStateLifecycle<UserFriendAddPage, SimpleModel>
       appBar: AppBar(
         elevation: 0,
         leading: buildBackButton(context),
-        title: Text(
-          "添加好友",
-          style: titleStyle,
+        titleSpacing: -5,
+        title:Container(
+          alignment: Alignment.centerLeft,
+          child:  Text(
+            "添加好友",
+            style: titleStyle,
+          ),
         ),
         actions: <Widget>[
           IconButton(
@@ -192,15 +196,18 @@ class _PageState extends ViewStateLifecycle<UserFriendAddPage, SimpleModel>
               header: buildClassicalHeader(),
               footer: buildClassicalFooter(),
               slivers: <Widget>[
-                SliverPersistentHeader(
-                  delegate: PersistentHeader(
-                      min: 50,
-                      max: 50,
-                      child: Container(
-                        color: Colors.white,
-                        child: _searchWidget(context),
-                      )),
-                  pinned: true,
+//                SliverPersistentHeader(
+//                  delegate: PersistentHeader(
+////                      min: 50,
+////                      max: 50,
+//                      child: Container(
+//                        color: Colors.white,
+//                        child: _searchWidget(context),
+//                      )),
+//                  pinned: true,
+//                ),
+                SliverToBoxAdapter(
+                  child: _searchWidget(context),
                 ),
                 if (model.isBusy)
                   SliverToBoxAdapter(
@@ -222,10 +229,11 @@ class _PageState extends ViewStateLifecycle<UserFriendAddPage, SimpleModel>
                       childCount: model.list.length,
                     ),
                   ),
-                if (!model.isIdle && userCode != null)
-                  SliverToBoxAdapter(
-                      child: Padding(
-                    padding: EdgeInsets.only(top: 20.0),
+                if (!model.isIdle && userCode != null && _searchValue.value == "")
+                  SliverFillRemaining(
+                      child: Container(
+//                        height: double.infinity,
+                    alignment: Alignment.center,
                     child: Consumer<UserModel>(
                         builder: (_, model, __) => model.user == null
                             ? Center(
@@ -373,8 +381,8 @@ class _PageState extends ViewStateLifecycle<UserFriendAddPage, SimpleModel>
 
   Widget _searchWidget(BuildContext context) {
     return Container(
-      margin: EdgeInsets.fromLTRB(12.0, 6.0, 12.0, 6.0),
-      height: 40,
+      margin: EdgeInsets.fromLTRB(12.0, 11.0, 12.0, 6.0),
+      height: 35,
       padding: EdgeInsets.fromLTRB(12.0, 0, 12.0, 0),
       decoration: BoxDecoration(
         color: Color(0xffF1F1F1),
@@ -392,10 +400,12 @@ class _PageState extends ViewStateLifecycle<UserFriendAddPage, SimpleModel>
               controller: _controller,
               maxLines: 1,
               focusNode: _focusNode,
+              strutStyle: StrutStyle(forceStrutHeight: true),
               decoration: InputDecoration(
                 hintText: '输入账号/用户昵称',
-                // contentPadding: EdgeInsets.all(10),
                 border: InputBorder.none,
+                contentPadding: EdgeInsets.symmetric(
+                  vertical: 11.5,),
               ),
               onChanged: debounceValueChanged((value) {
                 _searchValue.value = value;

+ 66 - 42
lib/pages/social/user_friend_page.dart

@@ -68,10 +68,11 @@ class _PageState extends State<UserFriendPage> {
             return <Widget>[
               buildSliverAppBar(context, "好友列表", innerBoxIsScrolled: innerBoxIsScrolled, actions: <Widget>[
                 IconButton(
-                  icon: Text(
-                    "添加",
-                    style: TextStyle(fontSize: 15, color: Theme.of(context).accentColor),
-                  ),
+                  icon:Image.asset("lib/assets/img/bbs_icon_addmore.png",width: 22.0,height: 22.0,),
+//                  icon: Text(
+//                    "添加",
+//                    style: TextStyle(fontSize: 15, color: Theme.of(context).accentColor),
+//                  ),
                   onPressed: () async {
                     await NavigatorUtil.goPage(context, (context) => UserFriendAddPage());
                     setState(() {
@@ -177,37 +178,43 @@ class _PageDetailState extends ViewStateLifecycle<_PageDetailPage, UserFriendMod
               SliverToBoxAdapter(
                 child: _searchWidget(context),
               ),
-              if (widget.type == 2)
-                SliverToBoxAdapter(
-                  child: Center(
-                    child: Padding(
-                      padding: const EdgeInsets.all(8.0),
-                      child: Row(
-                        children: <Widget>[
-                          Image.asset("lib/assets/img/linkpop_icon_modify.png"),
-                          SizedBox(
-                            width: 6,
-                          ),
-                          Text(
-                            "互相关注后可成为好友",
-                            style: TextStyle(fontSize: 12, color: Color(0xffcecece)),
-                          )
-                        ],
-                        mainAxisSize: MainAxisSize.min,
-                      ),
-                    ),
-                  ),
-                ),
+//              if (widget.type == 2)
+//                SliverToBoxAdapter(
+//                  child: Center(
+//                    child: Padding(
+//                      padding: const EdgeInsets.all(8.0),
+//                      child: Row(
+//                        children: <Widget>[
+//                          Image.asset("lib/assets/img/linkpop_icon_modify.png"),
+//                          SizedBox(
+//                            width: 6,
+//                          ),
+//                          Text(
+//                            "互相关注后可成为好友",
+//                            style: TextStyle(fontSize: 12, color: Color(0xffcecece)),
+//                          )
+//                        ],
+//                        mainAxisSize: MainAxisSize.min,
+//                      ),
+//                    ),
+//                  ),
+//                ),
               if (model.isBusy)
                 SliverToBoxAdapter(
                   child: RequestLoadingWidget(),
                 ),
               if (model.isEmpty)
-                SliverToBoxAdapter(
-                  child: RequestErrorWidget(
-                    null,
-                    msg: widget.type == 0 ? "暂无好友~" : widget.type == 1 ? "暂无关注~" : "暂无关注我的~",
-                  ),
+                SliverFillRemaining(
+                  child:Container(
+                    alignment: Alignment.center,
+                    child: Center(
+                      child: RequestErrorWidget(
+                        null,
+                        msg: widget.type == 0 ? "暂无好友~" : widget.type == 1 ? "暂无关注~" : "暂无关注我的~",
+                        assets: "emptypage-image-nomotion.png",
+                      ),
+                    ),
+                  )
                 ),
               if (model.isIdle)
                 SliverList(
@@ -225,6 +232,7 @@ class _PageDetailState extends ViewStateLifecycle<_PageDetailPage, UserFriendMod
                       model.initData();
                     },
                     msg: widget.type == 0 ? "暂无好友~" : widget.type == 1 ? "暂无关注~" : "暂无关注我的~",
+                    assets: "emptypage-image-nomotion.png",
                   ),
                 ),
             ],
@@ -251,7 +259,7 @@ class _PageDetailState extends ViewStateLifecycle<_PageDetailPage, UserFriendMod
               children: <Widget>[
                 Text(
                   "${user?.socialInfo?.name}",
-                  style: Theme.of(context).textTheme.headline3,
+                  style: Theme.of(context).textTheme.headline3.copyWith(fontWeight: FontWeight.normal),
                 ),
                 SizedBox(
                   height: 5,
@@ -366,7 +374,7 @@ class _PageDetailState extends ViewStateLifecycle<_PageDetailPage, UserFriendMod
           Expanded(
             child: Text(
               "${user?.socialInfo?.name}",
-              style: Theme.of(context).textTheme.headline3,
+              style: Theme.of(context).textTheme.headline3.copyWith(fontWeight: FontWeight.normal),
             ),
           ),
           GestureDetector(
@@ -382,7 +390,7 @@ class _PageDetailState extends ViewStateLifecycle<_PageDetailPage, UserFriendMod
               decoration: BoxDecoration(
                 borderRadius: BorderRadius.circular(20),
                 border: Border.all(
-                  color: Color(0xff999999),
+                  color: Color(0xffDCDCDC),
                   width: .5,
                 ),
               ),
@@ -420,7 +428,7 @@ class _PageDetailState extends ViewStateLifecycle<_PageDetailPage, UserFriendMod
               children: <Widget>[
                 Text(
                   "${user?.socialInfo?.name}",
-                  style: Theme.of(context).textTheme.headline3,
+                  style: Theme.of(context).textTheme.headline3.copyWith(fontWeight: FontWeight.normal),
                 ),
                 SizedBox(
                   height: 5,
@@ -438,20 +446,23 @@ class _PageDetailState extends ViewStateLifecycle<_PageDetailPage, UserFriendMod
     return Column(
       children: <Widget>[
         Padding(
-          padding: const EdgeInsets.all(12.0),
+          padding: const EdgeInsets.symmetric(horizontal: 12.0,vertical: 12.0),
           child: InkWell(
               onTap: () async {
-                if(widget.type == 0)  await NavigatorUtil.goPage(context, (context) => ChatPage(user?.socialInfo));
-                else await NavigatorUtil.goPage(
+//                if(widget.type == 0)  await NavigatorUtil.goPage(context, (context) => ChatPage(user?.socialInfo));
+//                else
+                await NavigatorUtil.goPage(
                     context,
-                    (context) => UserDetailPage(PostUser(id: "${user?.socialInfo?.id}", name: user?.socialInfo?.name, avatar: user?.socialInfo?.avatar),
+                        (context) => UserDetailPage(PostUser(id: "${user?.socialInfo?.id}", name: user?.socialInfo?.name, avatar: user?.socialInfo?.avatar),
                         userFriends: model.list));
                 setState(() {});
               },
               child: child),
         ),
         Divider(
+          indent: 12.0,
           height: 1,
+          endIndent: 12.0,
         )
       ],
     );
@@ -459,9 +470,10 @@ class _PageDetailState extends ViewStateLifecycle<_PageDetailPage, UserFriendMod
 
   Widget _searchWidget(BuildContext context) {
     return Container(
-      margin: EdgeInsets.fromLTRB(12.0, 6.0, 12.0, 6.0),
-      height: 40,
-      padding: EdgeInsets.fromLTRB(12.0, 0, 12.0, 0),
+      margin: EdgeInsets.fromLTRB(12.0, 0, 12.0, 0),
+      height: 35,
+//      padding: EdgeInsets.symmetric(horizontal: 12.0),
+//      padding: EdgeInsets.fromLTRB(12.0, 0, 12.0, 0),
       decoration: BoxDecoration(
         color: Color(0xffF1F1F1),
         shape: BoxShape.rectangle,
@@ -469,6 +481,9 @@ class _PageDetailState extends ViewStateLifecycle<_PageDetailPage, UserFriendMod
       ),
       child: Row(
         children: <Widget>[
+          SizedBox(
+            width: 12.0,
+          ),
           Image.asset("lib/assets/img/searchbar_icon_search.png"),
           SizedBox(
             width: 6,
@@ -478,10 +493,15 @@ class _PageDetailState extends ViewStateLifecycle<_PageDetailPage, UserFriendMod
               controller: _controller,
               maxLines: 1,
               focusNode: _focusNode,
+              strutStyle: StrutStyle(forceStrutHeight: true),
               decoration: InputDecoration(
                 hintText: '输入账号/用户昵称',
-                // contentPadding: EdgeInsets.all(10),
                 border: InputBorder.none,
+                contentPadding: EdgeInsets.symmetric(
+                    vertical: 11.5,),
+                hintStyle:  TextStyle(
+                  color:Color(0xff999999),
+                ),
               ),
               onChanged: (value) {
                 _searchValue.value = value;
@@ -492,6 +512,9 @@ class _PageDetailState extends ViewStateLifecycle<_PageDetailPage, UserFriendMod
                 // _searchModel.setKeyword(value);
                 // Provider.of<SearchModel>(context, listen: false).queryValue(value);
               },
+                style: TextStyle(
+                  color:Color(0xff333333),
+                ),
             ),
           ),
           Visibility(
@@ -511,6 +534,7 @@ class _PageDetailState extends ViewStateLifecycle<_PageDetailPage, UserFriendMod
     );
   }
 
+
   @override
   UserFriendModel createModel() => UserFriendModel(widget.type);
 

+ 12 - 7
lib/sharesdk/wechat.dart

@@ -34,11 +34,15 @@ mixin WechatMixin<T extends StatefulWidget> on State<T> {
         universalLink: WECHAT_UNIVERSAL_LINK,
       );
     // _auth = _wechat.authResp().listen(_listenAuth);
-    // _share = _wechat.shareMsgResp().listen(_listenShareMsg);
+     _share = _wechat.shareMsgResp().listen(listenShareMsg);
     // _pay = _wechat.payResp().listen(_listenPay);
     // _miniProgram = _wechat.launchMiniProgramResp().listen(_listenMiniProgram);
   }
 
+  listenShareMsg(WechatSdkResp resp){
+
+  }
+
   // wechat 登录
   void wechatLogin(WeChatLogin weChatLogin) async {
     if (await _wechat.isInstalled() && await _wechat.isSupportApi()) {
@@ -86,34 +90,35 @@ mixin WechatMixin<T extends StatefulWidget> on State<T> {
 //    await _wechat.shareImage(scene: WechatScene.SESSION, imageData: File(path).readAsBytesSync());
 //  }
 
-  void wechatShareImage(String path, String type) async {
+  Future<void> wechatShareImage(String path, String type) async {
     if (type == "chat") {
       // 这是 聊天
-      await _wechat.shareImage(
+      return _wechat.shareImage(
           scene: WechatScene.SESSION, imageData: File(path).readAsBytesSync());
     } else if (type == "friend") {
       // 这是朋友圈
-      await _wechat.shareImage(
+      return _wechat.shareImage(
           scene: WechatScene.TIMELINE, imageData: File(path).readAsBytesSync());
     }
   }
 
-  void wechatShareLink(String url, String type, String username) async {
+  Future<void> wechatShareLink(String url, String type, String username) async {
     if (type == "chat") {
-      _wechat.shareWebpage(
+     await _wechat.shareWebpage(
           scene: WechatScene.SESSION,
           webpageUrl: url,
           title: "$username分享了他的运动记录,快来围观吧~",
           description: "$username分享了他的运动记录,快来围观吧~"
       );
     } else if (type == "friend") {
-      _wechat.shareWebpage(
+      await _wechat.shareWebpage(
           scene: WechatScene.TIMELINE,
           webpageUrl: url,
           title: "$username分享了他的运动记录,快来围观吧~",
           description: "$username分享了他的运动记录,快来围观吧~"
       );
     }
+    return;
   }
 
   void dispose() {

+ 2 - 2
lib/widgets/appbar.dart

@@ -53,11 +53,11 @@ Widget buildFlexibleSpace(String title, {paddingLeading = true}) {
   });
 }
 
-Widget buildActionButton(String title, VoidCallback onPressed) {
+Widget buildActionButton(String title, VoidCallback onPressed,{Color textColor}) {
   return IconButton(
     icon: Text(
       title,
-      style: TextStyle(fontSize: 16),
+      style: textColor != null ? TextStyle(fontSize: 16.0,color: textColor) :TextStyle(fontSize: 16),
     ),
     onPressed: onPressed,
   );

+ 190 - 152
lib/widgets/dialog/share_popup.dart

@@ -7,6 +7,7 @@ import 'package:sport/bean/user.dart';
 import 'package:sport/pages/social/chat_page.dart';
 import 'package:sport/pages/social/share_achievement.dart';
 import 'package:sport/router/navigator_util.dart';
+import 'package:sport/widgets/button_primary.dart';
 
 import '../space.dart';
 
@@ -58,172 +59,208 @@ class sharePopup extends StatefulWidget {
 
 class _sharePopupState extends State<sharePopup> {
   bool showCloseButton = true;
-  Widget content(Achievement e) {
-    return Container(
-//      width: MediaQuery.of(context).size.width * 1,
-      child: Column(
-        mainAxisAlignment: MainAxisAlignment.center,
-        children: <Widget>[
-          Container(
-            padding: EdgeInsets.only(bottom: 20.0),
+  Widget content(Achievement e, int index, int length) {
+    print("${index}-------------------------");
+    return Column(
+      mainAxisAlignment: MainAxisAlignment.center,
+      children: <Widget>[
+        Container(
+          padding: EdgeInsets.only(bottom: 20.0),
 //            height: MediaQuery.of(context).size.height * 0.7,
-            width: MediaQuery.of(context).size.width * 0.7,
-            decoration: BoxDecoration(
-                borderRadius: BorderRadius.all(Radius.circular(20.0)),
-                color: Colors.white,
-                border: Border.all(color: Color(0xf2f2f2f2))),
-            child: Column(
-              crossAxisAlignment: CrossAxisAlignment.center,
-              children: <Widget>[
-                Space(
-                  height: 36.0,
-                ),
-                Text(
-                  "恭喜您达到新成就",
-                  style: Theme.of(context).textTheme.headline3,
-                ),
-                Space(
-                  height: 5.0,
-                ),
-                Text(
-                  "您是第${e.userCount}位获得者",
-                  style: Theme.of(context).textTheme.bodyText1,
-                ),
-                Space(
-                  height: 16.0,
-                ),
-                CachedNetworkImage(
+          width: MediaQuery.of(context).size.width * 0.7,
+          decoration: BoxDecoration(
+            borderRadius: BorderRadius.all(Radius.circular(10.0)),
+            boxShadow: [
+              BoxShadow(
+                  offset: Offset(0.0, 0),
+                  blurRadius: 5,
+                  spreadRadius: 0,
+                  color: Color.fromRGBO(0, 0, 0, 0.1))
+            ],
+            color: Colors.white.withOpacity(1 - index * 0.12),
+//                border: Border.all(color: Color(0xf2f2f2f2))
+//              image: DecorationImage(
+//                  image:
+//                      AssetImage("lib/assets/img/bg_pop_achievement.png"))
+          ),
+          child: Column(
+            crossAxisAlignment: CrossAxisAlignment.center,
+            children: <Widget>[
+              Space(
+                height: 30.0,
+              ),
+              Text(
+                "恭喜您达到新成就",
+                style: Theme.of(context).textTheme.headline3,
+              ),
+              Space(
+                height: 5.0,
+              ),
+              Text(
+                "您是第${e.userCount}位获得者",
+                style: Theme.of(context).textTheme.bodyText1,
+              ),
+              Space(
+                height: 16.0,
+              ),
+              Container(
+                width: double.infinity,
+                decoration: BoxDecoration(
+                    image: DecorationImage(
+                        image: AssetImage(
+                            "lib/assets/img/bg_pop_achievement.png"))),
+                child: CachedNetworkImage(
                   imageUrl: e.logo,
                   width: 120.0,
                   height: 120.0,
                 ),
-                Space(
-                  height: 8.0,
-                ),
-                Text(
-                  "${e.name}",
-                  style: Theme.of(context).textTheme.headline1,
-                ),
-                Space(
-                  height: 16.0,
+              ),
+              Space(
+                height: 8.0,
+              ),
+              Text(
+                "${e.name}",
+                style: Theme.of(context).textTheme.headline1,
+              ),
+              Space(
+                height: 16.0,
+              ),
+              Text(
+                "${e.conditionDetail}",
+                style: Theme.of(context).textTheme.bodyText1,
+              ),
+              Space(
+                height: 5.0,
+              ),
+              Container(
+                height: 25.0,
+                width: MediaQuery.of(context).size.width * 0.6,
+//                  color: Color(0xffFFC400).withOpacity(0.3),
+                alignment: Alignment.center,
+                decoration: BoxDecoration(
+//                  gradient: new RadialGradient(radius: 4, colors: [
+//                    Color.fromRGBO(255, 196, 0, 1).withAlpha(80),
+//                    Color(0x00ffffff),
+//                  ]),
+                    image: DecorationImage(
+                        image: AssetImage(
+                            "lib/assets/img/bg1_pop_achievement.png"))),
+                child: Text(
+                  "经验值+${e.rewardExp}  积分+${e.rewardScore}",
+                  style: Theme.of(context)
+                      .textTheme
+                      .subtitle2
+                      .copyWith(color: Theme.of(context).accentColor),
                 ),
-                Text(
-                  "${e.conditionDetail}",
-                  style: Theme.of(context).textTheme.bodyText1,
+              ),
+              Space(
+                height: 16.0,
+              ),
+              Container(
+                width: 132.0,
+                height: 35.0,
+                alignment: Alignment.center,
+                decoration: BoxDecoration(
+                  borderRadius: BorderRadius.all(Radius.circular(20.0)),
+                  border: new Border.all(
+                      width: 1, color: Theme.of(context).accentColor),
+                  gradient: new LinearGradient(
+                      begin: Alignment.centerLeft,
+                      end: Alignment.centerRight,
+                      colors: [
+                        Color.fromRGBO(255, 196, 0, 1),
+                        Color.fromRGBO(255, 170, 0, 1),
+                      ]),
                 ),
-                Space(
-                  height: 5.0,
+//                  child: InkWell(
+//                    child: Text(
+//                      "成就分享",
+//                      style: Theme.of(context).textTheme.headline6,
+//                    ),
+//                    onTap: () {
+//                      if (widget.list.length != 1) {
+//                        setState(() {
+//                          widget.list =
+//                              widget.list.sublist(0, widget.list.length - 1);
+//                        });
+//                      } else {
+//                        Navigator.pop(context);
+//                      }
+//                      NavigatorUtil.goPage(
+//                          context, (context) => ShareAchievementPage(e));
+//                    },
+//                  ),
+                child: PrimaryButton(
+                  content: "成就分享",
+                  callback: () {
+                    if (widget.list.length != 1) {
+                      setState(() {
+                        widget.list =
+                            widget.list.sublist(0, widget.list.length - 1);
+                      });
+                    } else {
+                      Navigator.pop(context);
+                    }
+                    NavigatorUtil.goPage(
+                        context, (context) => ShareAchievementPage(e));
+                  },
+                  height: 35,
+//                    fontSize: 12.0,
                 ),
-                Container(
-                  height: 25.0,
-                  width: MediaQuery.of(context).size.width * 0.6,
-//                  color: Color(0xffFFC400).withOpacity(0.3),
-                  alignment: Alignment.center,
-                  decoration: BoxDecoration(
-                    gradient: new RadialGradient(
-                      radius: 4,
-                        colors: [
-                          Color.fromRGBO(255, 196, 0, 1).withAlpha(80),
-                          Color(0x00ffffff),
-                        ]),
+              ),
+              Space(
+                height: 8.0,
+              ),
+              Row(
+                mainAxisAlignment: MainAxisAlignment.center,
+                children: <Widget>[
+                  Expanded(
+                    child: Divider(
+                      indent: 50.0,
+                      endIndent: 10.0,
+                    ),
                   ),
-                  child: Text(
-                    "经验值+${e.rewardExp}  积分+${e.rewardScore}",
+                  Text(
+                    "${e.createdAt.split(" ")[0]}",
                     style: Theme.of(context)
                         .textTheme
-                        .subtitle2
-                        .copyWith(color: Theme.of(context).accentColor),
-                  ),
-                ),
-                Space(
-                  height: 16.0,
-                ),
-                Container(
-                  width: 132.0,
-                  height: 35.0,
-                  alignment: Alignment.center,
-                  decoration: BoxDecoration(
-                    borderRadius: BorderRadius.all(Radius.circular(20.0)),
-                    border: new Border.all(
-                        width: 1, color: Theme.of(context).accentColor),
-                    gradient: new LinearGradient(
-                        begin: Alignment.centerLeft,
-                        end: Alignment.centerRight,
-                        colors: [
-                          Color.fromRGBO(255, 196, 0, 1),
-                          Color.fromRGBO(255, 170, 0, 1),
-                        ]),
+                        .bodyText1
+                        .copyWith(fontSize: 11.0),
                   ),
-                  child: InkWell(
-                    child: Text(
-                      "成就分享",
-                      style: Theme.of(context).textTheme.headline6,
+                  Expanded(
+                    child: Divider(
+                      indent: 10.0,
+                      endIndent: 50.0,
                     ),
-                    onTap: () {
-                      if (widget.list.length != 1) {
-                        setState(() {
-                          widget.list =
-                              widget.list.sublist(0, widget.list.length - 1);
-                        });
-                      } else {
-                        Navigator.pop(context);
-                      }
-                      NavigatorUtil.goPage(
-                          context, (context) => ShareAchievementPage(e));
-                    },
                   ),
-                ),
-                Space(
-                  height: 8.0,
-                ),
-                Row(
-                  mainAxisAlignment: MainAxisAlignment.center,
-                  children: <Widget>[
-                    Expanded(
-                      child: Divider(
-                        indent: 50.0,
-                        endIndent: 10.0,
-                      ),
-                    ),
-                    Text(
-                      "${e.createdAt}",
-                      style: Theme.of(context).textTheme.bodyText1,
-                    ),
-                    Expanded(
-                      child: Divider(
-                        indent: 10.0,
-                        endIndent: 50.0,
-                      ),
-                    ),
-                  ],
-                ),
-              ],
-            ),
-//            padding: EdgeInsets.only(bottom: 20.0),
+                ],
+              ),
+            ],
           ),
-          Padding(
-            padding: EdgeInsets.only(top: 20.0),
-            child: widget.list.length > 0 && 0 == widget.list.indexOf(e)
-                ? InkWell(
-                    child: Image.asset("lib/assets/img/pop_share_chose.png"),
-                    onTap: () {
-                      if (widget.list.length != 1) {
-                        widget.list.removeAt(0);
-                        setState(() {
-                          widget.list = widget.list;
-                        });
-                      } else {
-                        Navigator.of(context).pop();
-                      }
-                    },
-                  )
-                : Container(
-                    width: 35.0,
-                    height: 35.0,
-                  ),
-          )
-        ],
-      ),
+//            padding: EdgeInsets.only(bottom: 20.0),
+        ),
+        Padding(
+          padding: EdgeInsets.only(top: 20.0),
+          child: widget.list.length > 0 && 0 == widget.list.indexOf(e)
+              ? InkWell(
+                  child: Image.asset("lib/assets/img/pop_share_chose.png"),
+                  onTap: () {
+                    if (widget.list.length != 1) {
+                      widget.list.removeAt(0);
+                      setState(() {
+                        widget.list = widget.list;
+                      });
+                    } else {
+                      Navigator.of(context).pop();
+                    }
+                  },
+                )
+              : Container(
+                  width: 35.0,
+                  height: 35.0,
+                ),
+        )
+      ],
     );
   }
 
@@ -247,7 +284,8 @@ class _sharePopupState extends State<sharePopup> {
 //                      padding: EdgeInsets.only(
 //                          right: (data.indexOf(e)) * 10.0,
 //                          top: (data.indexOf(e)) * 10.0),
-                      child: content(e));
+                      child: content(
+                          e, widget.list.indexOf(e), widget.list.length));
                 }).toList(),
               ),
             ),

+ 181 - 137
lib/widgets/menu_bar.dart

@@ -17,6 +17,10 @@ import 'package:sport/services/api/inject_api.dart';
 import 'package:sport/utils/toast.dart';
 import 'package:sport/widgets/button_primary.dart';
 import 'package:sport/widgets/decoration.dart';
+import 'package:sport/widgets/space.dart';
+
+import '../application.dart';
+import 'dialog/request_dialog.dart';
 
 class MenuBar extends StatefulWidget {
   final String inputField;
@@ -70,6 +74,8 @@ class _MenuBarState extends State<MenuBar>
 
   Timer _timer;
 
+  bool showInput = true;
+
   @override
   void didUpdateWidget(MenuBar oldWidget) {
     super.didUpdateWidget(oldWidget);
@@ -126,6 +132,12 @@ class _MenuBarState extends State<MenuBar>
     widget.sendCallBack(message); // 添加完 在 callBack...
   }
 
+  _postFeedBackpostFeedBack(String content, {int typeId = 0}) async {
+    typeId == null ? typeId = 0 : typeId = typeId;
+    await api.postFeedback(typeId, content,
+        extra: await Application.getDeviceInfo());
+  }
+
   Widget extMenuItem(
     String text,
     String url,
@@ -172,14 +184,17 @@ class _MenuBarState extends State<MenuBar>
             file.delete();
           }
         }
-        if (urls.length > 0) {
-          for (int i = 0; i < urls.length; i++) {
-            MessageInstance message = (await api.postChatSend(
-                    widget.menuIdentity.userId,
-                    "image",
-                    '{"url":"${urls[i]}"}'))
-                .data;
-            add(message);
+
+        if (widget.menuIdentity.menuScene == "chat") {
+          if (urls.length > 0) {
+            for (int i = 0; i < urls.length; i++) {
+              MessageInstance message = (await api.postChatSend(
+                      widget.menuIdentity.userId,
+                      "image",
+                      '{"url":"${urls[i]}"}'))
+                  .data;
+              add(message);
+            }
           }
         }
       } on Exception catch (e) {
@@ -190,18 +205,23 @@ class _MenuBarState extends State<MenuBar>
     void getPhoto() async {
       try {
         // 拍完直接发...
-        final pickedFile =
-            await new ImagePicker().getImage(source: ImageSource.camera);
+        final pickedFile = await new ImagePicker()
+            .getImage(source: ImageSource.camera, imageQuality: 70);
+
         // 如果是聊天 直接发 ...
         if (widget.menuIdentity.menuScene == "chat") {
-          // 先上传
-          String url = (await api.postChatUpload(File(pickedFile.path))).data;
-          MessageInstance message = (await api.postChatSend(
-                  widget.menuIdentity.userId,
-                  "image",
-                  '{ "data":{ "url":"$url" }}'))
-              .data;
-          add(message);
+          await request(context, () async {
+            // 先上传
+            var data = (await api.postChatUpload(File(pickedFile.path))).data;
+            print(data['url']);
+//          print("${data}-----------------------------");
+            MessageInstance message = (await api.postChatSend(
+                    widget.menuIdentity.userId,
+                    "image",
+                    '{ "url":"${data['url']}" }'))
+                .data;
+            add(message);
+          });
         }
       } on Exception catch (e) {
         error = e.toString();
@@ -267,6 +287,8 @@ class _MenuBarState extends State<MenuBar>
                       selection: TextSelection.fromPosition(TextPosition(
                           affinity: TextAffinity.downstream,
                           offset: content.length)));
+                  // 主要是 onchange 没有办法 加上 表情 ...
+                  setState(() {});
                 },
                 child: Center(
                   child: Text(
@@ -330,135 +352,157 @@ class _MenuBarState extends State<MenuBar>
             children: <Widget>[
               Flexible(
                   child: GestureDetector(
-                    onTap: () {
-                      setState(() {
-                        isShowMenuBottomIndex = 0;
-                      });
-                      _focusNode.unfocus();
-                    },
-                    child: widget.messageList,
-                  )),
+                onTap: () {
+                  setState(() {
+                    isShowMenuBottomIndex = 0;
+                  });
+                  _focusNode.unfocus();
+                },
+                child: widget.messageList,
+              )),
             ],
           ),
         ),
-//        Expanded(
-//          child: Container(),
-//        ),
-        ConstrainedBox(
-            key: _myKey,
-            constraints: BoxConstraints(maxHeight: 150, minHeight: 50),
-            child: Container(
-                padding:
-                const EdgeInsets.symmetric(vertical: 8.0, horizontal: 12.0),
-                decoration: shadowTop(),
-                child: Column(
-                  mainAxisSize: MainAxisSize.min,
-                  children: <Widget>[
-                    Row(
-                      children: <Widget>[
-                        GestureDetector(
-                          onTap: () {
-                            if (_focusNode.hasFocus) {
-                              SystemChannels.textInput
-                                  .invokeMethod('TextInput.hide');
-                            }
-                            setState(() {
-                              isShowMenuBottomIndex = 2;
-                            });
-                          },
-                          child: Padding(
+        if (showInput)
+//          Column(
+//            children: <Widget>[
+////              Container(
+////                color: Colors.white,
+////                padding: EdgeInsets.only(top: 10.0,left: 10.0,right: 10.0,bottom: 10.0),
+////                child:
+////              ),
+//              ,
+//            ],
+//          ),
+          Container(
+              padding: const EdgeInsets.symmetric(
+                  vertical: 8.0, horizontal: 12.0),
+              decoration: shadowTop(),
+              child: Row(
+                children: <Widget>[
+                  GestureDetector(
+                    onTap: () async {
+                      if (_focusNode.hasFocus) {
+                        await SystemChannels.textInput
+                            .invokeMethod('TextInput.hide');
+                        setState(() {
+                          isShowMenuBottomIndex = 2;
+                        });
+                      } else {
+                        setState(() {
+                          isShowMenuBottomIndex = 2;
+                        });
+                      }
+                    },
+                    child: Padding(
 //                padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 12.0),
-                            child: Image.asset(
-                                "lib/assets/img/bbs_icon_addmore.png"),
-                            padding: EdgeInsets.only(right: 12.0),
-                          ),
-                        ),
-                        GestureDetector(
-                          onTap: () {
-                            setState(() {
-                              FocusScope.of(context).requestFocus(_focusNode);
-                              if (_focusNode.hasFocus) {
-                                SystemChannels.textInput
-                                    .invokeMethod('TextInput.hide');
-                              }
-                              isShowMenuBottomIndex = 3;
-                            });
-                          },
-                          child: Padding(
+                      child: Image.asset(
+                          "lib/assets/img/bbs_icon_addmore.png"),
+                      padding: EdgeInsets.only(right: 12.0),
+                    ),
+                  ),
+                  GestureDetector(
+                    onTap: () {
+                      setState(() {
+                        isShowMenuBottomIndex = 3;
+                        FocusScope.of(context).requestFocus(_focusNode);
+                        if (_focusNode.hasFocus) {
+                          SystemChannels.textInput
+                              .invokeMethod('TextInput.hide');
+                        }
+                      });
+                    },
+                    child: Padding(
 //                padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 12.0),
-                            child: Image.asset(
-                                "lib/assets/img/bbs_icon_expression.png"),
-                            padding: EdgeInsets.only(right: 12.0),
-                          ),
-                        ),
-                        Expanded(
-                          flex: 7,
-                          child: Container(
-                            child: TextField(
-                              controller: _controller,
-                              focusNode: _focusNode,
-                              keyboardType: TextInputType.multiline,
-                              minLines: 1,
-                              maxLines: 3,
+                      child: Image.asset(
+                          "lib/assets/img/bbs_icon_expression.png"),
+                      padding: EdgeInsets.only(right: 12.0),
+                    ),
+                  ),
+                  Expanded(
+                    child: TextField(
+                      controller: _controller,
+                      focusNode: _focusNode,
+                      keyboardType: TextInputType.multiline,
+                      style: TextStyle(
+                        fontSize: 16.0,
+                      ),
+                      strutStyle: StrutStyle(forceStrutHeight: true, height: 1.4),
+                      minLines: 1,
+                      maxLines: 3,
 //                              maxLength: 200,
-                              onChanged: (value) {
-                                setState(() {
+                      onChanged: (value) {
+                        setState(() {
 //                                  _textFieldValue = value;
-                                });
-                              },
-                              onTap: () {
-                                setState(() {
-                                  isShowMenuBottomIndex = 1;
-                                });
-                                widget.scrollToBottom();
-                              },
-                              decoration: InputDecoration(
-                                  counterText: "",
-                                  hintText: "${widget.inputField}",
-                                  contentPadding:
-                                  EdgeInsets.symmetric(vertical: 16.0),
-                                  border: InputBorder.none),
-                            ),
-                          ),
+                        });
+                      },
+                      onTap: () {
+                        setState(() {
+                          isShowMenuBottomIndex = 1;
+                        });
+                        widget.scrollToBottom();
+                      },
+                      decoration: InputDecoration(
+                        filled: true,
+                        fillColor: Color(0xfff1f1f1),
+                        counterText: "",
+                        hintText: "${widget.inputField}",
+                        contentPadding:
+                        EdgeInsets.symmetric(horizontal: 10.0, vertical: 0.0),
+                        border: OutlineInputBorder(
+                          borderSide:
+                          BorderSide(color: Color(0xfff1f1f1), width: 0.5),
+                          borderRadius: BorderRadius.all(Radius.circular(44.0)),
                         ),
-                        Expanded(
-                          flex: 3,
-                          child: PrimaryButton(
-                            content: "发送",
-                            callback: () async {
-                              if (_controller.text.length <= 0) {
-                                ToastUtil.show("请输入正确的内容");
-                                return;
-                              }
-
-                              if (widget.menuIdentity.menuScene == "chat") {
-                                MessageInstance message =
-                                    (await api.postChatSend(
-                                        widget.menuIdentity.userId,
-                                        "text",
-                                        '{"text":"${_controller.text}"}'))
-                                        .data;
-
-                                await add(
-                                    message); // await 是等待的标志 我等待完 在做后面的init 的事?
-                                _controller.text = "";
-
-                                // 调整高度...
-//                                  widget.scrollToBottom(context,
-//                                      widget.globalkey, false); //发完还得 调整一手 ...
-                              }
-                              // 这里可能传不了 callback 所有需要的值都在menu bar里面 只能通过传 不同的 场景 进行 不同的操作
-                            },
-                            shadow: _controller.text.length <= 0 ? false : true,
-                            buttonColor: _controller.text == ""
-                                ? Color(0xffd2d2d2)
-                                : null,
-                          ),
+                        focusedBorder: OutlineInputBorder(
+                          borderSide:
+                          BorderSide(color: Color(0xfff1f1f1), width: 1.0),
+                          borderRadius: BorderRadius.all(Radius.circular(10.0)),
                         ),
-                      ],
+                        enabledBorder: OutlineInputBorder(
+                          borderSide:
+                          BorderSide(color: Color(0xfff1f1f1), width: 0.5),
+                          borderRadius: BorderRadius.all(Radius.circular(10.0)),
+                        ),
+                      ),
                     ),
-                  ],
-                ))),
+                  ),
+                  Space(
+                    width: 5.0,
+                  ),
+                  PrimaryButton(
+                    width: 75,
+                    height: 35.0,
+                    content: "发送",
+                    callback: () async {
+                      if (_controller.text.length <= 0) {
+                        ToastUtil.show("请输入正确的内容");
+                        return;
+                      }
+
+                      if (widget.menuIdentity.menuScene == "chat") {
+                        MessageInstance message = (await api.postChatSend(
+                            widget.menuIdentity.userId,
+                            "text",
+                            '{"text":"${_controller.text}"}'))
+                            .data;
+
+                        await add(
+                            message); // await 是等待的标志 我等待完 在做后面的init 的事?
+                        _controller.text = "";
+                      }
+                      if (widget.menuIdentity.menuScene == "feedback") {
+                        await _postFeedBackpostFeedBack(_textFieldValue);
+                      }
+
+                      // 这里可能传不了 callback 所有需要的值都在menu bar里面 只能通过传 不同的 场景 进行 不同的操作
+                    },
+                    shadow: _controller.text.length <= 0 ? false : true,
+                    buttonColor:
+                    _controller.text == "" ? Color(0xffd2d2d2) : null,
+                  ),
+                ],
+              )),
         // 底部的骚操作
         menuBottom(),
       ],

+ 27 - 10
lib/widgets/menu_share_bottom.dart

@@ -15,9 +15,12 @@ import 'package:sport/utils/toast.dart';
 import 'package:path_provider/path_provider.dart';
 import 'package:sport/sharesdk/tencent.dart';
 import 'package:sport/sharesdk/wechat.dart';
+import 'package:sport/widgets/space.dart';
 import 'dart:io';
 import 'dart:typed_data';
 
+import 'package:wechat_kit/wechat_kit.dart';
+
 class MenuShareBottomContent extends StatefulWidget {
   final String url; // 复制的那个链接
   final bool hasDownload; // 有些又download 有些没download
@@ -45,6 +48,13 @@ class _MenuShareBottomContentState extends State<MenuShareBottomContent>
     with TencentMixin, WechatMixin, InjectApi {
   List<Map<String, dynamic>> map;
   Uint8List postInstance;
+
+  @override
+  listenShareMsg(WechatSdkResp resp) {
+    Navigator.pop(context);
+    ToastUtil.show("分享成功");
+  }
+
   @override
   void initState() {
     // TODO: implement initState
@@ -104,11 +114,12 @@ class _MenuShareBottomContentState extends State<MenuShareBottomContent>
                     ));
           } else if (widget.shareType == "Img") {
             String path = await initFile();
-
+            print("$path---------------------------------");
+            Future.delayed(new Duration(milliseconds: 200));
             await NavigatorUtil.goPage(
                 context, (context) => PostSharePage(image: path));
           }
-          Navigator.pop(context,true);
+          Navigator.pop(context, true);
         }
       },
       {
@@ -121,7 +132,6 @@ class _MenuShareBottomContentState extends State<MenuShareBottomContent>
                 (context) => PostShareFriendsPage(
                       post: widget.post,
                     ));
-
           } else if (widget.shareType == "Link") {
             // 这里可能得组装一手 link 的 数据 ...
             await NavigatorUtil.goPage(
@@ -129,13 +139,14 @@ class _MenuShareBottomContentState extends State<MenuShareBottomContent>
           } else if (widget.shareType == "Img") {
             String path = await initFile();
             String url = (await api.postChatUpload(File(path))).data["url"];
+
             await NavigatorUtil.goPage(
                 context,
                 (context) => PostShareFriendsPage(
                       image: url,
                     ));
           }
-          Navigator.pop(context,true);
+          Navigator.pop(context, true);
         }
       },
       {
@@ -173,7 +184,7 @@ class _MenuShareBottomContentState extends State<MenuShareBottomContent>
   // 封装成灵活的更通用一点...
   Future<String> initFile() async {
     Uint8List pngBytes = await initFileUint8List();
-
+    print("$pngBytes------------------------------");
     String sTempDir = (await getTemporaryDirectory()).path;
     bool isDirExist = await Directory(sTempDir).exists();
     if (!isDirExist) {
@@ -181,8 +192,12 @@ class _MenuShareBottomContentState extends State<MenuShareBottomContent>
     }
     // QQ分享需要一个确实存在的图片
     File file = await File(
-            sTempDir + "/poster-temp-${DateTime.now().millisecondsSinceEpoch}")
+            sTempDir + "/poster-temp-${DateTime.now().millisecondsSinceEpoch}.png")
         .writeAsBytes(pngBytes);
+
+
+
+    print("[file]:${file.readAsBytesSync().length}---------------${pngBytes.length}----------------");
     return file.path;
   }
 
@@ -217,7 +232,7 @@ class _MenuShareBottomContentState extends State<MenuShareBottomContent>
     // TODO: implement build
     return SizedBox(
       child: Container(
-        margin: EdgeInsets.fromLTRB(24, 27, 24, 17),
+        margin: EdgeInsets.fromLTRB(24, 23, 24, 17),
         child: Column(
           children: <Widget>[
             Row(
@@ -246,7 +261,7 @@ class _MenuShareBottomContentState extends State<MenuShareBottomContent>
                   gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
                       crossAxisCount: 4,
                       crossAxisSpacing: 12.0,
-                      mainAxisSpacing: 12.0),
+                      mainAxisSpacing: 18.0),
                   children: map
                       .map(
                         (e) => InkWell(
@@ -258,10 +273,12 @@ class _MenuShareBottomContentState extends State<MenuShareBottomContent>
                                 width: 44.0,
                                 height: 44.0,
                               ),
+                              Space(height: 6.0,),
                               Text(
                                 "${e["value"]}",
                                 style: Theme.of(context).textTheme.subtitle2,
-                              )
+                              ),
+//                              Space(height: 8.0,),
                             ],
                           ),
                           onTap: () {
@@ -295,7 +312,7 @@ Future<bool> menuShareBottom(BuildContext context, String shareType,
     elevation: 10,
     shape: RoundedRectangleBorder(
       borderRadius: BorderRadius.only(
-          topLeft: Radius.circular(20), topRight: Radius.circular(20)),
+          topLeft: Radius.circular(10), topRight: Radius.circular(10)),
     ),
   );
 }