diff --git a/lib/tools/chat/chat_page.dart b/lib/tools/chat/chat_page.dart index 4dac89a..5fb5799 100644 --- a/lib/tools/chat/chat_page.dart +++ b/lib/tools/chat/chat_page.dart @@ -51,7 +51,7 @@ class _ChatPageState extends State { bool isMore = false; - bool isHalf = true; + bool isHalf = false; ///输入框内容 String text = ""; @@ -511,7 +511,7 @@ class _ChatPageState extends State { margin: EdgeInsets.only(left: 14), child: Image( width: w27, - image: AssetImage('assets/images/ic_more.png'), + image: !isMore ? AssetImage('assets/images/ic_more.png') : AssetImage('assets/images/ic_more_no.png'), ), ), ), @@ -773,12 +773,10 @@ class _ChatPageState extends State { borderRadius: BorderRadius.only(topLeft: Radius.circular(16.0), bottomLeft: Radius.circular(16.0), bottomRight: Radius.circular(16.0)), ), - child: Text( - chatList[index].content!, - style: const TextStyle( - fontSize: 14, - color: Color(0xFFE8E8E8), - ), + child: DynamicText( + text: replaceBracketsWithAsterisks(chatList[index].content!), + highlightedStyle: TextStyle(color: Color(0xFF999999), fontStyle: FontStyle.italic, fontSize: 14, height: 1.4), // 变暗的颜色 + normalStyle: TextStyle(color: Colors.white, fontSize: 14, height: 1.4), // 正常颜色 ), ), ), @@ -787,6 +785,11 @@ class _ChatPageState extends State { ); } + String replaceBracketsWithAsterisks(String text) { + // 使用正则表达式来匹配英文括号和中文括号,并替换为星号 + return text.replaceAll(RegExp(r'[()]|[\uFF08\uFF09]'), '*'); + } + popupView(int id, String content, index, customController) { return Container( width: 135, diff --git a/lib/tools/home/home_chat_page.dart b/lib/tools/home/home_chat_page.dart index f26f1a7..8c4a848 100644 --- a/lib/tools/home/home_chat_page.dart +++ b/lib/tools/home/home_chat_page.dart @@ -774,12 +774,10 @@ class _HomeChatPageState extends State with AutomaticKeepAliveClie borderRadius: BorderRadius.only(topLeft: Radius.circular(16.0), bottomLeft: Radius.circular(16.0), bottomRight: Radius.circular(16.0)), ), - child: Text( - chatList[index].content!, - style: const TextStyle( - fontSize: 14, - color: Color(0xFFE8E8E8), - ), + child: DynamicText( + text: replaceBracketsWithAsterisks(chatList[index].content!), + highlightedStyle: TextStyle(color: Color(0xFF999999), fontStyle: FontStyle.italic, fontSize: 14, height: 1.4), // 变暗的颜色 + normalStyle: TextStyle(color: Colors.white, fontSize: 14, height: 1.4), // 正常颜色 ), ), ), @@ -788,6 +786,11 @@ class _HomeChatPageState extends State with AutomaticKeepAliveClie ); } + String replaceBracketsWithAsterisks(String text) { + // 使用正则表达式来匹配英文括号和中文括号,并替换为星号 + return text.replaceAll(RegExp(r'[()]|[\uFF08\uFF09]'), '*'); + } + popupView(int id, String content, index, customController, w135, h40) { return Container( width: w135, diff --git a/lib/tools/me/me_page.dart b/lib/tools/me/me_page.dart index f91aaba..c9874a1 100644 --- a/lib/tools/me/me_page.dart +++ b/lib/tools/me/me_page.dart @@ -190,7 +190,7 @@ class _MePageState extends State { Container( margin: EdgeInsets.only(left: 17), child: Text( - '货币:${userInfoBean.currency}', + '语珠:${userInfoBean.currency}', style: TextStyle(color: Color(0xFFE1E1E1), fontSize: 13), ), ), @@ -239,10 +239,13 @@ class _MePageState extends State { margin: EdgeInsets.symmetric(horizontal: 16), child: GestureDetector( onTap: () { - Navigator.pushNamed(context, '/LoginPage'); + // Navigator.pushNamed(context, '/LoginPage'); }, - child: Image( - image: AssetImage('assets/images/ic_web.png'), + child: CachedNetworkImage( + width: w58, + height: w58, + imageUrl: userInfoBean.inviteNewUser!.imgUrl!, + errorWidget: (context, url, error) => const Icon(Icons.error), ), ), ),