优化部分安卓机型可能存在连接超时等问题新增日志排查
(cherry picked from commit e0fcc27f28f27321a49115df86507e3ac55e8ef8)
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:kaer_with_panels/app/localization/app_translations.dart';
|
||||
import 'dart:io';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
||||
import 'package:kaer_with_panels/app/routes/app_pages.dart';
|
||||
import 'package:kaer_with_panels/app/utils/kr_subscribe_navigation_util.dart';
|
||||
@@ -29,7 +30,6 @@ class KRSubscriptionCard extends StatelessWidget {
|
||||
print('🎴 [SubscriptionCard] 卡片颜色: ${Theme.of(context).cardColor}');
|
||||
print('🎴 [SubscriptionCard] 主题亮度: ${Theme.of(context).brightness}');
|
||||
print('🎴 [SubscriptionCard] 文本颜色: ${Theme.of(context).textTheme.bodyMedium?.color}');
|
||||
print('🎴 [SubscriptionCard] ScreenUtil 测试 - 12.w=${12.w}, 16.h=${16.h}, 44.w=${44.w}');
|
||||
|
||||
// 🔧 关键修复:完全移除 ScreenUtil,使用固定像素值避免缩放问题
|
||||
return Container(
|
||||
@@ -82,8 +82,36 @@ class KRSubscriptionCard extends StatelessWidget {
|
||||
height: 46,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
print('🎴 [SubscriptionCard] 订阅按钮被点击');
|
||||
KRSubscribeNavigationUtil.navigateToPurchase(tag: 'SubscriptionCard');
|
||||
print('🎴 [SubscriptionCard] ========== 订阅按钮被点击 ==========');
|
||||
print('🎴 [SubscriptionCard] 当前时间: ${DateTime.now()}');
|
||||
print('🎴 [SubscriptionCard] 准备调用导航方法...');
|
||||
|
||||
// 🔧 关键修复:文件写入改为非阻塞,不影响主流程
|
||||
Future(() async {
|
||||
try {
|
||||
final dir = await getApplicationDocumentsDirectory();
|
||||
final debugFile = File('${dir.path}/SUBSCRIBE_BUTTON_DEBUG.txt');
|
||||
await debugFile.writeAsString(
|
||||
'=' * 60 + '\n'
|
||||
'🎴 订阅按钮被点击!\n'
|
||||
'时间: ${DateTime.now()}\n'
|
||||
'版本标识: Android15_Fix_v5\n'
|
||||
'=' * 60 + '\n',
|
||||
mode: FileMode.append,
|
||||
);
|
||||
print('🎴 [SubscriptionCard] ✅ 按钮点击日志已写入文件: ${debugFile.path}');
|
||||
} catch (e) {
|
||||
print('🎴 [SubscriptionCard] ❌ 写入按钮点击日志失败: $e');
|
||||
}
|
||||
});
|
||||
|
||||
try {
|
||||
KRSubscribeNavigationUtil.navigateToPurchase(tag: 'SubscriptionCard');
|
||||
print('🎴 [SubscriptionCard] 导航方法调用成功');
|
||||
} catch (e, stackTrace) {
|
||||
print('🎴 [SubscriptionCard] ❌ 导航方法调用失败: $e');
|
||||
print('🎴 [SubscriptionCard] StackTrace: $stackTrace');
|
||||
}
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.blue,
|
||||
@@ -114,10 +142,10 @@ class KRSubscriptionCard extends StatelessWidget {
|
||||
bool addBottomPadding = true,
|
||||
}) {
|
||||
return Container(
|
||||
margin: margin ?? EdgeInsets.symmetric(horizontal: 16.w),
|
||||
margin: margin ?? EdgeInsets.symmetric(horizontal: 16),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).cardColor,
|
||||
borderRadius: BorderRadius.circular(12.w),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: IntrinsicWidth(
|
||||
child: child,
|
||||
|
||||
Reference in New Issue
Block a user