2.《消息:有消息,红点没提示》 3.优化、备注:这里可以加一个叉叉,可以全部删除的,不用一个个删除 4.名字:二维码、编辑资料里面和名字有关的地方,限制长度master
@@ -0,0 +1,13 @@ | |||||
{ | |||||
// 使用 IntelliSense 了解相关属性。 | |||||
// 悬停以查看现有属性的描述。 | |||||
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 | |||||
"version": "0.2.0", | |||||
"configurations": [ | |||||
{ | |||||
"name": "Flutter", | |||||
"request": "launch", | |||||
"type": "dart" | |||||
} | |||||
] | |||||
} |
@@ -638,6 +638,11 @@ class _GroupChatPageItemState extends State<GroupChatPageItem> | |||||
child: hasHeadImg | child: hasHeadImg | ||||
? CachedNetworkImage( | ? CachedNetworkImage( | ||||
imageUrl: UserData().basicInfo.headimgurl, | imageUrl: UserData().basicInfo.headimgurl, | ||||
placeholder: (context, url) => Image.asset( | |||||
Constants.DefaultHeadImgUrl, | |||||
width: 40, | |||||
height: 40, | |||||
), | |||||
width: 40, | width: 40, | ||||
height: 40, | height: 40, | ||||
) | ) | ||||
@@ -1279,6 +1284,11 @@ class _GroupChatPageItemState extends State<GroupChatPageItem> | |||||
child: hasHeadImg | child: hasHeadImg | ||||
? CachedNetworkImage( | ? CachedNetworkImage( | ||||
imageUrl: memberModel.avtar, | imageUrl: memberModel.avtar, | ||||
placeholder: (context, url) => Image.asset( | |||||
Constants.DefaultHeadImgUrl, | |||||
width: 40, | |||||
height: 40, | |||||
), | |||||
width: 40, | width: 40, | ||||
height: 40, | height: 40, | ||||
) | ) | ||||
@@ -1288,7 +1298,7 @@ class _GroupChatPageItemState extends State<GroupChatPageItem> | |||||
child: Image.asset(R.assetsImagesDefaultNorAvatar))), | child: Image.asset(R.assetsImagesDefaultNorAvatar))), | ||||
onTap: () { | onTap: () { | ||||
AppNavigator.pushProfileInfoPage(context, memberModel.memberId, | AppNavigator.pushProfileInfoPage(context, memberModel.memberId, | ||||
fromWhere: 2,addMode: 1); | |||||
fromWhere: 2, addMode: 1); | |||||
}, | }, | ||||
onLongPress: () { | onLongPress: () { | ||||
print('long press user'); | print('long press user'); | ||||
@@ -91,9 +91,10 @@ class GroupOperatingPageType { | |||||
//消息发送界面类别 | //消息发送界面类别 | ||||
class SendMessagePageType { | class SendMessagePageType { | ||||
static const int AddFriends = 0; //添加朋友 | |||||
static const int ChangeGroupName = 1; //修改群名字 | |||||
static const int AddFriends = 0; //添加朋友 | |||||
static const int ChangeGroupName = 1; //修改群名字 | |||||
static const int ChangeGroupNickName = 2; //修改群昵称 | static const int ChangeGroupNickName = 2; //修改群昵称 | ||||
static const int Remark = 3; //修改备注 | |||||
} | } | ||||
//全局搜索类别 | //全局搜索类别 | ||||
@@ -112,12 +113,12 @@ class Constants { | |||||
//app全局key,处理content | //app全局key,处理content | ||||
static final GlobalKey<NavigatorState> navigatorKey = GlobalKey(); | static final GlobalKey<NavigatorState> navigatorKey = GlobalKey(); | ||||
/// 获取当前的state | /// 获取当前的state | ||||
static NavigatorState getCurrentState() => navigatorKey.currentState; | static NavigatorState getCurrentState() => navigatorKey.currentState; | ||||
/// 获取当前的context | /// 获取当前的context | ||||
static BuildContext getCurrentContext() => navigatorKey.currentState.overlay.context;//navigatorKey.currentContext; | |||||
static BuildContext getCurrentContext() => | |||||
navigatorKey.currentState.overlay.context; //navigatorKey.currentContext; | |||||
///在pubspec.yaml中修改版本号 | ///在pubspec.yaml中修改版本号 | ||||
static String versionName = '1.0.0'; | static String versionName = '1.0.0'; | ||||
@@ -138,6 +139,8 @@ class Constants { | |||||
static const FullWidthIconButtonIconSize = 24.0; | static const FullWidthIconButtonIconSize = 24.0; | ||||
static const ProfileHeaderIconSize = 60.0; | static const ProfileHeaderIconSize = 60.0; | ||||
static const int NameLength = 14; | |||||
static const AppId = 'wx02328a8853f058ad'; | static const AppId = 'wx02328a8853f058ad'; | ||||
static const Secret = '9d401b6a8bfe7b2fe63b3bf5c040b2f2'; | static const Secret = '9d401b6a8bfe7b2fe63b3bf5c040b2f2'; | ||||
@@ -17,7 +17,13 @@ import 'package:dio/dio.dart'; | |||||
import 'package:flutter/cupertino.dart'; | import 'package:flutter/cupertino.dart'; | ||||
import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
import 'package:shared_preferences/shared_preferences.dart'; | import 'package:shared_preferences/shared_preferences.dart'; | ||||
import '../data/constants.dart' show AppColors, AppStyles, Constants, GlobalSearchPageType, GroupOperatingPageType; | |||||
import '../data/constants.dart' | |||||
show | |||||
AppColors, | |||||
AppStyles, | |||||
Constants, | |||||
GlobalSearchPageType, | |||||
GroupOperatingPageType; | |||||
import 'package:cached_network_image/cached_network_image.dart'; | import 'package:cached_network_image/cached_network_image.dart'; | ||||
import 'create_group_view.dart'; | import 'create_group_view.dart'; | ||||
@@ -253,7 +259,6 @@ class _ConversActionPageState extends State<ConversActionPage> | |||||
@override | @override | ||||
Widget build(BuildContext context) { | Widget build(BuildContext context) { | ||||
List<GroupInfoModel> groupList = GroupInfoMgr().groupInfoList; | List<GroupInfoModel> groupList = GroupInfoMgr().groupInfoList; | ||||
return Scaffold( | return Scaffold( | ||||
@@ -350,9 +355,6 @@ class _ConversActionPageState extends State<ConversActionPage> | |||||
child: TabBarView( | child: TabBarView( | ||||
children: <Widget>[ | children: <Widget>[ | ||||
LastChatPage(), | LastChatPage(), | ||||
ListView.builder( | ListView.builder( | ||||
// controller: _scrollController, | // controller: _scrollController, | ||||
itemBuilder: (BuildContext context, int index) { | itemBuilder: (BuildContext context, int index) { | ||||
@@ -365,7 +367,6 @@ class _ConversActionPageState extends State<ConversActionPage> | |||||
}, | }, | ||||
itemCount: groupList.length + 1, | itemCount: groupList.length + 1, | ||||
), | ), | ||||
ListView( | ListView( | ||||
children: <Widget>[ | children: <Widget>[ | ||||
SizedBox(height: 8.5), | SizedBox(height: 8.5), | ||||
@@ -544,21 +545,23 @@ class _ConversActionPageState extends State<ConversActionPage> | |||||
); | ); | ||||
}, | }, | ||||
child: Container( | child: Container( | ||||
height: ItemHeight-20, | |||||
// margin: EdgeInsets.only(top: 1.5, bottom:1), | |||||
decoration: BoxDecoration(color: Colors.white), | |||||
child: Row( | |||||
children: <Widget>[ | |||||
SizedBox(width: LeftPadding), | |||||
_avatarIcon, | |||||
SizedBox(width: 14.0), | |||||
Text( | |||||
I18n.of(context).create_group_chat, | |||||
style: TextStyle(fontSize: 15.5), | |||||
padding: EdgeInsets.only(top: 14, bottom: 14), | |||||
color: Constants.GreyBackgroundColor, | |||||
child: Container( | |||||
height: ItemHeight, | |||||
decoration: BoxDecoration(color: Colors.white), | |||||
child: Row( | |||||
children: <Widget>[ | |||||
SizedBox(width: LeftPadding), | |||||
_avatarIcon, | |||||
SizedBox(width: 14.0), | |||||
Text( | |||||
I18n.of(context).create_group_chat, | |||||
style: TextStyle(fontSize: 15.5), | |||||
), | |||||
], | |||||
), | ), | ||||
], | |||||
), | |||||
)); | |||||
))); | |||||
Widget tips = Container( | Widget tips = Container( | ||||
alignment: Alignment.centerLeft, | alignment: Alignment.centerLeft, | ||||
@@ -573,7 +576,9 @@ class _ConversActionPageState extends State<ConversActionPage> | |||||
return Column( | return Column( | ||||
children: <Widget>[ | children: <Widget>[ | ||||
SizedBox(height: 10,), | |||||
SizedBox( | |||||
height: 10, | |||||
), | |||||
CustomUI.buildSearchButton(context, () { | CustomUI.buildSearchButton(context, () { | ||||
Navigator.of(context).push( | Navigator.of(context).push( | ||||
new MaterialPageRoute( | new MaterialPageRoute( | ||||
@@ -584,10 +589,9 @@ class _ConversActionPageState extends State<ConversActionPage> | |||||
}, | }, | ||||
), | ), | ||||
); | ); | ||||
},bottom: 10 ), | |||||
}, bottom: 10), | |||||
_button, | _button, | ||||
tips, | tips, | ||||
], | ], | ||||
); | ); | ||||
} | } | ||||
@@ -599,6 +603,7 @@ class _ConversActionPageState extends State<ConversActionPage> | |||||
}); | }); | ||||
} | } | ||||
} | } | ||||
updateGroupLastMsg(args) async { | updateGroupLastMsg(args) async { | ||||
await GroupInfoMgr().sortGroupList(); | await GroupInfoMgr().sortGroupList(); | ||||
if (mounted) { | if (mounted) { | ||||
@@ -334,7 +334,7 @@ class _EditPageState extends State<EditPage> { | |||||
showToast(I18n.of(context).only1_8); | showToast(I18n.of(context).only1_8); | ||||
return; | return; | ||||
} | } | ||||
if (dateRangeId.length == 0) { | |||||
if (dateRangeId.length == 0 && UserData().hasLocationPermission) { | |||||
showToast(I18n.of(context).Please_select_a_resident_city); | showToast(I18n.of(context).Please_select_a_resident_city); | ||||
return; | return; | ||||
} | } | ||||
@@ -742,7 +742,10 @@ class _EditPageState extends State<EditPage> { | |||||
widget.isEditPage ? idItem : Container(), | widget.isEditPage ? idItem : Container(), | ||||
_buildDivider(), | _buildDivider(), | ||||
_bottomBorderBox(I18n.of(context).nickname, I18n.of(context).fill_out, | _bottomBorderBox(I18n.of(context).nickname, I18n.of(context).fill_out, | ||||
true, nickNameController, true, (str) => nickname = str), | |||||
true, nickNameController, true, (str) => nickname = str, | |||||
inputFormatters: [ | |||||
LengthLimitingTextInputFormatter(Constants.NameLength) | |||||
]), | |||||
_buildDivider(), | _buildDivider(), | ||||
_bottomBorderBox(I18n.of(context).country, country, false, null, | _bottomBorderBox(I18n.of(context).country, country, false, null, | ||||
countryId.length != 0, selectCountry), | countryId.length != 0, selectCountry), | ||||
@@ -2359,86 +2359,21 @@ class _ProfilePageState extends State<ProfilePage> | |||||
InkWell( | InkWell( | ||||
onTap: () async { | onTap: () async { | ||||
Navigator.of(context).pop(); | Navigator.of(context).pop(); | ||||
nickNameController.text = | |||||
Provider.of<RefNameProvider>(context) | |||||
.getRefName(userInfo.userId, | |||||
userInfo.nickName); | |||||
var confirm = CustomUI.buildConfirmBotton( | |||||
I18n.of(context).determine, () async { | |||||
nickNameController.text = | |||||
nickNameController.text.trim(); | |||||
if (nickNameController.text == null || | |||||
nickNameController.text.length > | |||||
25) { | |||||
showToast(I18n.of(context).only1_8); | |||||
return; | |||||
} | |||||
Provider.of<RefNameProvider>( | |||||
registKey.currentContext) | |||||
.changeRefName(userInfo.userId, | |||||
nickNameController.text, () { | |||||
Navigator.of(registKey.currentContext) | |||||
.pop(); | |||||
}); | |||||
}); | |||||
var tip = Column( | |||||
children: <Widget>[ | |||||
Container( | |||||
margin: EdgeInsets.only(top: 20), | |||||
child: Text( | |||||
I18n.of(context).setRemark, | |||||
style: TextStyle( | |||||
color: | |||||
Constants.BlackTextColor, | |||||
fontSize: 16), | |||||
), | |||||
), | |||||
Container( | |||||
margin: EdgeInsets.only( | |||||
top: 23, bottom: 25), | |||||
decoration: BoxDecoration( | |||||
color: Colors.grey[200], | |||||
borderRadius: BorderRadius.all( | |||||
Radius.circular(8))), | |||||
child: TextField( | |||||
keyboardAppearance: | |||||
Brightness.light, | |||||
controller: nickNameController, | |||||
textAlign: TextAlign.center, | |||||
textInputAction: | |||||
TextInputAction.search, | |||||
style: TextStyle( | |||||
textBaseline: | |||||
TextBaseline.alphabetic, | |||||
fontSize: 14), | |||||
decoration: InputDecoration( | |||||
hintText: userInfo.nickName, | |||||
hintStyle: | |||||
TextStyle(fontSize: 12), | |||||
filled: true, | |||||
contentPadding: EdgeInsets.only( | |||||
top: 10, bottom: 10), | |||||
fillColor: Colors.transparent, | |||||
border: InputBorder.none, | |||||
), | |||||
maxLines: 1, | |||||
inputFormatters: [ | |||||
LengthLimitingTextInputFormatter( | |||||
15) | |||||
], | |||||
), | |||||
) | |||||
], | |||||
Navigator.of(context).push( | |||||
new MaterialPageRoute( | |||||
builder: (context) { | |||||
return AddFriendPage( | |||||
userId: userInfo.userId, | |||||
pageType: | |||||
SendMessagePageType.Remark, | |||||
originalName: Provider.of< | |||||
RefNameProvider>( | |||||
context) | |||||
.getRefName(userInfo.userId, | |||||
userInfo.nickName)); | |||||
}, | |||||
), | |||||
); | ); | ||||
var content = | |||||
CustomUI.buildConfirmContent( | |||||
tip, confirm); | |||||
CustomUI.buildTip( | |||||
registKey.currentContext, | |||||
'', | |||||
content); | |||||
}, | }, | ||||
child: Container( | child: Container( | ||||
alignment: Alignment.center, | alignment: Alignment.center, | ||||
@@ -1,11 +1,13 @@ | |||||
import 'package:chat/data/constants.dart'; | import 'package:chat/data/constants.dart'; | ||||
import 'package:chat/generated/i18n.dart'; | import 'package:chat/generated/i18n.dart'; | ||||
import 'package:chat/models/ref_name_provider.dart'; | |||||
import 'package:chat/utils/CustomUI.dart'; | import 'package:chat/utils/CustomUI.dart'; | ||||
import 'package:chat/utils/HttpUtil.dart'; | import 'package:chat/utils/HttpUtil.dart'; | ||||
import 'package:chat/utils/MessageMgr.dart'; | import 'package:chat/utils/MessageMgr.dart'; | ||||
import 'package:chat/utils/msgHandler.dart'; | import 'package:chat/utils/msgHandler.dart'; | ||||
import 'package:flutter/material.dart'; | import 'package:flutter/material.dart'; | ||||
import 'package:flutter/services.dart'; | import 'package:flutter/services.dart'; | ||||
import 'package:provider/provider.dart'; | |||||
class AddFriendPage extends StatefulWidget { | class AddFriendPage extends StatefulWidget { | ||||
final int userId; | final int userId; | ||||
@@ -32,6 +34,8 @@ class _AddFriendPageState extends State<AddFriendPage> { | |||||
print('AddFriendPage init111'); | print('AddFriendPage init111'); | ||||
_txtCtrl.text = widget.originalName; | _txtCtrl.text = widget.originalName; | ||||
_hasdeleteIcon = | |||||
!(widget.originalName == null || widget.originalName == ""); | |||||
} | } | ||||
@override | @override | ||||
@@ -47,6 +51,9 @@ class _AddFriendPageState extends State<AddFriendPage> { | |||||
case SendMessagePageType.ChangeGroupNickName: | case SendMessagePageType.ChangeGroupNickName: | ||||
title = I18n.of(context).my_group_nickname; | title = I18n.of(context).my_group_nickname; | ||||
break; | break; | ||||
case SendMessagePageType.Remark: | |||||
title = I18n.of(context).setRemark; | |||||
break; | |||||
default: | default: | ||||
} | } | ||||
Widget appBar = new AppBar( | Widget appBar = new AppBar( | ||||
@@ -73,7 +80,6 @@ class _AddFriendPageState extends State<AddFriendPage> { | |||||
}); | }); | ||||
break; | break; | ||||
case SendMessagePageType.ChangeGroupName: | case SendMessagePageType.ChangeGroupName: | ||||
Navigator.of(context).pop(); | Navigator.of(context).pop(); | ||||
MsgHandler.updateGroupName(widget.userId, content); | MsgHandler.updateGroupName(widget.userId, content); | ||||
break; | break; | ||||
@@ -81,6 +87,12 @@ class _AddFriendPageState extends State<AddFriendPage> { | |||||
Navigator.of(context).pop(); | Navigator.of(context).pop(); | ||||
MsgHandler.updateMemberRefName(widget.userId, content); | MsgHandler.updateMemberRefName(widget.userId, content); | ||||
break; | break; | ||||
case SendMessagePageType.Remark: | |||||
Provider.of<RefNameProvider>(context) | |||||
.changeRefName(widget.userId, content, () { | |||||
Navigator.of(context).pop(); | |||||
}); | |||||
break; | |||||
default: | default: | ||||
} | } | ||||
}, | }, | ||||
@@ -88,16 +100,16 @@ class _AddFriendPageState extends State<AddFriendPage> { | |||||
alignment: Alignment.center, | alignment: Alignment.center, | ||||
margin: EdgeInsets.only(top: 15, bottom: 15, right: 20), | margin: EdgeInsets.only(top: 15, bottom: 15, right: 20), | ||||
height: 20, | height: 20, | ||||
padding: EdgeInsets.only(left: 18,right: 18,bottom: 1), | |||||
padding: EdgeInsets.only(left: 18, right: 18, bottom: 1), | |||||
decoration: BoxDecoration( | decoration: BoxDecoration( | ||||
color: Constants.ConfrimButtonColor, borderRadius: BorderRadius.circular(4.5)), | |||||
color: Constants.ConfrimButtonColor, | |||||
borderRadius: BorderRadius.circular(4.5)), | |||||
child: Text( | child: Text( | ||||
widget.pageType == SendMessagePageType.AddFriends | widget.pageType == SendMessagePageType.AddFriends | ||||
? I18n.of(context).send | ? I18n.of(context).send | ||||
: I18n.of(context).determine, | : I18n.of(context).determine, | ||||
style: TextStyle( | |||||
color: Colors.white , fontSize: 14), | |||||
textScaleFactor: 1.0, | |||||
style: TextStyle(color: Colors.white, fontSize: 14), | |||||
textScaleFactor: 1.0, | |||||
), | ), | ||||
), | ), | ||||
) | ) | ||||
@@ -124,8 +136,9 @@ class _AddFriendPageState extends State<AddFriendPage> { | |||||
height: 36.5, | height: 36.5, | ||||
color: Colors.white, | color: Colors.white, | ||||
child: TextField( | child: TextField( | ||||
keyboardAppearance: Brightness.light, | |||||
keyboardAppearance: Brightness.light, | |||||
controller: _txtCtrl, | controller: _txtCtrl, | ||||
//autofocus: true, | |||||
style: TextStyle( | style: TextStyle( | ||||
fontSize: 16, | fontSize: 16, | ||||
color: Constants.BlackTextColor, | color: Constants.BlackTextColor, | ||||
@@ -188,7 +201,7 @@ class _AddFriendPageState extends State<AddFriendPage> { | |||||
margin: EdgeInsets.only(top: 20.5, left: 15, bottom: 6), | margin: EdgeInsets.only(top: 20.5, left: 15, bottom: 6), | ||||
child: Text( | child: Text( | ||||
title, | title, | ||||
textScaleFactor: 1.0, | |||||
textScaleFactor: 1.0, | |||||
style: TextStyle(fontSize: 11), | style: TextStyle(fontSize: 11), | ||||
), | ), | ||||
); | ); | ||||
@@ -95,7 +95,13 @@ class _FriendSelectItemState extends State<FriendSelectItem> { | |||||
SizedBox(width: 10), | SizedBox(width: 10), | ||||
_avatarIcon, | _avatarIcon, | ||||
SizedBox(width: 10.0), | SizedBox(width: 10.0), | ||||
Text(widget.friendModel.getTitle()), | |||||
Expanded( | |||||
child: Container( | |||||
child: Text( | |||||
widget.friendModel.getTitle(), | |||||
overflow: TextOverflow.ellipsis, | |||||
)), | |||||
) | |||||
], | ], | ||||
), | ), | ||||
); | ); | ||||
@@ -111,6 +111,11 @@ class _FriendPageState extends State<FriendPage> { | |||||
borderRadius: BorderRadius.circular(6), | borderRadius: BorderRadius.circular(6), | ||||
child: CachedNetworkImage( | child: CachedNetworkImage( | ||||
imageUrl: url, | imageUrl: url, | ||||
placeholder: (context, url) => Image.asset( | |||||
Constants.DefaultHeadImgUrl, | |||||
width: Constants.ContactAvatarSize, | |||||
height: Constants.ContactAvatarSize, | |||||
), | |||||
width: Constants.ContactAvatarSize, | width: Constants.ContactAvatarSize, | ||||
height: Constants.ContactAvatarSize, | height: Constants.ContactAvatarSize, | ||||
)); | )); | ||||
@@ -113,9 +113,10 @@ class _GlobalSearchPageState extends State<GlobalSearchPage> { | |||||
width: Screen.width, | width: Screen.width, | ||||
child: Row( | child: Row( | ||||
mainAxisAlignment: MainAxisAlignment.start, | mainAxisAlignment: MainAxisAlignment.start, | ||||
textBaseline: TextBaseline.ideographic, | |||||
children: <Widget>[ | children: <Widget>[ | ||||
Container( | Container( | ||||
margin: EdgeInsets.only(left: 20,right: 13), | |||||
margin: EdgeInsets.only(left: 20, right: 13), | |||||
width: Constants.ContactAvatarSize, | width: Constants.ContactAvatarSize, | ||||
height: Constants.ContactAvatarSize, | height: Constants.ContactAvatarSize, | ||||
decoration: BoxDecoration( | decoration: BoxDecoration( | ||||
@@ -132,15 +133,18 @@ class _GlobalSearchPageState extends State<GlobalSearchPage> { | |||||
color: Colors.white, | color: Colors.white, | ||||
), | ), | ||||
), | ), | ||||
Container( | |||||
child: Text('${I18n.of(context).search_phone}: ', | |||||
style: TextStyle(fontSize: 16.23)), | |||||
), | |||||
Container( | |||||
margin: EdgeInsets.only(top: 5), | |||||
child: Text(searchStr, | |||||
RichText( | |||||
text: TextSpan(children: [ | |||||
TextSpan( | |||||
text: '${I18n.of(context).search_phone}: ', | |||||
style: TextStyle( | style: TextStyle( | ||||
fontSize: 16.23, color: Color(0xFF008AFF)))) | |||||
color: Constants.BlackTextColor, fontSize: 16.23)), | |||||
TextSpan( | |||||
text: searchStr, | |||||
style: TextStyle( | |||||
color: Color(0xFF008AFF), fontSize: 16.23)), | |||||
]), | |||||
), | |||||
], | ], | ||||
), | ), | ||||
color: Colors.white)); | color: Colors.white)); | ||||
@@ -30,16 +30,12 @@ class GroupAllMemberState extends State<GroupAllMember> { | |||||
static const Separate_Size = 15.0; | static const Separate_Size = 15.0; | ||||
bool isHost; | bool isHost; | ||||
///是否是群主 | ///是否是群主 | ||||
@override | @override | ||||
void initState() { | void initState() { | ||||
super.initState(); | super.initState(); | ||||
MessageMgr().on('Update Group Info', updateGroupInfo); | MessageMgr().on('Update Group Info', updateGroupInfo); | ||||
isHost = widget.groupInfoModel.hosterId == UserData().basicInfo.userId; | isHost = widget.groupInfoModel.hosterId == UserData().basicInfo.userId; | ||||
} | } | ||||
updateGroupInfo(args) async { | updateGroupInfo(args) async { | ||||
@@ -51,18 +47,12 @@ class GroupAllMemberState extends State<GroupAllMember> { | |||||
@override | @override | ||||
void dispose() { | void dispose() { | ||||
super.dispose(); | super.dispose(); | ||||
MessageMgr().off('Update Group Info', updateGroupInfo); | MessageMgr().off('Update Group Info', updateGroupInfo); | ||||
} | } | ||||
@override | @override | ||||
Widget build(BuildContext context) { | Widget build(BuildContext context) { | ||||
Widget appBar = new AppBar( | Widget appBar = new AppBar( | ||||
backgroundColor: AppColors.NewAppbarBgColor, | backgroundColor: AppColors.NewAppbarBgColor, | ||||
title: new Text( | title: new Text( | ||||
@@ -150,14 +140,17 @@ class GroupAllMemberState extends State<GroupAllMember> { | |||||
borderRadius: BorderRadius.all(Radius.circular(8.0)), | borderRadius: BorderRadius.all(Radius.circular(8.0)), | ||||
child: CachedNetworkImage( | child: CachedNetworkImage( | ||||
imageUrl: member.avtar, | imageUrl: member.avtar, | ||||
placeholder: CustomUI.buildImgLoding, | |||||
placeholder: (context, url) => Image.asset( | |||||
Constants.DefaultHeadImgUrl, | |||||
width: size - 30, | |||||
height: size - 30, | |||||
), | |||||
width: size - 30, | width: size - 30, | ||||
height: size - 30, | height: size - 30, | ||||
)), | )), | ||||
SizedBox( | SizedBox( | ||||
height: 5, | height: 5, | ||||
), | ), | ||||
SizedBox( | SizedBox( | ||||
width: size - 30, | width: size - 30, | ||||
child: Text( | child: Text( | ||||
@@ -176,7 +169,7 @@ class GroupAllMemberState extends State<GroupAllMember> { | |||||
onTap: () { | onTap: () { | ||||
if (member.memberId != UserData().basicInfo.userId) { | if (member.memberId != UserData().basicInfo.userId) { | ||||
AppNavigator.pushProfileInfoPage(context, member.memberId, | AppNavigator.pushProfileInfoPage(context, member.memberId, | ||||
fromWhere: 2,addMode: 1); | |||||
fromWhere: 2, addMode: 1); | |||||
} | } | ||||
}, | }, | ||||
)); | )); | ||||
@@ -39,6 +39,7 @@ class NavigationIconView { | |||||
String title, | String title, | ||||
IconData icon, | IconData icon, | ||||
int type, | int type, | ||||
EdgeInsets iconMargin, | |||||
double iconSize = 24, | double iconSize = 24, | ||||
bool isCenter = false, | bool isCenter = false, | ||||
bool isShowdot = false, | bool isShowdot = false, | ||||
@@ -72,7 +73,7 @@ class NavigationIconView { | |||||
Container( | Container( | ||||
margin: isCenter | margin: isCenter | ||||
? EdgeInsets.only(bottom: 8, right: 6) | ? EdgeInsets.only(bottom: 8, right: 6) | ||||
: EdgeInsets.zero, | |||||
: iconMargin ?? EdgeInsets.zero, | |||||
child: Icon(icon, | child: Icon(icon, | ||||
size: iconSize, | size: iconSize, | ||||
color: | color: | ||||
@@ -110,7 +111,7 @@ class NavigationIconView { | |||||
Container( | Container( | ||||
margin: isCenter | margin: isCenter | ||||
? EdgeInsets.only(bottom: 8, right: 6) | ? EdgeInsets.only(bottom: 8, right: 6) | ||||
: EdgeInsets.zero, | |||||
: iconMargin ?? EdgeInsets.zero, | |||||
child: isShowdot | child: isShowdot | ||||
? UnreadDot( | ? UnreadDot( | ||||
child: Icon(icon, | child: Icon(icon, | ||||
@@ -122,6 +123,11 @@ class NavigationIconView { | |||||
color: isCenter | color: isCenter | ||||
? Colors.white | ? Colors.white | ||||
: Constants.BottomIconGreyColor)) | : Constants.BottomIconGreyColor)) | ||||
// child: Icon(icon, | |||||
// size: iconSize, | |||||
// color: isCenter | |||||
// ? Colors.white | |||||
// : Constants.BottomIconGreyColor)) | |||||
], | ], | ||||
)); | )); | ||||
} | } | ||||
@@ -141,7 +147,6 @@ class _HomeMainState extends State<HomeMain> { | |||||
@override | @override | ||||
void initState() { | void initState() { | ||||
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light); | SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle.light); | ||||
super.initState(); | super.initState(); | ||||
LocalNotificationUtil.instance.initState(context); | LocalNotificationUtil.instance.initState(context); | ||||
@@ -312,11 +317,11 @@ class _HomeMainState extends State<HomeMain> { | |||||
fontFamily: 'iconfont', | fontFamily: 'iconfont', | ||||
), | ), | ||||
isShowdot: true, | isShowdot: true, | ||||
type: 3, | |||||
iconSize: 25), | |||||
iconSize: 29), | |||||
NavigationIconView( | NavigationIconView( | ||||
title: _titles[0], | title: _titles[0], | ||||
isShowdot: true, | isShowdot: true, | ||||
iconMargin: EdgeInsets.only(top: 2), | |||||
type: 5, | type: 5, | ||||
icon: IconData( | icon: IconData( | ||||
0xe66e, | 0xe66e, | ||||
@@ -338,7 +343,7 @@ class _HomeMainState extends State<HomeMain> { | |||||
0xe60b, | 0xe60b, | ||||
fontFamily: 'iconfont', | fontFamily: 'iconfont', | ||||
), | ), | ||||
type: 4, | |||||
type: 6, | |||||
iconSize: 26.5), | iconSize: 26.5), | ||||
NavigationIconView( | NavigationIconView( | ||||
title: _titles[3], | title: _titles[3], | ||||
@@ -121,6 +121,7 @@ class _LastChatItemState extends State<LastChatItem> { | |||||
Provider.of<RefNameProvider>(context) | Provider.of<RefNameProvider>(context) | ||||
.getRefName(userInfo.userId, userInfo.nickName), | .getRefName(userInfo.userId, userInfo.nickName), | ||||
textScaleFactor: 1.0, | textScaleFactor: 1.0, | ||||
overflow: TextOverflow.ellipsis, | |||||
style: TextStyle( | style: TextStyle( | ||||
fontSize: 15, | fontSize: 15, | ||||
color: Colors.black, | color: Colors.black, | ||||
@@ -48,6 +48,11 @@ class _ContactItem extends StatelessWidget { | |||||
borderRadius: BorderRadius.circular(6), | borderRadius: BorderRadius.circular(6), | ||||
child: CachedNetworkImage( | child: CachedNetworkImage( | ||||
imageUrl: this.avatar, | imageUrl: this.avatar, | ||||
placeholder: (context, url) => Image.asset( | |||||
Constants.DefaultHeadImgUrl, | |||||
width: Constants.ContactAvatarSize, | |||||
height: Constants.ContactAvatarSize, | |||||
), | |||||
width: Constants.ContactAvatarSize, | width: Constants.ContactAvatarSize, | ||||
height: Constants.ContactAvatarSize, | height: Constants.ContactAvatarSize, | ||||
)); | )); | ||||
@@ -56,14 +56,16 @@ class _UnreadDotState extends State<UnreadDot> { | |||||
case 5: | case 5: | ||||
isHasUnread = isHaveNewFriends(); | isHasUnread = isHaveNewFriends(); | ||||
break; | break; | ||||
case 6: | |||||
isHasUnread = ChatDataMgr().unreadCountProvider.checkUnreadMsg() || | |||||
isShowMsg() || | |||||
ChatDataMgr().groupUnreadProvider.checkUnreadMsg(); | |||||
break; | |||||
} | } | ||||
return Stack( | return Stack( | ||||
children: <Widget>[ | children: <Widget>[ | ||||
Padding( | |||||
padding: EdgeInsets.only(right: 2), | |||||
child: widget.child, | |||||
), | |||||
widget.child, | |||||
Positioned( | Positioned( | ||||
right: 0, | right: 0, | ||||
top: 0, | top: 0, | ||||
@@ -376,6 +376,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver { | |||||
GlobalCupertinoLocalizations.delegate, // <-- needed for iOS | GlobalCupertinoLocalizations.delegate, // <-- needed for iOS | ||||
const FallbackCupertinoLocalisationsDelegate() | const FallbackCupertinoLocalisationsDelegate() | ||||
], | ], | ||||
//locale: const Locale('en'), | |||||
supportedLocales: i18n.supportedLocales, | supportedLocales: i18n.supportedLocales, | ||||
title: 'Chat', | title: 'Chat', | ||||
onGenerateTitle: (context) { | onGenerateTitle: (context) { | ||||
@@ -52,6 +52,11 @@ class FriendsInfo extends StatelessWidget { | |||||
borderRadius: BorderRadius.circular(6), | borderRadius: BorderRadius.circular(6), | ||||
child: CachedNetworkImage( | child: CachedNetworkImage( | ||||
imageUrl: this.avatar, | imageUrl: this.avatar, | ||||
placeholder: (context, url) => Image.asset( | |||||
Constants.DefaultHeadImgUrl, | |||||
width: Constants.ContactAvatarSize, | |||||
height: Constants.ContactAvatarSize, | |||||
), | |||||
width: Constants.ContactAvatarSize, | width: Constants.ContactAvatarSize, | ||||
height: Constants.ContactAvatarSize, | height: Constants.ContactAvatarSize, | ||||
)); | )); | ||||
@@ -76,7 +81,12 @@ class FriendsInfo extends StatelessWidget { | |||||
children: <Widget>[ | children: <Widget>[ | ||||
_avatarIcon, | _avatarIcon, | ||||
SizedBox(width: 10.0), | SizedBox(width: 10.0), | ||||
Text(title), | |||||
Expanded( | |||||
child: Container( | |||||
child: Text( | |||||
title, | |||||
overflow: TextOverflow.ellipsis, | |||||
))) | |||||
], | ], | ||||
), | ), | ||||
); | ); | ||||