新增编译模式下对日志进行输出,并且更新了hive缓存取出后进行连通性判断
Build Android APK / 编译 libcore.aar (push) Has been cancelled
Build Android APK / 编译 Android APK (release) (push) Has been cancelled
Build Android APK / 创建 GitHub Release (push) Has been cancelled
Build Multi-Platform / 编译 libcore (iOS/tvOS) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Android) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Windows) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (macOS) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Linux) (push) Has been cancelled
Build Multi-Platform / 构建 Android APK (push) Has been cancelled
Build Multi-Platform / 构建 Windows (push) Has been cancelled
Build Multi-Platform / 构建 macOS (push) Has been cancelled
Build Multi-Platform / 构建 Linux (push) Has been cancelled
Build Multi-Platform / 构建 iOS (push) Has been cancelled
Build Multi-Platform / 创建 Release (push) Has been cancelled
Build Windows / 编译 libcore (Windows) (push) Has been cancelled
Build Windows / build (push) Has been cancelled

(cherry picked from commit 40f95d0c463c31428c5f25118f59b0c3a60e73ba)
This commit is contained in:
2025-11-01 08:51:11 -07:00
committed by speakeloudest
parent 4c5763647d
commit 2b80fcba0d
6 changed files with 466 additions and 119 deletions
@@ -50,81 +50,76 @@ class KRHomeBottomPanel extends GetView<KRHomeController> {
}
Widget _kr_buildDefaultView(BuildContext context) {
// 使用 GetX 的 .obs 变量来避免重复访问
final hasValidSubscription =
controller.kr_subscribeService.kr_currentSubscribe.value != null;
final isTrial = controller.kr_subscribeService.kr_isTrial;
final isLastDay = controller.kr_subscribeService.kr_isLastDayOfSubscription;
// 🔧 Android 15 增强:增加防御性检查,避免空指针
bool hasValidSubscription = false;
bool isTrial = false;
bool isLastDay = false;
try {
hasValidSubscription = controller.kr_subscribeService.kr_currentSubscribe.value != null;
isTrial = controller.kr_subscribeService.kr_isTrial.value;
isLastDay = controller.kr_subscribeService.kr_isLastDayOfSubscription.value;
} catch (e) {
KRLogUtil.kr_e('获取订阅数据异常: $e', tag: 'HomeBottomPanel');
}
final isNotLoggedIn = controller.kr_currentViewStatus.value ==
KRHomeViewsStatus.kr_notLoggedIn;
KRLogUtil.kr_i('构建默认视图', tag: 'HomeBottomPanel');
KRLogUtil.kr_i('是否未登录: $isNotLoggedIn', tag: 'HomeBottomPanel');
KRLogUtil.kr_i('是否有有效订阅: $hasValidSubscription', tag: 'HomeBottomPanel');
KRLogUtil.kr_i('是否试用: ${isTrial.value}', tag: 'HomeBottomPanel');
KRLogUtil.kr_i('是否试用: $isTrial', tag: 'HomeBottomPanel');
KRLogUtil.kr_i('当前高度: ${controller.kr_bottomPanelHeight.value}',
tag: 'HomeBottomPanel');
// 🔧 关键修复:统一布局逻辑,确保无论登录状态如何都显示完整UI
return Column(
mainAxisSize: MainAxisSize.min,
children: [
// 主要内容区域
if (isNotLoggedIn)
// 未登录状态下,使用 SingleChildScrollView 让内容自然撑开
SingleChildScrollView(
// 主要内容区域 - 始终使用 Expanded + ScrollView 确保内容可见
Expanded(
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
// 🔧 核心修复:无论登录状态,都显示核心卡片(订阅或连接信息)
if (hasValidSubscription)
// 已订阅:显示连接信息卡片
Container(
margin: EdgeInsets.only(top: 12.h),
child: const KRHomeConnectionInfoView(),
)
else
// 未订阅(包括未登录):始终显示订阅卡片
Container(
margin: EdgeInsets.only(top: 12.h, left: 12.w, right: 12.w),
child: const KRSubscriptionCard(),
),
// 2. 如果已订阅且是试用,展示试用卡片
if (hasValidSubscription && isTrial)
Container(
margin: EdgeInsets.only(top: 12.h),
child: const KRHomeTrialCard(),
),
// 3. 如果已订阅且是最后一天,展示最后一天卡片
if (hasValidSubscription && isLastDay && !isTrial)
Container(
margin: EdgeInsets.only(top: 12.h),
child: const KRHomeLastDayCard(),
),
// 4. 连接选项(分组和国家入口)- 始终显示
Padding(
padding:
EdgeInsets.symmetric(horizontal: 16.w, vertical: 12.h),
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 12.h),
child: const KRHomeConnectionOptionsView(),
),
],
),
)
else
// 已登录状态下,使用固定高度
Expanded(
child: SingleChildScrollView(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
// 1. 如果已订阅,展示当前连接卡片
if (hasValidSubscription)
Container(
margin: EdgeInsets.only(top: 12.h),
child: const KRHomeConnectionInfoView())
else
Container(
margin:
EdgeInsets.only(top: 12.h, left: 12.w, right: 12.w),
child: const KRSubscriptionCard()),
// 2. 如果已订阅且是试用,展示试用卡片
if (hasValidSubscription && isTrial.value)
Container(
margin: EdgeInsets.only(top: 12.h),
child: const KRHomeTrialCard(),
),
// 3. 如果已订阅且是最后一天,展示最后一天卡片
if (hasValidSubscription && isLastDay.value && !isTrial.value)
Container(
margin: EdgeInsets.only(top: 12.h),
child: const KRHomeLastDayCard(),
),
// 4. 连接选项(分组和国家入口)
Padding(
padding:
EdgeInsets.symmetric(horizontal: 16.w, vertical: 12.h),
child: const KRHomeConnectionOptionsView(),
),
],
),
),
),
),
],
);
}
@@ -134,11 +129,50 @@ class KRHomeBottomPanel extends GetView<KRHomeController> {
KRLogUtil.kr_i('当前高度: ${controller.kr_bottomPanelHeight.value}',
tag: 'HomeBottomPanel');
return Center(
child: CircularProgressIndicator(
color: Colors.green,
strokeWidth: 2.0,
),
// 🔧 Android 15 紧急修复:加载时显示完整的默认内容 + 加载指示器
// 而不是只显示一个转圈圈,避免用户看到空白面板
return Stack(
children: [
// 底层:显示默认内容(半透明)
Opacity(
opacity: 0.5,
child: _kr_buildDefaultView(Get.context!),
),
// 顶层:加载指示器
Center(
child: Container(
padding: EdgeInsets.all(16.w),
decoration: BoxDecoration(
color: Get.context!.theme.cardColor,
borderRadius: BorderRadius.circular(12.r),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.1),
blurRadius: 10,
offset: const Offset(0, 2),
),
],
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
CircularProgressIndicator(
color: Colors.green,
strokeWidth: 3.0,
),
SizedBox(height: 12.h),
Text(
'正在加载...',
style: TextStyle(
fontSize: 14.sp,
color: Get.context!.theme.textTheme.bodyMedium?.color,
),
),
],
),
),
),
],
);
}