import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import '../../../core/theme/app_colors.dart'; import '../controllers/aichat_stats_controller.dart'; import '../../../data/models/user_Info.dart'; class AiChatStatsView extends GetView { const AiChatStatsView({Key? key}) : super(key: key); @override Widget build(BuildContext context) { final isDarkMode = Theme.of(context).brightness == Brightness.dark; return Scaffold( backgroundColor: isDarkMode ? AppColors.darkBackground : Colors.grey[50], appBar: _buildAppBar(isDarkMode), body: _buildBody(isDarkMode), ); } PreferredSizeWidget _buildAppBar(bool isDarkMode) { return AppBar( leading: IconButton( icon: Icon(Icons.arrow_back_ios, color: isDarkMode ? Colors.white : Colors.black, size: 20.sp), onPressed: () => Get.back(), ), backgroundColor: isDarkMode ? AppColors.darkBackground : Colors.white, elevation: 0.5, title: Text( 'aiChat'.tr, // AI聊天 style: TextStyle( fontSize: 17.sp, fontWeight: FontWeight.w600, color: isDarkMode ? Colors.white : Colors.black), ), centerTitle: true, ); } Widget _buildBody(bool isDarkMode) { return Column( children: [_buildIntegralRow(isDarkMode)], ); } Widget _buildIntegralRow(bool isDarkMode) { return Obx(() { final _ = User.refreshTick.value; final u = User.instance; return Padding( padding: EdgeInsets.all(16.w), child: Container( padding: EdgeInsets.all(16.w), decoration: BoxDecoration( color: isDarkMode ? AppColors.cardBackground : Colors.white, borderRadius: BorderRadius.circular(12.r), boxShadow: [ BoxShadow( color: Colors.black.withValues(alpha: 0.05), blurRadius: 10, offset: const Offset(0, 2)), ], ), child: Row( children: [ Icon(Icons.chat_bubble_outline, color: AppColors.primary, size: 20.sp), SizedBox(width: 8.w), Expanded( child: Text( 'remainingQuota'.tr, style: TextStyle( fontSize: 16.sp, fontWeight: FontWeight.w600, color: isDarkMode ? Colors.white : Colors.black), ), ), Text( '${u.aichatintegral}/${u.aichattotalintegral}', style: TextStyle( fontSize: 16.sp, fontWeight: FontWeight.w600, color: isDarkMode ? Colors.white : Colors.black), ), ], ), ), ); }); } }