浏览代码

fix: 适配桌面字体

Tony 1 月之前
父节点
当前提交
395196dda3

+ 12 - 6
lib/app/modules/home/views/home_view.dart

@@ -430,12 +430,18 @@ class HomeView extends BaseView<HomeController> {
               Expanded(
                 child: Text(
                   '${controller.selectedLocation?.code ?? ''} - ${controller.selectedLocation?.name ?? ''}',
-                  style: TextStyle(
-                    fontSize: 16.sp,
-                    height: 1.5,
-                    fontWeight: FontWeight.w500,
-                    color: Get.reactiveTheme.textTheme.bodyLarge!.color,
-                  ),
+                  style: isDesktop
+                      ? TextStyle(
+                          fontSize: 14.sp,
+                          fontWeight: FontWeight.w500,
+                          color: Get.reactiveTheme.textTheme.bodyLarge!.color,
+                        )
+                      : TextStyle(
+                          fontSize: 16.sp,
+                          height: 1.5,
+                          fontWeight: FontWeight.w500,
+                          color: Get.reactiveTheme.textTheme.bodyLarge!.color,
+                        ),
                 ),
               ),
               // 箭头图标

+ 27 - 11
lib/app/modules/node/widgets/node_list.dart

@@ -8,6 +8,7 @@ import 'package:nomo/config/theme/theme_extensions/theme_extension.dart';
 import 'package:pull_to_refresh_flutter3/pull_to_refresh_flutter3.dart';
 
 import '../../../../config/translations/strings_enum.dart';
+import '../../../../utils/misc.dart';
 import '../../../constants/iconfont/iconfont.dart';
 import '../../../controllers/api_controller.dart';
 import '../../../data/models/launch/groups.dart';
@@ -110,13 +111,20 @@ class _NodeListState extends State<NodeList>
               SliverStickyHeader(
                 header: Container(
                   color: Get.reactiveTheme.scaffoldBackgroundColor,
-                  padding: const EdgeInsets.all(16),
+                  padding: isDesktop
+                      ? const EdgeInsets.symmetric(
+                          horizontal: 16.0,
+                          vertical: 8.0,
+                        )
+                      : const EdgeInsets.all(16),
                   child: Text(
                     tag.name ?? '',
                     style: TextStyle(
                       color: Get.reactiveTheme.hintColor,
-                      fontSize: 16,
-                      fontWeight: FontWeight.bold,
+                      fontSize: isDesktop ? 14 : 16,
+                      fontWeight: isDesktop
+                          ? FontWeight.normal
+                          : FontWeight.bold,
                     ),
                   ),
                 ),
@@ -201,14 +209,22 @@ class _CountrySection extends StatelessWidget {
                   10.horizontalSpace,
                   Text(
                     countryName,
-                    style: TextStyle(
-                      fontSize: 16.sp,
-                      height: 1.5,
-                      fontWeight: FontWeight.w500,
-                      color: hasSelectedLocation
-                          ? Get.reactiveTheme.primaryColor
-                          : Get.reactiveTheme.textTheme.bodyLarge!.color,
-                    ),
+                    style: isDesktop
+                        ? TextStyle(
+                            fontSize: 14.sp,
+                            fontWeight: FontWeight.w500,
+                            color: hasSelectedLocation
+                                ? Get.reactiveTheme.primaryColor
+                                : Get.reactiveTheme.textTheme.bodyLarge!.color,
+                          )
+                        : TextStyle(
+                            fontSize: 16.sp,
+                            height: 1.5,
+                            fontWeight: FontWeight.w500,
+                            color: hasSelectedLocation
+                                ? Get.reactiveTheme.primaryColor
+                                : Get.reactiveTheme.textTheme.bodyLarge!.color,
+                          ),
                   ),
                   const Spacer(),
                   // 箭头图标

+ 1 - 1
lib/app/modules/setting/views/setting_view.dart

@@ -73,7 +73,7 @@ class SettingView extends BaseView<SettingController> {
         child: Text(
           title,
           style: TextStyle(
-            fontSize: 16.sp,
+            fontSize: isDesktop ? 14.sp : 16.sp,
             color: Get.reactiveTheme.hintColor,
             fontWeight: FontWeight.w500,
           ),

+ 1 - 1
lib/app/widgets/ix_app_bar.dart

@@ -63,7 +63,7 @@ class IXAppBar extends StatelessWidget implements PreferredSizeWidget {
         title,
         style: TextStyle(
           color: Get.reactiveTheme.textTheme.bodyLarge!.color,
-          fontSize: titleSize,
+          fontSize: isDesktop ? 16 : titleSize,
           fontWeight: titleWeight,
         ),
       ),