Skip to content

Commit cf77260

Browse files
committed
Merge branch 'dev'
合并dev代码
2 parents a7ce957 + 22335b2 commit cf77260

File tree

9 files changed

+249
-47
lines changed

9 files changed

+249
-47
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
master: 各个功能完整,且稳定,出现Bug优先处理
3939
dev: 笔者的开发分支,意识流且不稳定,但知识或技术会超前 master 分支,按需加载。
4040
```
41+
- 真机调试
42+
+ **Android:** `HUAWEI P30`
43+
+ **iPhone:** `iPhone 7 Plus`
44+
4145
---
4246

4347
### 期待

lib/components/photo_browser/photo_browser.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ class _PhotoBrowserState extends State<PhotoBrowser> {
9696
itemCount: widget.photos.length,
9797
loadingBuilder: (context, progress) => Center(
9898
child: Container(
99-
width: FlutterScreenUtil.ScreenUtil().setWidth(30.0),
100-
height: FlutterScreenUtil.ScreenUtil().setWidth(30.0),
99+
width: FlutterScreenUtil.ScreenUtil().setWidth(30.0 * 3.0),
100+
height: FlutterScreenUtil.ScreenUtil().setWidth(30.0 * 3.0),
101101
child: CircularProgressIndicator(
102102
backgroundColor: Colors.black45,
103103
valueColor: new AlwaysStoppedAnimation<Color>(Colors.white),

lib/constant/cache_key.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,9 @@ class CacheKey {
132132

133133
/// 加入黑名单
134134
static const String joinToBlacklistKey = "join_to_blacklist_key";
135+
136+
/// ---- 联系人-朋友权限
137+
/// 聊天、朋友圈、微信运动等
138+
static const String settingFriendPermissionKey =
139+
"setting_friend_permission_key";
135140
}

lib/views/contacts/contact_info/contact_info_page.dart

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ class _ContactInfoPageState extends State<ContactInfoPage> {
7878
children: <Widget>[
7979
new SvgPicture.asset(
8080
Constant.assetsImagesContacts + 'icons_filled_videocall.svg',
81-
width: 16.0,
82-
height: 16.0,
81+
width: ScreenUtil().setWidth(16.0 * 3),
82+
height: ScreenUtil().setWidth(16.0 * 3),
8383
color: Colors.black,
8484
),
85-
SizedBox(width: 4.0),
85+
SizedBox(width: ScreenUtil().setWidth(4.0 * 3)),
8686
Text('视频通话'),
8787
],
8888
)),
@@ -96,11 +96,11 @@ class _ContactInfoPageState extends State<ContactInfoPage> {
9696
new SvgPicture.asset(
9797
Constant.assetsImagesContacts +
9898
'icons_filled_contacts_phone.svg',
99-
width: 16.0,
100-
height: 16.0,
99+
width: ScreenUtil().setWidth(16.0 * 3),
100+
height: ScreenUtil().setWidth(16.0 * 3),
101101
color: Colors.black,
102102
),
103-
SizedBox(width: 4.0),
103+
SizedBox(width: ScreenUtil().setWidth(4.0 * 3)),
104104
Text('语音通话'),
105105
],
106106
),
@@ -123,10 +123,10 @@ class _ContactInfoPageState extends State<ContactInfoPage> {
123123
_buildSettingRemarksWidget(),
124124
// 朋友权限
125125
_buildFriendPermission(),
126-
SizedBox(height: 8.0),
126+
SizedBox(height: ScreenUtil().setHeight(8.0 * 3)),
127127
_buildMomentsWidget(),
128128
_buildMoreInfoWidget(),
129-
SizedBox(height: 8.0),
129+
SizedBox(height: ScreenUtil().setHeight(8.0 * 3)),
130130
_buildMessageAndVideoWidget(),
131131
],
132132
);
@@ -174,18 +174,26 @@ class _ContactInfoPageState extends State<ContactInfoPage> {
174174
return Container(
175175
color: Colors.white,
176176
child: MHListTile(
177-
contentPadding: EdgeInsets.all(Constant.pEdgeInset),
177+
contentPadding:
178+
EdgeInsets.all(ScreenUtil().setWidth(Constant.pEdgeInset * 3.0)),
178179
middle: middle,
179180
trailing: trailing,
180181
dividerIndent: ScreenUtil().setWidth(Constant.pEdgeInset * 3),
182+
onTap: () {
183+
NavigatorUtils.push(
184+
context,
185+
'${ContactsRouter.friendPermissionPage}?idstr=${_user.idstr}',
186+
);
187+
},
181188
),
182189
);
183190
}
184191

185192
/// 构建更多信息 部件
186193
Widget _buildMoreInfoWidget() {
187194
Widget middle = Padding(
188-
padding: EdgeInsets.only(right: Constant.pEdgeInset),
195+
padding: EdgeInsets.only(
196+
right: ScreenUtil().setWidth(Constant.pEdgeInset * 3)),
189197
child: Text(
190198
'更多信息',
191199
style: TextStyle(
@@ -195,12 +203,13 @@ class _ContactInfoPageState extends State<ContactInfoPage> {
195203

196204
Widget trailing = Image.asset(
197205
Constant.assetsImagesArrow + 'tableview_arrow_8x13.png',
198-
width: 8.0,
199-
height: 13.0,
206+
width: ScreenUtil().setWidth(24.0),
207+
height: ScreenUtil().setHeight(39.0),
200208
);
201209

202210
return MHListTile(
203-
contentPadding: EdgeInsets.all(Constant.pEdgeInset),
211+
contentPadding:
212+
EdgeInsets.all(ScreenUtil().setWidth(Constant.pEdgeInset * 3.0)),
204213
middle: middle,
205214
trailing: trailing,
206215
onTap: () {
@@ -233,21 +242,24 @@ class _ContactInfoPageState extends State<ContactInfoPage> {
233242
String icon, String title, void Function() onTap) {
234243
Color color = Color(0xFF576B95);
235244
Widget middle = Padding(
236-
padding: EdgeInsets.only(right: Constant.pEdgeInset),
245+
padding: EdgeInsets.only(
246+
right: ScreenUtil().setWidth(Constant.pEdgeInset * 3)),
237247
child: Row(
238248
mainAxisAlignment: MainAxisAlignment.center,
239249
children: <Widget>[
240250
new SvgPicture.asset(
241251
Constant.assetsImagesContacts + icon,
242252
color: color,
243-
width: 16.0,
244-
height: 16.0,
253+
width: ScreenUtil().setWidth(16.0 * 3),
254+
height: ScreenUtil().setWidth(16.0 * 3),
245255
),
246-
SizedBox(width: 4.0),
256+
SizedBox(width: ScreenUtil().setWidth(4.0 * 3)),
247257
Text(
248258
title,
249259
style: TextStyle(
250-
fontSize: 16.0, color: color, fontWeight: FontWeight.w600),
260+
fontSize: ScreenUtil().setSp(16.0 * 3),
261+
color: color,
262+
fontWeight: FontWeight.w600),
251263
),
252264
],
253265
),

lib/views/contacts/contact_setting_info/contact_setting_info.dart

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import 'package:flutter_wechat/constant/cache_key.dart';
66
import 'package:flutter_wechat/constant/style.dart';
77
import 'package:flutter_wechat/utils/util.dart';
88

9+
import 'package:flutter_wechat/routers/fluro_navigator.dart';
10+
import 'package:flutter_wechat/views/contacts/contacts_router.dart';
11+
912
import 'package:flutter_wechat/model/common/common_item.dart';
1013
import 'package:flutter_wechat/model/common/common_group.dart';
1114
import 'package:flutter_wechat/model/common/common_header.dart';
@@ -53,6 +56,7 @@ class _ContactSettingInfoPageState extends State<ContactSettingInfoPage> {
5356
return Scaffold(
5457
appBar: AppBar(
5558
title: Text('资料设置'),
59+
elevation: 0, // 隐藏AppBar底部细线阴影
5660
),
5761
body: Container(
5862
child: _buildChildWidget(context),
@@ -68,9 +72,20 @@ class _ContactSettingInfoPageState extends State<ContactSettingInfoPage> {
6872
title: '设置备注和标签',
6973
subtitle: _user.screenName,
7074
);
75+
// 朋友权限
76+
final friendPermission = CommonItem(
77+
title: '朋友权限',
78+
onTap: (item) {
79+
NavigatorUtils.push(
80+
context,
81+
'${ContactsRouter.friendPermissionPage}?idstr=${_user.idstr}',
82+
);
83+
},
84+
);
7185
final group0 = CommonGroup(
7286
items: [
7387
settingRemarks,
88+
friendPermission,
7489
],
7590
);
7691

@@ -94,33 +109,11 @@ class _ContactSettingInfoPageState extends State<ContactSettingInfoPage> {
94109
cacheKey: preCacheKey + CacheKey.settingToStarFriendKey,
95110
);
96111
final group2 = CommonGroup(
97-
footerHeight: 0.0,
98112
items: [
99113
starFriend,
100114
],
101115
);
102116

103-
// group3
104-
// 不让他看
105-
final iNotLookHe = CommonSwitchItem(
106-
title: '不让' + heOrShe + '看',
107-
cacheKey: preCacheKey + CacheKey.notAllowLookMyMomentsKey,
108-
);
109-
// 不看他
110-
final heNotLookMe = CommonSwitchItem(
111-
title: "不看" + heOrShe,
112-
cacheKey: preCacheKey + CacheKey.notLookHisMomentsKey,
113-
);
114-
// 组头
115-
final CommonHeader header0 = CommonHeader(header: '朋友圈和视频动态');
116-
final group3 = CommonGroup(
117-
header: header0,
118-
items: [
119-
iNotLookHe,
120-
heNotLookMe,
121-
],
122-
);
123-
124117
// group3
125118
// 加入黑名单
126119
final joinToBlacklist = CommonSwitchItem(
@@ -132,7 +125,7 @@ class _ContactSettingInfoPageState extends State<ContactSettingInfoPage> {
132125
final complaint = CommonItem(
133126
title: "投诉",
134127
);
135-
final group4 = CommonGroup(
128+
final group3 = CommonGroup(
136129
items: [
137130
joinToBlacklist,
138131
complaint,
@@ -147,12 +140,12 @@ class _ContactSettingInfoPageState extends State<ContactSettingInfoPage> {
147140
// 显示action sheet
148141
_showActionSheet(context);
149142
});
150-
final group5 = CommonGroup(
143+
final group4 = CommonGroup(
151144
items: [delete],
152145
);
153146

154147
// 添加数据源
155-
return [group0, group1, group2, group3, group4, group5];
148+
return [group0, group1, group2, group3, group4];
156149
}
157150

158151
/// 构建actionsheet

lib/views/contacts/contacts_router.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import 'package:flutter_wechat/views/contacts/add_friend/add_friend_page.dart';
66
import 'package:flutter_wechat/views/contacts/contact_info/contact_info_page.dart';
77
import 'package:flutter_wechat/views/contacts/contact_more_info/contact_more_info_page.dart';
88
import 'package:flutter_wechat/views/contacts/contact_setting_info/contact_setting_info.dart';
9+
import 'package:flutter_wechat/views/contacts/friend_permission/friend_permission_page.dart';
910

1011
class ContactsRouter implements IRouterProvider {
1112
/// 联系人 root页
@@ -23,6 +24,9 @@ class ContactsRouter implements IRouterProvider {
2324
/// 联系人资料设置
2425
static String contactSettingInfoPage = "/contacts/contact-setting-info";
2526

27+
/// 朋友权限
28+
static String friendPermissionPage = "/contacts/friend_permission";
29+
2630
@override
2731
void initRouter(Router router) {
2832
router.define(contactsPage,
@@ -56,5 +60,15 @@ class ContactsRouter implements IRouterProvider {
5660
);
5761
}),
5862
);
63+
64+
router.define(
65+
friendPermissionPage,
66+
handler: Handler(handlerFunc: (_, params) {
67+
final String idstr = params['idstr']?.first;
68+
return FriendPermissionPage(
69+
idstr: idstr,
70+
);
71+
}),
72+
);
5973
}
6074
}

0 commit comments

Comments
 (0)