diff --git a/lib/data/models/message_model.dart b/lib/data/models/message_model.dart index 94aebc3ac..aef99cbc9 100644 --- a/lib/data/models/message_model.dart +++ b/lib/data/models/message_model.dart @@ -1,58 +1,77 @@ class Message { - final String role; // 'user' or 'assistant' - final String content; - final DateTime timestamp; - final bool isLoading; + final bool isUser; //标识信息是否来自用户还是AI + final String text; //信息文本内容 + final DateTime timestamp; // 消息时间戳 + final bool isRecognizing; // 是否为语音识别中的临时消息 + final bool hasImage; // 是否包含图片 + final String? imagePath; // 图片路径 + final Map? meta; //卡片数据 Message({ - required this.role, - required this.content, - required this.timestamp, - this.isLoading = false, - }); + // 构造函数 + required this.isUser, + required this.text, + DateTime? timestamp, + this.isRecognizing = false, + this.hasImage = false, + this.imagePath, + this.meta, + }) : this.timestamp = timestamp ?? DateTime.now(); // 从JSON构造函数 factory Message.fromJson(Map json) { return Message( - role: json['role'] as String, - content: json['content'] as String, + isUser: json['isUser'] as bool, + text: json['text'] as String, timestamp: DateTime.parse(json['timestamp'] as String), - isLoading: json['isLoading'] as bool? ?? false, + isRecognizing: json['isRecognizing'] as bool? ?? false, + hasImage: json['hasImage'] as bool? ?? false, + imagePath: json['imagePath'] as String?, + meta: json['meta'] as Map?, ); } // 转换为JSON Map toJson() { return { - 'role': role, - 'content': content, + 'isUser': isUser, + 'text': text, 'timestamp': timestamp.toIso8601String(), - 'isLoading': isLoading, + 'isRecognizing': isRecognizing, + 'hasImage': hasImage, + 'imagePath': imagePath, + 'meta': meta, }; } // 创建一个加载中的消息 factory Message.loading() { return Message( - role: 'assistant', - content: '', + isUser: false, + text: '', timestamp: DateTime.now(), - isLoading: true, + isRecognizing: true, ); } // 复制并修改 Message copyWith({ - String? role, - String? content, + bool? isUser, + String? text, DateTime? timestamp, - bool? isLoading, + bool? isRecognizing, + bool? hasImage, + String? imagePath, + Map? meta, }) { return Message( - role: role ?? this.role, - content: content ?? this.content, + isUser: isUser ?? this.isUser, + text: text ?? this.text, timestamp: timestamp ?? this.timestamp, - isLoading: isLoading ?? this.isLoading, + isRecognizing: isRecognizing ?? this.isRecognizing, + hasImage: hasImage ?? this.hasImage, + imagePath: imagePath ?? this.imagePath, + meta: meta ?? this.meta, ); } } diff --git a/lib/data/services/network/api.dart b/lib/data/services/network/api.dart index 1bb13c1c8..ff8adaa70 100644 --- a/lib/data/services/network/api.dart +++ b/lib/data/services/network/api.dart @@ -89,4 +89,13 @@ class Api { params: params, ); } + + //举报AI内容 + static reportAiContent([params]) { + return DioManager().request( + NWMethod.post, + '/api/home/user_reportaicontent', + params: params, + ); + } } diff --git a/lib/modules/agent/bindings/agent_binding.dart b/lib/modules/agent/bindings/agent_binding.dart index 812e44d8b..ebb69cab2 100644 --- a/lib/modules/agent/bindings/agent_binding.dart +++ b/lib/modules/agent/bindings/agent_binding.dart @@ -1,9 +1,11 @@ import 'package:get/get.dart'; import '../controllers/agent_controller.dart'; +import '../controllers/report_controller.dart'; class AgentBinding extends Bindings { @override void dependencies() { Get.lazyPut(() => AgentController()); + Get.lazyPut(() => ReportController()); } -} \ No newline at end of file +} diff --git a/lib/modules/agent/controllers/report_controller.dart b/lib/modules/agent/controllers/report_controller.dart new file mode 100644 index 000000000..0bae0106a --- /dev/null +++ b/lib/modules/agent/controllers/report_controller.dart @@ -0,0 +1,79 @@ +import 'package:get/get.dart'; +import 'agent_controller.dart'; // 确保导入Message模型 +import 'package:flutter/material.dart'; +import '../../../data/services/network/api.dart'; + +class ReportController extends GetxController { + // 当前举报的消息 + final reportingMessage = Rxn(); + + // 选择的举报原因 + List selectedReasons = []; + + // 举报描述 + final reportDescription = ''.obs; + + // 初始化举报状态 + void initReport(Message message) { + reportingMessage.value = message; + selectedReasons.clear(); + reportDescription.value = ''; + } + + // 切换举报原因选择状态 + void toggleReason(String reason) { + if (selectedReasons.contains(reason)) { + selectedReasons.remove(reason); + } else { + selectedReasons.add(reason); + } + update(); + } + + // 更新举报描述 + void updateDescription(String text) { + reportDescription.value = text; + } + + // 提交举报 + Future submitReport() async { + if (reportingMessage.value == null) return; + + // 构建举报数据 + final reportData = { + 'describe': reportDescription.value, + // 将Message对象转换为可序列化的Map + 'message': [], + // 同样处理reportContext + 'reportContext': reportingMessage.value!.text, + + 'reporttype': selectedReasons.toString(), + }; + + print('提交举报数据: ${reportData}'); + + //调用API提交举报: + var response = await Api.reportAiContent(reportData); + + if (response != null) { + print('提交举报响应: $response'); + } + + // 提交成功后重置状态 + selectedReasons.clear(); + reportDescription.value = ''; + reportingMessage.value = null; + + // 关闭举报表单 + Navigator.of(Get.context!).pop(); + + // 显示成功通知 + Get.snackbar( + '提交成功', + '举报已提交,我们会尽快处理', + backgroundColor: Colors.green.withOpacity(0.8), + colorText: Colors.white, + duration: const Duration(seconds: 2), + ); + } +} diff --git a/lib/modules/agent/views/agent_view.dart b/lib/modules/agent/views/agent_view.dart index 54cb541d3..15044c63c 100644 --- a/lib/modules/agent/views/agent_view.dart +++ b/lib/modules/agent/views/agent_view.dart @@ -2,7 +2,12 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:get/get.dart'; import '../controllers/agent_controller.dart'; +import '../controllers/report_controller.dart'; import 'message_bubble.dart'; +import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import '../../../core/theme/app_colors.dart'; +import 'package:haptic_feedback/haptic_feedback.dart'; class AgentView extends StatelessWidget { const AgentView({Key? key}) : super(key: key); @@ -163,15 +168,32 @@ class AgentView extends StatelessWidget { .messages[controller.messages.length - 1 - index]; return Padding( padding: const EdgeInsets.only(bottom: 8), - child: MessageBubble( - isUser: message.isUser, - message: message.text, - timestamp: message.timestamp, - isRecognizing: message.isRecognizing, - hasImage: message.hasImage, - imagePath: message.imagePath, - meta: message.meta, - ), + child: !message.isUser + ? GestureDetector( + onLongPressStart: + (LongPressStartDetails details) { + _onLongPressMessageContent( + context, isDarkMode, details, message); + }, + child: MessageBubble( + isUser: message.isUser, + message: message.text, + timestamp: message.timestamp, + isRecognizing: message.isRecognizing, + hasImage: message.hasImage, + imagePath: message.imagePath, + meta: message.meta, + ), + ) + : MessageBubble( + isUser: message.isUser, + message: message.text, + timestamp: message.timestamp, + isRecognizing: message.isRecognizing, + hasImage: message.hasImage, + imagePath: message.imagePath, + meta: message.meta, + ), ); }, ), @@ -522,6 +544,280 @@ class AgentView extends StatelessWidget { ); } + void _onLongPressMessageContent(BuildContext context, bool isDarkMode, + LongPressStartDetails details, Message message) { + Haptics.vibrate(HapticsType.success); + RenderBox? renderBox = + Overlay.of(context).context.findRenderObject() as RenderBox; + final RelativeRect position = RelativeRect.fromRect( + Rect.fromLTRB( + details.globalPosition.dx, + details.globalPosition.dy, + details.globalPosition.dx + 110, // 菜单显示位置X轴坐标 + details.globalPosition.dy - 40, // 菜单显示位置Y轴坐标 + ), + Offset.zero & renderBox.size, + ); + + showMenu( + context: context, + position: position, + color: isDarkMode ? AppColors.cardBackground : Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12.r), + ), + items: [ + _popupMenuEntry( + Icon( + Icons.copy, + size: 20.w, + color: isDarkMode ? Colors.white : Colors.black87, + ), + '复制', + isDarkMode ? Colors.white : Colors.black87, + () { + Clipboard.setData( + ClipboardData( + text: message.text, + ), + ).then((value) => Get.snackbar( + 'success'.tr, // 成功 + '复制成功', + backgroundColor: Colors.blue.withOpacity(0.8), + colorText: Colors.white, + )); + }, + ), + // 自定义分隔线样式 + PopupMenuItem( + height: 1, // 控制间距 + enabled: false, + child: Divider( + height: 1, + thickness: 0.8, + indent: 0, + endIndent: 0, + color: isDarkMode ? Colors.grey[700] : Colors.grey[300], + ), + ), + _popupMenuEntry( + Icon( + Icons.report, + size: 20.w, + color: isDarkMode ? Colors.red[700] : Colors.red, + ), + '举报'.tr, // 举报 + isDarkMode ? Colors.red[700]! : Colors.red, + () { + // 实现举报功能 + final reportController = Get.find(); + reportController.initReport(message); + + _showReportForm(context, isDarkMode); + // showModalBottomSheet( + // context: context, + // isScrollControlled: true, // 关键:允许弹窗随键盘移动 + // backgroundColor: + // isDarkMode ? AppColors.cardBackground : Colors.white, + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.vertical(top: Radius.circular(16.r)), + // ), + // builder: (BuildContext context) { + // return Padding( + // // 添加底部内边距以容纳键盘 + // padding: EdgeInsets.only( + // bottom: MediaQuery.of(context).viewInsets.bottom, + // ), + // child: Container( + // padding: EdgeInsets.all(16.w), + // child: SingleChildScrollView( + // // 添加滚动视图 + // child: Column( + // mainAxisSize: MainAxisSize.min, + // crossAxisAlignment: CrossAxisAlignment.stretch, + // children: [ + // Stack( + // alignment: Alignment.center, + // children: [ + // Center( + // child: Text( + // '举报', + // style: TextStyle( + // fontSize: 18.sp, + // fontWeight: FontWeight.bold, + // color: isDarkMode + // ? Colors.white + // : Colors.black, + // ), + // ), + // ), + // SizedBox( + // height: 20.w, + // ), + // Positioned( + // right: 0, + // child: IconButton( + // icon: Icon( + // Icons.close, + // color: isDarkMode + // ? Colors.grey[400] + // : Colors.black54, + // ), + // onPressed: () => Navigator.pop(context), + // ), + // ), + // ], + // ), + // Container( + // padding: EdgeInsets.symmetric(horizontal: 12.w), + // margin: EdgeInsets.only(bottom: 10.w), + // child: Divider( + // height: 1, + // color: Colors.grey[300], + // ), + // ), + // Wrap( + // spacing: 8.w, + // runSpacing: 8.h, + // children: [ + // _buildReportChip('有害/不安全', isDarkMode), + // _buildReportChip('色情低俗', isDarkMode), + // _buildReportChip('误导攻击', isDarkMode), + // _buildReportChip('违法犯罪', isDarkMode), + // _buildReportChip('隐私相关', isDarkMode), + // _buildReportChip('侵犯我的著作权、名誉权等', isDarkMode), + // _buildReportChip('其他', isDarkMode), + // ], + // ), + // SizedBox(height: 16.h), + // Container( + // padding: EdgeInsets.all(12.w), + // decoration: BoxDecoration( + // color: isDarkMode + // ? Colors.grey[800] + // : Colors.grey[200], + // borderRadius: BorderRadius.circular(8.r), + // ), + // child: TextField( + // maxLines: 3, + // style: TextStyle( + // color: isDarkMode ? Colors.white : Colors.black, + // ), + // decoration: InputDecoration( + // hintText: '我们想知道你举报的原因,你可以描述你遇到的问题。', + // hintStyle: TextStyle( + // color: isDarkMode + // ? Colors.white70 + // : Colors.black54, + // fontSize: 14.sp, + // ), + // border: InputBorder.none, + // ), + // ), + // ), + // SizedBox(height: 14.h), + // ElevatedButton( + // style: ElevatedButton.styleFrom( + // backgroundColor: Colors.blue, + // foregroundColor: Colors.white, + // padding: EdgeInsets.symmetric(vertical: 12.h), + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(8.r), + // ), + // ), + // child: Text('提交'), + // onPressed: () { + // Navigator.pop(context); + // Get.snackbar( + // '提示', + // '举报已提交,我们会尽快处理', + // backgroundColor: Colors.green.withOpacity(0.8), + // colorText: Colors.white, + // ); + // }, + // ), + // SizedBox(height: 8.h), + // ], + // ), + // ), + // ), + // ); + // }, + // ); + }, + ), + ], + ); + } + + // 更新_showReportForm方法 + void _showReportForm(BuildContext context, bool isDarkMode) { + showModalBottomSheet( + context: context, + isScrollControlled: true, + backgroundColor: isDarkMode ? AppColors.cardBackground : Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.vertical(top: Radius.circular(16.r)), + ), + builder: (BuildContext context) { + return Padding( + padding: EdgeInsets.only( + bottom: MediaQuery.of(context).viewInsets.bottom, + ), + child: _ReportForm(isDarkMode: isDarkMode), + ); + }, + ); + } + + // // 添加这个辅助方法来创建举报选项 + // Widget _buildReportChip(String label, bool isDarkMode) { + // return ChoiceChip( + // label: Text( + // label, + // style: TextStyle( + // color: isDarkMode ? Colors.white : Colors.black87, + // fontSize: 14.sp, + // ), + // ), + // selected: false, + // backgroundColor: isDarkMode ? Colors.grey[800] : Colors.grey[200], + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(16.r), + // ), + // onSelected: (bool selected) { + // // 可以在这里处理选择逻辑 + // }, + // ); + // } + + PopupMenuEntry _popupMenuEntry( + Icon icon, + String title, + Color color, + Function() onTap, + ) { + return PopupMenuItem( + onTap: onTap, + child: SizedBox( + width: 140.w, + child: Row( + children: [ + icon, + 8.horizontalSpace, + Text( + title, + style: TextStyle( + color: color, + fontSize: 14.sp, + ), + ), + ], + ), + ), + ); + } + // 构建提示选项芯片 Widget _buildPromptChip({ required BuildContext context, @@ -567,6 +863,151 @@ class AgentView extends StatelessWidget { } } +class _ReportForm extends StatelessWidget { + final bool isDarkMode; + final ReportController reportController = Get.find(); + + _ReportForm({required this.isDarkMode}); + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.all(16.w), + child: SingleChildScrollView( + child: GetBuilder( + builder: (_) => Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Stack( + alignment: Alignment.center, + children: [ + Center( + child: Text( + '举报', + style: TextStyle( + fontSize: 18.sp, + fontWeight: FontWeight.bold, + color: isDarkMode ? Colors.white : Colors.black, + ), + ), + ), + Positioned( + right: 0, + child: IconButton( + icon: Icon( + Icons.close, + color: isDarkMode ? Colors.grey[400] : Colors.black54, + ), + onPressed: () => Navigator.pop(context), + ), + ), + ], + ), + Container( + padding: EdgeInsets.symmetric(horizontal: 12.w), + margin: EdgeInsets.only(bottom: 10.w), + child: Divider( + height: 1, + color: Colors.grey[300], + ), + ), + GetBuilder( + builder: (controller) { + return Wrap( + spacing: 8.w, + runSpacing: 8.h, + children: [ + _buildReportChip('有害/不安全', isDarkMode, controller), + _buildReportChip('色情低俗', isDarkMode, controller), + _buildReportChip('误导攻击', isDarkMode, controller), + _buildReportChip('违法犯罪', isDarkMode, controller), + _buildReportChip('隐私相关', isDarkMode, controller), + _buildReportChip('侵犯我的著作权、名誉权等', isDarkMode, controller), + _buildReportChip('其他', isDarkMode, controller), + ], + ); + }, + ), + SizedBox(height: 16.h), + Container( + padding: EdgeInsets.all(12.w), + decoration: BoxDecoration( + color: isDarkMode ? Colors.grey[800] : Colors.grey[200], + borderRadius: BorderRadius.circular(8.r), + ), + child: TextField( + maxLines: 3, + onChanged: reportController.updateDescription, + style: TextStyle( + color: isDarkMode ? Colors.white : Colors.black, + ), + decoration: InputDecoration( + hintText: '我们想知道你举报的原因,你可以描述你遇到的问题。', + hintStyle: TextStyle( + color: isDarkMode ? Colors.white70 : Colors.black54, + fontSize: 14.sp, + ), + border: InputBorder.none, + ), + ), + ), + SizedBox(height: 14.h), + ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: Colors.blue, + foregroundColor: Colors.white, + padding: EdgeInsets.symmetric(vertical: 12.h), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8.r), + ), + ), + child: Text('提交'), + onPressed: () => reportController.submitReport(), + ), + SizedBox(height: 8.h), + ], + ), + ), + ), + ); + } + + Widget _buildReportChip( + String label, bool isDarkMode, ReportController controller) { + final isSelected = reportController.selectedReasons.contains(label); + + return GestureDetector( + onTap: () => reportController.toggleReason(label), + child: Container( + padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 8.h), + decoration: BoxDecoration( + color: isSelected + ? Colors.red + : (isDarkMode ? Colors.grey[800] : Colors.grey[200]), + borderRadius: BorderRadius.circular(16.r), + border: Border.all( + color: isSelected + ? Colors.red[700]! + : (isDarkMode ? Colors.grey[700]! : Colors.grey[300]!), + width: isSelected ? 1.0 : 0.5, + ), + ), + child: Text( + label, + style: TextStyle( + color: isSelected + ? Colors.white + : (isDarkMode ? Colors.white : Colors.black87), + fontSize: 14.sp, + fontWeight: isSelected ? FontWeight.bold : FontWeight.normal, + ), + ), + ), + ); + } +} + // 声音柱动画组件 class _SoundBar extends StatefulWidget { final double delay; diff --git a/lib/modules/agent/views/message_bubble.dart b/lib/modules/agent/views/message_bubble.dart index 94bbb5415..b4a7a0ed4 100644 --- a/lib/modules/agent/views/message_bubble.dart +++ b/lib/modules/agent/views/message_bubble.dart @@ -406,7 +406,7 @@ class MessageBubble extends GetView { fontSize: 14, ), ), - selectable: true, + //selectable: true, ); } // 用户消息仍然使用普通文本 diff --git a/lib/modules/login/controllers/login_controller.dart b/lib/modules/login/controllers/login_controller.dart index 951885884..1ac7e8af7 100644 --- a/lib/modules/login/controllers/login_controller.dart +++ b/lib/modules/login/controllers/login_controller.dart @@ -10,9 +10,11 @@ import 'googleLogin.dart'; import 'weixinLogin.dart'; import '../../../data/services/network/api.dart'; import '../../../../data/models/user_Info.dart'; +import '../../common/webview_page.dart'; //import 'package:shared_preferences/shared_preferences.dart'; import 'package:get_storage/get_storage.dart'; import 'package:device_info_plus/device_info_plus.dart'; +import 'dart:io'; enum LoginViewState { welcome, // 欢迎页面 @@ -175,6 +177,18 @@ class LoginController extends GetxController { void onInit() { super.onInit(); _viewState.value = LoginViewState.welcome; + + _hasAcceptedPrivacy.value = + _storage.read('hasAcceptedPrivacy') ?? false; // 从本地存储中读取是否已接受隐私政策 + + //使用addPostFrameCallback确保在构建完成后显示对话框 + WidgetsBinding.instance.addPostFrameCallback((_) { + //如果用户未接受隐私政策,显示弹窗 + if (!_hasAcceptedPrivacy.value) { + _showPrivacyDialog(); + } + }); + _initDeviceInfo(); } @@ -185,6 +199,128 @@ class LoginController extends GetxController { super.onClose(); } + // 显示隐私政策弹窗 + void _showPrivacyDialog() { + Get.dialog( + WillPopScope( + onWillPop: () async => false, // 禁止通过返回键关闭弹窗 + child: Dialog( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(16), + ), + child: Container( + padding: const EdgeInsets.all(20), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const Text( + 'DeapSound 声明', + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 16), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 20), + child: Text.rich( + TextSpan( + children: [ + const TextSpan( + text: '欢迎使用DeapSound,请充分阅读', + style: TextStyle(fontSize: 14), + ), + WidgetSpan( + child: GestureDetector( + onTap: () { + String url = 'https://www.deepsoud.com/ysxy.html'; + if (Get.locale?.toString() != 'zh_CN') { + url = 'https://www.deepsoud.com/ysxy_en.html'; + } + Get.to(() => WebViewPage( + url: url, + title: 'privacyPolicy'.tr, + )); + }, + child: Text( + '《隐私政策》', + style: TextStyle( + fontSize: 14, + color: const Color(0xFF3B82F6), + ), + ), + ), + ), + const TextSpan( + text: '和', + style: TextStyle(fontSize: 14), + ), + WidgetSpan( + child: GestureDetector( + onTap: () { + String url = 'https://www.deepsoud.com/yhxy.html'; + if (Get.locale?.toString() != 'zh_CN') { + url = 'https://www.deepsoud.com/yhxy_en.html'; + } + Get.to(() => WebViewPage( + url: url, + title: 'userAgreement'.tr, + )); + }, + child: Text( + '《用户协议》', + style: TextStyle( + fontSize: 14, + color: const Color(0xFF3B82F6), + ), + ), + ), + ), + ], + ), + textAlign: TextAlign.center, + ), + ), + const SizedBox(height: 20), + Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + TextButton( + onPressed: () { + // 用户不同意,退出应用 + exit(0); + }, + style: TextButton.styleFrom( + foregroundColor: Colors.black54, + ), + child: const Text('取消'), + ), + ElevatedButton( + onPressed: () { + // 用户同意,关闭弹窗并继续 + _hasAcceptedPrivacy.value = true; + Get.back(); + }, + style: ElevatedButton.styleFrom( + backgroundColor: const Color(0xFF0066CC), + foregroundColor: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + child: const Text('同意并进入'), + ), + ], + ), + ], + ), + ), + ), + ), + barrierDismissible: false, // 禁止点击外部关闭弹窗 + ); + } + // 初始化设备信息 Future _initDeviceInfo() async { try { @@ -462,13 +598,14 @@ class LoginController extends GetxController { //验证隐私协议勾选状态 if (!_hasAcceptedPrivacy.value) { - Get.snackbar( - 'tip'.tr, - 'pleaseAcceptPrivacyPolicy'.tr, - snackPosition: SnackPosition.TOP, - backgroundColor: Colors.red.withOpacity(0.1), - colorText: Colors.red, - ); + // Get.snackbar( + // 'tip'.tr, + // 'pleaseAcceptPrivacyPolicy'.tr, + // snackPosition: SnackPosition.TOP, + // backgroundColor: Colors.red.withOpacity(0.1), + // colorText: Colors.red, + // ); + _showPrivacyDialog(); return; } _isLoading.value = true;