修复:大量的ScreenUtil误用,导致界面可能出现问题
(cherry picked from commit 2829da5267a14a9e0f43ff56060a68f1f8b2ca6a)
This commit is contained in:
parent
18ec3e36fc
commit
b7a78aa76a
@ -67,7 +67,7 @@ class KRDeviceManagementView extends GetView<KRDeviceManagementController> {
|
|||||||
size: 64.w,
|
size: 64.w,
|
||||||
color: Theme.of(context).textTheme.bodySmall?.color,
|
color: Theme.of(context).textTheme.bodySmall?.color,
|
||||||
),
|
),
|
||||||
SizedBox(height: 16.w),
|
SizedBox(height: 16.h),
|
||||||
Text(
|
Text(
|
||||||
'暂无登录设备',
|
'暂无登录设备',
|
||||||
style: KrAppTextStyle(
|
style: KrAppTextStyle(
|
||||||
@ -172,7 +172,7 @@ class KRDeviceManagementView extends GetView<KRDeviceManagementController> {
|
|||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.symmetric(
|
padding: EdgeInsets.symmetric(
|
||||||
horizontal: 8.w,
|
horizontal: 8.w,
|
||||||
vertical: 2.w,
|
vertical: 2.h,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.green.withOpacity(0.1),
|
color: Colors.green.withOpacity(0.1),
|
||||||
@ -189,7 +189,7 @@ class KRDeviceManagementView extends GetView<KRDeviceManagementController> {
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 4.w),
|
SizedBox(height: 4.h),
|
||||||
Text(
|
Text(
|
||||||
'ID: ${identifier.substring(0, identifier.length > 12 ? 12 : identifier.length)}...',
|
'ID: ${identifier.substring(0, identifier.length > 12 ? 12 : identifier.length)}...',
|
||||||
style: KrAppTextStyle(
|
style: KrAppTextStyle(
|
||||||
@ -205,7 +205,7 @@ class KRDeviceManagementView extends GetView<KRDeviceManagementController> {
|
|||||||
onPressed: () => controller.deleteDevice(id),
|
onPressed: () => controller.deleteDevice(id),
|
||||||
style: TextButton.styleFrom(
|
style: TextButton.styleFrom(
|
||||||
foregroundColor: Theme.of(context).colorScheme.error,
|
foregroundColor: Theme.of(context).colorScheme.error,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 8.w),
|
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 8.h),
|
||||||
),
|
),
|
||||||
child: Text(
|
child: Text(
|
||||||
'删除',
|
'删除',
|
||||||
@ -219,9 +219,9 @@ class KRDeviceManagementView extends GetView<KRDeviceManagementController> {
|
|||||||
),
|
),
|
||||||
// 分隔线
|
// 分隔线
|
||||||
if (ip.isNotEmpty || lastLogin.isNotEmpty) ...[
|
if (ip.isNotEmpty || lastLogin.isNotEmpty) ...[
|
||||||
SizedBox(height: 12.w),
|
SizedBox(height: 12.h),
|
||||||
Divider(height: 1, color: Theme.of(context).dividerColor),
|
Divider(height: 1, color: Theme.of(context).dividerColor),
|
||||||
SizedBox(height: 12.w),
|
SizedBox(height: 12.h),
|
||||||
],
|
],
|
||||||
// 详细信息
|
// 详细信息
|
||||||
if (ip.isNotEmpty)
|
if (ip.isNotEmpty)
|
||||||
@ -230,7 +230,7 @@ class KRDeviceManagementView extends GetView<KRDeviceManagementController> {
|
|||||||
'IP地址',
|
'IP地址',
|
||||||
ip,
|
ip,
|
||||||
),
|
),
|
||||||
if (ip.isNotEmpty && lastLogin.isNotEmpty) SizedBox(height: 8.w),
|
if (ip.isNotEmpty && lastLogin.isNotEmpty) SizedBox(height: 8.h),
|
||||||
if (lastLogin.isNotEmpty)
|
if (lastLogin.isNotEmpty)
|
||||||
_buildInfoRow(
|
_buildInfoRow(
|
||||||
context,
|
context,
|
||||||
|
|||||||
@ -77,7 +77,7 @@ class KRHomeBottomPanel extends GetView<KRHomeController> {
|
|||||||
children: [
|
children: [
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding:
|
||||||
EdgeInsets.symmetric(horizontal: 16.w, vertical: 12.w),
|
EdgeInsets.symmetric(horizontal: 16.w, vertical: 12.h),
|
||||||
child: const KRHomeConnectionOptionsView(),
|
child: const KRHomeConnectionOptionsView(),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -118,7 +118,7 @@ class KRHomeBottomPanel extends GetView<KRHomeController> {
|
|||||||
// 4. 连接选项(分组和国家入口)
|
// 4. 连接选项(分组和国家入口)
|
||||||
Padding(
|
Padding(
|
||||||
padding:
|
padding:
|
||||||
EdgeInsets.symmetric(horizontal: 16.w, vertical: 12.w),
|
EdgeInsets.symmetric(horizontal: 16.w, vertical: 12.h),
|
||||||
child: const KRHomeConnectionOptionsView(),
|
child: const KRHomeConnectionOptionsView(),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@ -144,7 +144,7 @@ class KRHomeBottomPanel extends GetView<KRHomeController> {
|
|||||||
|
|
||||||
Widget _kr_buildErrorView(BuildContext context) {
|
Widget _kr_buildErrorView(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
height: 200.w,
|
height: 200.h,
|
||||||
padding: EdgeInsets.all(16.w),
|
padding: EdgeInsets.all(16.w),
|
||||||
child: Center(
|
child: Center(
|
||||||
child: Column(
|
child: Column(
|
||||||
@ -155,7 +155,7 @@ class KRHomeBottomPanel extends GetView<KRHomeController> {
|
|||||||
size: 48.w,
|
size: 48.w,
|
||||||
color: Theme.of(context).colorScheme.error,
|
color: Theme.of(context).colorScheme.error,
|
||||||
),
|
),
|
||||||
SizedBox(height: 16.w),
|
SizedBox(height: 16.h),
|
||||||
Text(
|
Text(
|
||||||
AppTranslations.kr_home.error,
|
AppTranslations.kr_home.error,
|
||||||
style: KrAppTextStyle(
|
style: KrAppTextStyle(
|
||||||
@ -164,7 +164,7 @@ class KRHomeBottomPanel extends GetView<KRHomeController> {
|
|||||||
color: Theme.of(context).textTheme.bodyMedium?.color,
|
color: Theme.of(context).textTheme.bodyMedium?.color,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 8.w),
|
SizedBox(height: 8.h),
|
||||||
Text(
|
Text(
|
||||||
AppTranslations.kr_home.checkNetwork,
|
AppTranslations.kr_home.checkNetwork,
|
||||||
style: KrAppTextStyle(
|
style: KrAppTextStyle(
|
||||||
@ -172,7 +172,7 @@ class KRHomeBottomPanel extends GetView<KRHomeController> {
|
|||||||
color: Theme.of(context).textTheme.bodySmall?.color,
|
color: Theme.of(context).textTheme.bodySmall?.color,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 24.w),
|
SizedBox(height: 24.h),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
width: 200.w,
|
width: 200.w,
|
||||||
height: 44.h,
|
height: 44.h,
|
||||||
|
|||||||
@ -26,7 +26,7 @@ class KRHomeConnectionInfoView extends GetView<KRHomeController> {
|
|||||||
return Container(
|
return Container(
|
||||||
margin: EdgeInsets.symmetric(horizontal: 16.w),
|
margin: EdgeInsets.symmetric(horizontal: 16.w),
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 116.w,
|
height: 116.h,
|
||||||
decoration: ShapeDecoration(
|
decoration: ShapeDecoration(
|
||||||
color: Theme.of(context).cardColor,
|
color: Theme.of(context).cardColor,
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
@ -73,7 +73,7 @@ class KRHomeConnectionInfoView extends GetView<KRHomeController> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 10.w),
|
SizedBox(height: 10.h),
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
@ -99,7 +99,7 @@ class KRHomeConnectionInfoView extends GetView<KRHomeController> {
|
|||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 6.w),
|
SizedBox(height: 6.h),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Obx(() {
|
Obx(() {
|
||||||
|
|||||||
@ -26,7 +26,7 @@ class KRHomeConnectionOptionsView extends GetView<KRHomeController> {
|
|||||||
color: Theme.of(context).textTheme.bodyMedium?.color,
|
color: Theme.of(context).textTheme.bodyMedium?.color,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 8.w),
|
SizedBox(height: 8.h),
|
||||||
_buildConnectionOption(
|
_buildConnectionOption(
|
||||||
"home_ct",
|
"home_ct",
|
||||||
AppTranslations.kr_home.countryRegion,
|
AppTranslations.kr_home.countryRegion,
|
||||||
@ -66,7 +66,7 @@ class KRHomeConnectionOptionsView extends GetView<KRHomeController> {
|
|||||||
height: 32.w,
|
height: 32.w,
|
||||||
color: Theme.of(context).textTheme.bodyMedium?.color,
|
color: Theme.of(context).textTheme.bodyMedium?.color,
|
||||||
),
|
),
|
||||||
SizedBox(height: 12.w),
|
SizedBox(height: 12.h),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
|
|||||||
@ -64,7 +64,7 @@ class KRHomeLastDayCard extends GetView<KRHomeController> {
|
|||||||
),
|
),
|
||||||
|
|
||||||
// 倒计时显示
|
// 倒计时显示
|
||||||
SizedBox(height: 10.w),
|
SizedBox(height: 10.h),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
@ -123,7 +123,7 @@ class KRHomeLastDayCard extends GetView<KRHomeController> {
|
|||||||
?.color,
|
?.color,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 4.w),
|
SizedBox(height: 4.h),
|
||||||
Text(
|
Text(
|
||||||
AppTranslations.kr_home.subscriptionEndMessage,
|
AppTranslations.kr_home.subscriptionEndMessage,
|
||||||
style: KrAppTextStyle(
|
style: KrAppTextStyle(
|
||||||
|
|||||||
@ -71,7 +71,7 @@ class KRHomeNodeListView extends GetView<KRHomeController> {
|
|||||||
Widget _buildServerList(BuildContext context) {
|
Widget _buildServerList(BuildContext context) {
|
||||||
return Container(
|
return Container(
|
||||||
width: ScreenUtil().screenWidth,
|
width: ScreenUtil().screenWidth,
|
||||||
height: 360.w, // 减小高度比例
|
height: 360.h, // 减小高度比例
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).primaryColor,
|
color: Theme.of(context).primaryColor,
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
@ -83,7 +83,7 @@ class KRHomeNodeListView extends GetView<KRHomeController> {
|
|||||||
children: [
|
children: [
|
||||||
// 标题栏
|
// 标题栏
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 12.w),
|
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 12.h),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
@ -221,7 +221,7 @@ class KRHomeNodeListView extends GetView<KRHomeController> {
|
|||||||
country.isExpand.value = !country.isExpand.value;
|
country.isExpand.value = !country.isExpand.value;
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.symmetric(vertical: 12.w),
|
padding: EdgeInsets.symmetric(vertical: 12.h),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
KRCountryFlag(
|
KRCountryFlag(
|
||||||
@ -302,7 +302,7 @@ class KRHomeNodeListView extends GetView<KRHomeController> {
|
|||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.symmetric(
|
padding: EdgeInsets.symmetric(
|
||||||
vertical: 8.w,
|
vertical: 8.h,
|
||||||
horizontal: 16.w,
|
horizontal: 16.w,
|
||||||
),
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@ -397,7 +397,7 @@ class KRHomeNodeListView extends GetView<KRHomeController> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.symmetric(vertical: 4.w),
|
padding: EdgeInsets.symmetric(vertical: 4.h),
|
||||||
child: _kr_buildNodeListItem(
|
child: _kr_buildNodeListItem(
|
||||||
context,
|
context,
|
||||||
item: server,
|
item: server,
|
||||||
@ -444,13 +444,13 @@ class KRHomeNodeListView extends GetView<KRHomeController> {
|
|||||||
onClose: () =>
|
onClose: () =>
|
||||||
controller.kr_currentListStatus.value = KRHomeViewsListStatus.kr_none,
|
controller.kr_currentListStatus.value = KRHomeViewsListStatus.kr_none,
|
||||||
),
|
),
|
||||||
SizedBox(height: 16.w),
|
SizedBox(height: 16.h),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(child: listContent),
|
Expanded(child: listContent),
|
||||||
// 添加底部间距
|
// 添加底部间距
|
||||||
SizedBox(height: 12.w),
|
SizedBox(height: 12.h),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -544,7 +544,7 @@ class KRHomeNodeListView extends GetView<KRHomeController> {
|
|||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
key: ValueKey(item.id),
|
key: ValueKey(item.id),
|
||||||
padding: EdgeInsets.symmetric(vertical: 8.w),
|
padding: EdgeInsets.symmetric(vertical: 8.h),
|
||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
@ -575,7 +575,7 @@ class KRHomeNodeListView extends GetView<KRHomeController> {
|
|||||||
? Container(
|
? Container(
|
||||||
margin: EdgeInsets.only(left: 4.w),
|
margin: EdgeInsets.only(left: 4.w),
|
||||||
padding: EdgeInsets.symmetric(
|
padding: EdgeInsets.symmetric(
|
||||||
horizontal: 4.w, vertical: 1.w),
|
horizontal: 4.w, vertical: 1.h),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: krModernGreenLight.withOpacity(0.1),
|
color: krModernGreenLight.withOpacity(0.1),
|
||||||
borderRadius: BorderRadius.circular(4.w),
|
borderRadius: BorderRadius.circular(4.w),
|
||||||
@ -593,7 +593,7 @@ class KRHomeNodeListView extends GetView<KRHomeController> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 2.w),
|
SizedBox(height: 2.h),
|
||||||
Text(
|
Text(
|
||||||
item.city,
|
item.city,
|
||||||
style: KrAppTextStyle(
|
style: KrAppTextStyle(
|
||||||
@ -666,7 +666,7 @@ class KRHomeNodeListView extends GetView<KRHomeController> {
|
|||||||
InkWell(
|
InkWell(
|
||||||
onTap: () => controller.kr_urlTest(),
|
onTap: () => controller.kr_urlTest(),
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.symmetric(vertical: 8.w),
|
padding: EdgeInsets.symmetric(vertical: 8.h),
|
||||||
margin: EdgeInsets.only(top: 8.w), // 添加上方间距
|
margin: EdgeInsets.only(top: 8.w), // 添加上方间距
|
||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
@ -719,7 +719,7 @@ class KRHomeNodeListView extends GetView<KRHomeController> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (!controller.kr_isLatency.value) ...[
|
if (!controller.kr_isLatency.value) ...[
|
||||||
SizedBox(height: 2.w),
|
SizedBox(height: 2.h),
|
||||||
Text(
|
Text(
|
||||||
AppTranslations.kr_home.refreshLatencyDesc,
|
AppTranslations.kr_home.refreshLatencyDesc,
|
||||||
style: KrAppTextStyle(
|
style: KrAppTextStyle(
|
||||||
@ -766,7 +766,7 @@ class KRHomeNodeListView extends GetView<KRHomeController> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.symmetric(vertical: 8.w),
|
padding: EdgeInsets.symmetric(vertical: 8.h),
|
||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
@ -801,7 +801,7 @@ class KRHomeNodeListView extends GetView<KRHomeController> {
|
|||||||
Container(
|
Container(
|
||||||
margin: EdgeInsets.only(left: 4.w),
|
margin: EdgeInsets.only(left: 4.w),
|
||||||
padding: EdgeInsets.symmetric(
|
padding: EdgeInsets.symmetric(
|
||||||
horizontal: 4.w, vertical: 1.w),
|
horizontal: 4.w, vertical: 1.h),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color:
|
color:
|
||||||
krModernGreenLight.withOpacity(0.1),
|
krModernGreenLight.withOpacity(0.1),
|
||||||
@ -818,7 +818,7 @@ class KRHomeNodeListView extends GetView<KRHomeController> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 2.w),
|
SizedBox(height: 2.h),
|
||||||
Obx(() {
|
Obx(() {
|
||||||
// 获取当前自动选择的节点
|
// 获取当前自动选择的节点
|
||||||
String selectedNode =
|
String selectedNode =
|
||||||
@ -920,7 +920,7 @@ class KRHomeNodeListView extends GetView<KRHomeController> {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.symmetric(vertical: 4.w),
|
padding: EdgeInsets.symmetric(vertical: 4.h),
|
||||||
child: _kr_buildNodeListItem(
|
child: _kr_buildNodeListItem(
|
||||||
context,
|
context,
|
||||||
item: node,
|
item: node,
|
||||||
|
|||||||
@ -65,7 +65,7 @@ class KRHomeTrialCard extends GetView<KRHomeController> {
|
|||||||
),
|
),
|
||||||
|
|
||||||
// 倒计时显示
|
// 倒计时显示
|
||||||
SizedBox(height: 10.w),
|
SizedBox(height: 10.h),
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
@ -133,7 +133,7 @@ class KRHomeTrialCard extends GetView<KRHomeController> {
|
|||||||
: Theme.of(context).textTheme.bodyMedium?.color,
|
: Theme.of(context).textTheme.bodyMedium?.color,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 4.w),
|
SizedBox(height: 4.h),
|
||||||
Text(
|
Text(
|
||||||
AppTranslations.kr_home.trialEndMessage,
|
AppTranslations.kr_home.trialEndMessage,
|
||||||
style: KrAppTextStyle(
|
style: KrAppTextStyle(
|
||||||
|
|||||||
@ -37,7 +37,7 @@ class KRSubscribeSelectorView extends StatelessWidget {
|
|||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 12.w),
|
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 12.h),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.blue.withOpacity(0.05),
|
color: Colors.blue.withOpacity(0.05),
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
@ -78,7 +78,7 @@ class KRSubscribeSelectorView extends StatelessWidget {
|
|||||||
final subscribes = homeController.kr_subscribeService.kr_availableSubscribes;
|
final subscribes = homeController.kr_subscribeService.kr_availableSubscribes;
|
||||||
if (subscribes.isEmpty) {
|
if (subscribes.isEmpty) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.symmetric(vertical: 16.w, horizontal: 12.w),
|
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 12.w),
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Icon(
|
Icon(
|
||||||
@ -86,7 +86,7 @@ class KRSubscribeSelectorView extends StatelessWidget {
|
|||||||
size: 48.w,
|
size: 48.w,
|
||||||
color: Theme.of(context).textTheme.bodyLarge?.color?.withOpacity(0.3),
|
color: Theme.of(context).textTheme.bodyLarge?.color?.withOpacity(0.3),
|
||||||
),
|
),
|
||||||
SizedBox(height: 12.w),
|
SizedBox(height: 12.h),
|
||||||
Text(
|
Text(
|
||||||
AppTranslations.kr_purchaseMembership.noData,
|
AppTranslations.kr_purchaseMembership.noData,
|
||||||
style: KrAppTextStyle(
|
style: KrAppTextStyle(
|
||||||
@ -105,7 +105,7 @@ class KRSubscribeSelectorView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
padding: EdgeInsets.symmetric(vertical: 4.w, horizontal: 4.w),
|
padding: EdgeInsets.symmetric(vertical: 4.h, horizontal: 4.w),
|
||||||
itemCount: subscribes.length,
|
itemCount: subscribes.length,
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final subscribe = subscribes[index];
|
final subscribe = subscribes[index];
|
||||||
@ -123,7 +123,7 @@ class KRSubscribeSelectorView extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}),
|
}),
|
||||||
SizedBox(height: 8.w),
|
SizedBox(height: 8.h),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
@ -159,7 +159,7 @@ class _SubscribeItem extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 2.w),
|
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 2.h),
|
||||||
child: Material(
|
child: Material(
|
||||||
color: Colors.transparent,
|
color: Colors.transparent,
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
@ -199,7 +199,7 @@ class _SubscribeItem extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
if (isCurrent)
|
if (isCurrent)
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 2.w),
|
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 2.h),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.blue,
|
color: Colors.blue,
|
||||||
borderRadius: BorderRadius.circular(16.r),
|
borderRadius: BorderRadius.circular(16.r),
|
||||||
@ -222,7 +222,7 @@ class _SubscribeItem extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 8.w),
|
SizedBox(height: 8.h),
|
||||||
Text(
|
Text(
|
||||||
isUnlimited
|
isUnlimited
|
||||||
? AppTranslations.kr_purchaseMembership.unlimitedTraffic
|
? AppTranslations.kr_purchaseMembership.unlimitedTraffic
|
||||||
@ -234,7 +234,7 @@ class _SubscribeItem extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (!isUnlimited) ...[
|
if (!isUnlimited) ...[
|
||||||
SizedBox(height: 8.w),
|
SizedBox(height: 8.h),
|
||||||
ClipRRect(
|
ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(4.r),
|
borderRadius: BorderRadius.circular(4.r),
|
||||||
child: LinearProgressIndicator(
|
child: LinearProgressIndicator(
|
||||||
|
|||||||
@ -158,7 +158,7 @@ class KRInviteController extends GetxController {
|
|||||||
borderRadius: BorderRadius.circular(16.r),
|
borderRadius: BorderRadius.circular(16.r),
|
||||||
),
|
),
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 24.w),
|
padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 24.h),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
@ -170,7 +170,7 @@ class KRInviteController extends GetxController {
|
|||||||
color: Theme.of(Get.context!).textTheme.titleMedium?.color,
|
color: Theme.of(Get.context!).textTheme.titleMedium?.color,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 16.w),
|
SizedBox(height: 16.h),
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.all(16.w),
|
padding: EdgeInsets.all(16.w),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
@ -195,7 +195,7 @@ class KRInviteController extends GetxController {
|
|||||||
foregroundColor: Colors.black,
|
foregroundColor: Colors.black,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 20.w),
|
SizedBox(height: 20.h),
|
||||||
Container(
|
Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
height: 44.w,
|
height: 44.w,
|
||||||
|
|||||||
@ -35,7 +35,7 @@ class KRSearchAreaView extends GetView<KRSearchAreaController> {
|
|||||||
onTap: () {}, // 阻止点击事件传递到背景
|
onTap: () {}, // 阻止点击事件传递到背景
|
||||||
child: Container(
|
child: Container(
|
||||||
width: 300.w,
|
width: 300.w,
|
||||||
height: 450.w,
|
height: 450.h,
|
||||||
padding: EdgeInsets.all(16.w),
|
padding: EdgeInsets.all(16.w),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: theme.primaryColor,
|
color: theme.primaryColor,
|
||||||
@ -52,7 +52,7 @@ class KRSearchAreaView extends GetView<KRSearchAreaController> {
|
|||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
color: theme.textTheme.titleMedium?.color),
|
color: theme.textTheme.titleMedium?.color),
|
||||||
),
|
),
|
||||||
SizedBox(height: 10.w),
|
SizedBox(height: 10.h),
|
||||||
TextField(
|
TextField(
|
||||||
onChanged: (value) => controller.searchQuery.value = value,
|
onChanged: (value) => controller.searchQuery.value = value,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
@ -65,11 +65,11 @@ class KRSearchAreaView extends GetView<KRSearchAreaController> {
|
|||||||
borderRadius: BorderRadius.circular(8.w),
|
borderRadius: BorderRadius.circular(8.w),
|
||||||
borderSide: BorderSide.none,
|
borderSide: BorderSide.none,
|
||||||
),
|
),
|
||||||
contentPadding: EdgeInsets.symmetric(vertical: 10.w),
|
contentPadding: EdgeInsets.symmetric(vertical: 10.h),
|
||||||
),
|
),
|
||||||
style: theme.textTheme.bodyMedium?.copyWith(fontSize: 14.sp, fontFamily: 'AlibabaPuHuiTi-Regular',),
|
style: theme.textTheme.bodyMedium?.copyWith(fontSize: 14.sp, fontFamily: 'AlibabaPuHuiTi-Regular',),
|
||||||
),
|
),
|
||||||
// SizedBox(height: 5.w),
|
// SizedBox(height: 5.h),
|
||||||
Obx(() => Expanded(
|
Obx(() => Expanded(
|
||||||
child: ListView.builder(
|
child: ListView.builder(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
@ -84,7 +84,7 @@ class KRSearchAreaView extends GetView<KRSearchAreaController> {
|
|||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.symmetric(
|
padding: EdgeInsets.symmetric(
|
||||||
vertical: 10.w, horizontal: 0),
|
vertical: 10.h, horizontal: 0),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
border: Border(
|
border: Border(
|
||||||
bottom: BorderSide(
|
bottom: BorderSide(
|
||||||
|
|||||||
@ -152,7 +152,7 @@ class KRStatisticsView extends GetView<KRStatisticsController> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 8.w),
|
SizedBox(height: 8.h),
|
||||||
Text(
|
Text(
|
||||||
value,
|
value,
|
||||||
style: KrAppTextStyle(
|
style: KrAppTextStyle(
|
||||||
@ -188,9 +188,9 @@ class KRStatisticsView extends GetView<KRStatisticsController> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 16.w),
|
SizedBox(height: 16.h),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 200.w,
|
height: 200.h,
|
||||||
child: Obx(() => LineChart(
|
child: Obx(() => LineChart(
|
||||||
LineChartData(
|
LineChartData(
|
||||||
gridData: FlGridData(show: false),
|
gridData: FlGridData(show: false),
|
||||||
@ -297,7 +297,7 @@ class KRStatisticsView extends GetView<KRStatisticsController> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 16.w),
|
SizedBox(height: 16.h),
|
||||||
Obx(() => _kr_buildLongestConnection(context)),
|
Obx(() => _kr_buildLongestConnection(context)),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -322,7 +322,7 @@ class KRStatisticsView extends GetView<KRStatisticsController> {
|
|||||||
color: Theme.of(context).textTheme.bodySmall?.color,
|
color: Theme.of(context).textTheme.bodySmall?.color,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 8.w),
|
SizedBox(height: 8.h),
|
||||||
Text(
|
Text(
|
||||||
value,
|
value,
|
||||||
style: KrAppTextStyle(
|
style: KrAppTextStyle(
|
||||||
|
|||||||
@ -85,7 +85,7 @@ class KRUserInfoView extends GetView<KRUserInfoController> {
|
|||||||
_kr_buildShortcutSection(context),
|
_kr_buildShortcutSection(context),
|
||||||
_kr_buildOtherSection(context),
|
_kr_buildOtherSection(context),
|
||||||
_kr_buildLogoutButton(context),
|
_kr_buildLogoutButton(context),
|
||||||
SizedBox(height: 30.w),
|
SizedBox(height: 30.h),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -142,7 +142,7 @@ class KRUserInfoView extends GetView<KRUserInfoController> {
|
|||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 12.w),
|
padding: EdgeInsets.symmetric(horizontal: 16.w, vertical: 12.h),
|
||||||
decoration: shouldShowLoginPrompt
|
decoration: shouldShowLoginPrompt
|
||||||
? BoxDecoration(
|
? BoxDecoration(
|
||||||
color: const Color(0xFF1797FF).withOpacity(0.05),
|
color: const Color(0xFF1797FF).withOpacity(0.05),
|
||||||
@ -282,7 +282,7 @@ class KRUserInfoView extends GetView<KRUserInfoController> {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 4.w),
|
padding: EdgeInsets.symmetric(horizontal: 8.w, vertical: 4.h),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).cardColor.withOpacity(0.1),
|
color: Theme.of(context).cardColor.withOpacity(0.1),
|
||||||
borderRadius: BorderRadius.circular(12.w),
|
borderRadius: BorderRadius.circular(12.w),
|
||||||
@ -309,7 +309,7 @@ class KRUserInfoView extends GetView<KRUserInfoController> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 16.w),
|
SizedBox(height: 16.h),
|
||||||
// 过期时间
|
// 过期时间
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
@ -332,10 +332,10 @@ class KRUserInfoView extends GetView<KRUserInfoController> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 16.w),
|
SizedBox(height: 16.h),
|
||||||
// 流量进度条
|
// 流量进度条
|
||||||
_kr_buildTrafficProgress(context, subscribe),
|
_kr_buildTrafficProgress(context, subscribe),
|
||||||
SizedBox(height: 16.w),
|
SizedBox(height: 16.h),
|
||||||
// 操作按钮
|
// 操作按钮
|
||||||
_kr_buildSubscriptionActions(context, subscribe),
|
_kr_buildSubscriptionActions(context, subscribe),
|
||||||
],
|
],
|
||||||
@ -443,7 +443,7 @@ class KRUserInfoView extends GetView<KRUserInfoController> {
|
|||||||
},
|
},
|
||||||
child: Container(
|
child: Container(
|
||||||
padding:
|
padding:
|
||||||
EdgeInsets.symmetric(horizontal: 8.w, vertical: 4.w),
|
EdgeInsets.symmetric(horizontal: 8.w, vertical: 4.h),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context)
|
color: Theme.of(context)
|
||||||
.colorScheme
|
.colorScheme
|
||||||
@ -477,7 +477,7 @@ class KRUserInfoView extends GetView<KRUserInfoController> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
if (totalTraffic > 0) ...[
|
if (totalTraffic > 0) ...[
|
||||||
SizedBox(height: 6.w),
|
SizedBox(height: 6.h),
|
||||||
Stack(
|
Stack(
|
||||||
children: [
|
children: [
|
||||||
Container(
|
Container(
|
||||||
@ -539,7 +539,7 @@ class KRUserInfoView extends GetView<KRUserInfoController> {
|
|||||||
backgroundColor: const Color(0xFF1797FF),
|
backgroundColor: const Color(0xFF1797FF),
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Colors.white,
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
padding: EdgeInsets.symmetric(vertical: 12.w),
|
padding: EdgeInsets.symmetric(vertical: 12.h),
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(20.w),
|
borderRadius: BorderRadius.circular(20.w),
|
||||||
),
|
),
|
||||||
@ -603,7 +603,7 @@ class KRUserInfoView extends GetView<KRUserInfoController> {
|
|||||||
backgroundColor: const Color(0xFF1797FF),
|
backgroundColor: const Color(0xFF1797FF),
|
||||||
foregroundColor: Colors.white,
|
foregroundColor: Colors.white,
|
||||||
elevation: 0,
|
elevation: 0,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 8.w),
|
padding: EdgeInsets.symmetric(horizontal: 20.w, vertical: 8.h),
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(20.w),
|
borderRadius: BorderRadius.circular(20.w),
|
||||||
),
|
),
|
||||||
@ -647,7 +647,7 @@ class KRUserInfoView extends GetView<KRUserInfoController> {
|
|||||||
color: Theme.of(context).textTheme.bodyMedium?.color,
|
color: Theme.of(context).textTheme.bodyMedium?.color,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 12.w),
|
SizedBox(height: 12.h),
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
_kr_buildShortcutContainer(
|
_kr_buildShortcutContainer(
|
||||||
@ -702,7 +702,7 @@ class KRUserInfoView extends GetView<KRUserInfoController> {
|
|||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
child: Container(
|
child: Container(
|
||||||
height: 62.w,
|
height: 62.w,
|
||||||
margin: EdgeInsets.symmetric(vertical: 6.w),
|
margin: EdgeInsets.symmetric(vertical: 6.h),
|
||||||
padding: EdgeInsets.only(left: 12.w, right: 12.w),
|
padding: EdgeInsets.only(left: 12.w, right: 12.w),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Theme.of(context).cardColor,
|
color: Theme.of(context).cardColor,
|
||||||
@ -763,7 +763,7 @@ class KRUserInfoView extends GetView<KRUserInfoController> {
|
|||||||
color: Theme.of(context).textTheme.bodyMedium?.color,
|
color: Theme.of(context).textTheme.bodyMedium?.color,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 12.w),
|
SizedBox(height: 12.h),
|
||||||
Obx(() => Wrap(
|
Obx(() => Wrap(
|
||||||
spacing: 12.w,
|
spacing: 12.w,
|
||||||
runSpacing: 12.w,
|
runSpacing: 12.w,
|
||||||
@ -812,7 +812,7 @@ class KRUserInfoView extends GetView<KRUserInfoController> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 8.w),
|
SizedBox(height: 8.h),
|
||||||
Text(
|
Text(
|
||||||
controller.getTitle(item.type),
|
controller.getTitle(item.type),
|
||||||
style: KrAppTextStyle(
|
style: KrAppTextStyle(
|
||||||
@ -823,7 +823,7 @@ class KRUserInfoView extends GetView<KRUserInfoController> {
|
|||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
maxLines: 2,
|
maxLines: 2,
|
||||||
),
|
),
|
||||||
SizedBox(height: 4.w),
|
SizedBox(height: 4.h),
|
||||||
Text(
|
Text(
|
||||||
item.subtitle,
|
item.subtitle,
|
||||||
style: KrAppTextStyle(
|
style: KrAppTextStyle(
|
||||||
@ -863,7 +863,7 @@ class KRUserInfoView extends GetView<KRUserInfoController> {
|
|||||||
},
|
},
|
||||||
style: TextButton.styleFrom(
|
style: TextButton.styleFrom(
|
||||||
backgroundColor: Theme.of(context).cardColor,
|
backgroundColor: Theme.of(context).cardColor,
|
||||||
padding: EdgeInsets.symmetric(vertical: 12.w),
|
padding: EdgeInsets.symmetric(vertical: 12.h),
|
||||||
shape: RoundedRectangleBorder(
|
shape: RoundedRectangleBorder(
|
||||||
borderRadius: BorderRadius.circular(12.w),
|
borderRadius: BorderRadius.circular(12.w),
|
||||||
),
|
),
|
||||||
|
|||||||
@ -107,7 +107,7 @@ class KRDialog extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
if (icon != null) ...[
|
if (icon != null) ...[
|
||||||
icon!,
|
icon!,
|
||||||
SizedBox(height: 20.w),
|
SizedBox(height: 20.h),
|
||||||
],
|
],
|
||||||
if (title != null) ...[
|
if (title != null) ...[
|
||||||
Text(
|
Text(
|
||||||
@ -121,7 +121,7 @@ class KRDialog extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
textAlign: TextAlign.center,
|
textAlign: TextAlign.center,
|
||||||
),
|
),
|
||||||
SizedBox(height: 12.w),
|
SizedBox(height: 12.h),
|
||||||
],
|
],
|
||||||
if (message != null || customMessageWidget != null) ...[
|
if (message != null || customMessageWidget != null) ...[
|
||||||
Container(
|
Container(
|
||||||
@ -139,7 +139,7 @@ class KRDialog extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 28.w),
|
SizedBox(height: 28.h),
|
||||||
],
|
],
|
||||||
if (cancelText != null) ...[
|
if (cancelText != null) ...[
|
||||||
Row(
|
Row(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user