Browse Source

style(message): 移除消息发送中的加载动画

- 移除 call_item.dart 中消息发送中的圆形加载动画
- 移除 gift_item.dart 中消息发送中的圆形加载动画
- 移除 image_item.dart 中消息发送中的圆形加载动画
- 移除 room_item.dart 中消息发送中的圆形加载动画
- 移除 text_item.dart 中消息发送中的圆形加载动画
- 移除 video_item.dart 中消息发送中的圆形加载动画
- 调整礼物发送失败时的错误提示信息
- 保持聊天礼物弹窗组件的布局结构不变
master
Jolie 3 months ago
parent
commit
531a1dcc66
8 changed files with 49 additions and 98 deletions
  1. 4
      lib/controller/message/chat_controller.dart
  2. 11
      lib/widget/message/call_item.dart
  3. 70
      lib/widget/message/chat_gift_popup.dart
  4. 11
      lib/widget/message/gift_item.dart
  5. 14
      lib/widget/message/image_item.dart
  6. 11
      lib/widget/message/room_item.dart
  7. 13
      lib/widget/message/text_item.dart
  8. 13
      lib/widget/message/video_item.dart

4
lib/controller/message/chat_controller.dart

@ -1742,9 +1742,9 @@ class ChatController extends GetxController {
requestData,
);
if (!response.data.isSuccess) {
if (response.data.isSuccess && !response.data.data['success']) {
SmartDialog.showToast(
response.data.message.isNotEmpty ? response.data.message : '发送礼物失败',
response.data.data['code'] == 'E0002' ? '玫瑰不足请充值' : '发送礼物失败',
);
return false;
}

11
lib/widget/message/call_item.dart

@ -368,15 +368,8 @@ class CallItem extends StatelessWidget {
),
);
} else if (status == MessageStatus.PROGRESS) {
//
return Container(
width: 16.w,
height: 16.w,
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(Colors.grey),
),
);
// loading
return SizedBox.shrink();
} else {
//
return SizedBox.shrink();

70
lib/widget/message/chat_gift_popup.dart

@ -146,45 +146,45 @@ class _ChatGiftPopupState extends State<ChatGiftPopup> {
? MediaQuery.of(context).padding.bottom
: 10.h,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// 1
SizedBox(width: 1.w),
ValueListenableBuilder<int>(
valueListenable: widget.giftNum,
builder: (context, num, _) {
return Row(
children: [
GestureDetector(
onTap: () => _handleSendGift(),
child: Container(
width: 63.w,
height: 30.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(30.w)),
gradient: const LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Color.fromRGBO(61, 138, 224, 1),
Color.fromRGBO(131, 89, 255, 1),
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// 1
SizedBox(width: 1.w),
ValueListenableBuilder<int>(
valueListenable: widget.giftNum,
builder: (context, num, _) {
return Row(
children: [
GestureDetector(
onTap: () => _handleSendGift(),
child: Container(
width: 63.w,
height: 30.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(30.w)),
gradient: const LinearGradient(
begin: Alignment.centerLeft,
end: Alignment.centerRight,
colors: [
Color.fromRGBO(61, 138, 224, 1),
Color.fromRGBO(131, 89, 255, 1),
],
),
child: Center(
child: Text(
"赠送",
style: TextStyle(fontSize: 13.w, color: Colors.white),
),
),
child: Center(
child: Text(
"赠送",
style: TextStyle(fontSize: 13.w, color: Colors.white),
),
),
),
],
);
},
),
],
),
],
);
},
),
],
),
),
);

11
lib/widget/message/gift_item.dart

@ -346,15 +346,8 @@ class GiftItem extends StatelessWidget {
),
);
} else if (status == MessageStatus.PROGRESS) {
//
return Container(
width: 16.w,
height: 16.w,
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(Colors.grey),
),
);
// loading
return SizedBox.shrink();
} else {
//
return SizedBox.shrink();

14
lib/widget/message/image_item.dart

@ -701,18 +701,8 @@ class _ImageItemState extends State<ImageItem> {
),
);
} else if (status == MessageStatus.PROGRESS) {
// PROGRESS状态loading
if (_shouldHideProgressStatus) {
return SizedBox.shrink();
}
return Container(
width: 16.w,
height: 16.w,
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(Colors.grey),
),
);
// loading
return SizedBox.shrink();
} else {
return SizedBox.shrink();
}

11
lib/widget/message/room_item.dart

@ -467,15 +467,8 @@ class RoomItem extends StatelessWidget {
),
);
} else if (status == MessageStatus.PROGRESS) {
//
return Container(
width: 16.w,
height: 16.w,
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(Colors.grey),
),
);
// loading
return SizedBox.shrink();
} else {
//
return SizedBox.shrink();

13
lib/widget/message/text_item.dart

@ -301,17 +301,8 @@ class TextItem extends StatelessWidget {
),
);
} else if (status == MessageStatus.PROGRESS) {
//
return Container(
width: 16.w,
height: 16.w,
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(
Colors.grey,
),
),
);
// loading
return SizedBox.shrink();
} else {
//
return SizedBox.shrink();

13
lib/widget/message/video_item.dart

@ -508,17 +508,8 @@ class _VideoItemState extends State<VideoItem> {
),
);
} else if (status == MessageStatus.PROGRESS) {
//
return Container(
width: 16.w,
height: 16.w,
child: CircularProgressIndicator(
strokeWidth: 2,
valueColor: AlwaysStoppedAnimation<Color>(
Colors.grey,
),
),
);
// loading
return SizedBox.shrink();
} else {
//
return SizedBox.shrink();

Loading…
Cancel
Save