fix: 对app进行瘦身

This commit is contained in:
2025-12-18 03:40:33 -08:00
parent 4f09267b4b
commit 83d201b78d
5471 changed files with 16 additions and 3302 deletions
@@ -11,7 +11,6 @@ import 'package:flutter/material.dart';
import 'package:qr_flutter/qr_flutter.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:kaer_with_panels/app/widgets/kr_app_text_style.dart';
import 'package:kaer_with_panels/app/modules/kr_main/controllers/kr_main_controller.dart';
import 'package:easy_refresh/easy_refresh.dart';
import 'package:kaer_with_panels/app/common/app_run_data.dart';
@@ -129,103 +128,6 @@ class KRInviteController extends GetxController {
KRCommonUtil.kr_showToast(AppTranslations.kr_invite.copiedToClipboard);
}
Future<void> kr_handleQRShare() async {
if (!await kr_checkLoginStatus()) {
Get.find<KRMainController>().kr_setPage(0);
return;
}
if (kr_referCode.isEmpty) {
await _kr_fetchUserInfo();
if (kr_referCode.isEmpty) {
KRCommonUtil.kr_showToast(AppTranslations.kr_invite.getInviteCodeFailed);
return;
}
}
final qrContent = kr_getQRCodeContent();
if (qrContent.isEmpty) {
KRCommonUtil.kr_showToast(AppTranslations.kr_invite.generateQRCodeFailed);
return;
}
// 只有在登录状态下才弹出二维码对话框
if (KRAppRunData.getInstance().kr_isLogin.value) {
Get.dialog(
Dialog(
backgroundColor: Theme.of(Get.context!).cardColor,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16.r),
),
child: Container(
padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 24.h),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Text(
AppTranslations.kr_invite.shareQR,
style: KrAppTextStyle(
fontSize: 17,
fontWeight: FontWeight.w600,
color: Theme.of(Get.context!).textTheme.titleMedium?.color,
),
),
SizedBox(height: 16.h),
Container(
padding: EdgeInsets.all(16.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12.r),
border: Border.all(
color: Theme.of(Get.context!).dividerColor.withOpacity(0.1),
),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.05),
blurRadius: 10,
offset: Offset(0, 2),
),
],
),
child: QrImageView(
data: qrContent,
version: QrVersions.auto,
size: 200.w,
backgroundColor: Colors.white,
foregroundColor: Colors.black,
),
),
SizedBox(height: 20.h),
Container(
width: double.infinity,
height: 44.w,
child: TextButton(
onPressed: () => Get.back(),
style: TextButton.styleFrom(
backgroundColor: Theme.of(Get.context!).primaryColor.withOpacity(0.1),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(22.r),
),
),
child: Text(
AppTranslations.kr_invite.close,
style: TextStyle(
color: Theme.of(Get.context!).textTheme.bodyMedium?.color,
fontSize: 16.sp,
fontWeight: FontWeight.w500,
fontFamily: 'AlibabaPuHuiTi-Regular',
),
),
),
),
],
),
),
),
);
}
}
void kr_viewRewardDetails() {
// TODO: 实现查看奖励明细功能
}
@@ -243,48 +145,6 @@ class KRInviteController extends GetxController {
void increment() => count.value++;
/// 处理链接分享
Future<void> kr_handleLinkShare() async {
if (!await kr_checkLoginStatus()) {
Get.find<KRMainController>().kr_setPage(0);
return;
}
if (kr_referCode.isEmpty) {
await _kr_fetchUserInfo();
if (kr_referCode.isEmpty) {
KRCommonUtil.kr_showToast(AppTranslations.kr_invite.getInviteCodeFailed);
return;
}
}
final shareLink = kr_getShareLink();
if (shareLink.isEmpty) {
KRCommonUtil.kr_showToast(AppTranslations.kr_invite.generateShareLinkFailed);
return;
}
await _kr_copyToClipboard(shareLink);
}
/// 处理复制邀请码
Future<void> kr_handleCopyInviteCode() async {
if (!await kr_checkLoginStatus()) {
Get.find<KRMainController>().kr_setPage(0);
return;
}
if (kr_referCode.isEmpty) {
await _kr_fetchUserInfo();
if (kr_referCode.isEmpty) {
KRCommonUtil.kr_showToast(AppTranslations.kr_invite.getInviteCodeFailed);
return;
}
}
await _kr_copyToClipboard(kr_referCode.value);
}
/// 处理绑定邀请码
Future<void> kr_handleBindInviteCode() async {
final text = otherInviteCodeController.text;