@@ -3,6 +3,7 @@ import 'package:loftify/Resources/fonts.dart';
33import 'package:loftify/Screens/Setting/select_theme_screen.dart' ;
44import 'package:loftify/Utils/app_provider.dart' ;
55import 'package:loftify/Utils/hive_util.dart' ;
6+ import 'package:loftify/Utils/responsive_util.dart' ;
67import 'package:provider/provider.dart' ;
78
89import '../../Utils/enums.dart' ;
@@ -25,6 +26,8 @@ class AppearanceSettingScreen extends StatefulWidget {
2526
2627class _AppearanceSettingScreenState extends State <AppearanceSettingScreen >
2728 with TickerProviderStateMixin {
29+ bool _enableLandscapeInTablet =
30+ HiveUtil .getBool (HiveUtil .enableLandscapeInTabletKey, defaultValue: true );
2831 bool _showRecommendVideo =
2932 HiveUtil .getBool (HiveUtil .showRecommendVideoKey, defaultValue: false );
3033 bool _showRecommendArticle =
@@ -128,6 +131,23 @@ class _AppearanceSettingScreenState extends State<AppearanceSettingScreen>
128131 );
129132 },
130133 ),
134+ if (ResponsiveUtil .isTablet ()) const SizedBox (height: 10 ),
135+ if (ResponsiveUtil .isTablet ())
136+ ItemBuilder .buildRadioItem (
137+ value: _enableLandscapeInTablet,
138+ context: context,
139+ title: "横屏时启用桌面端布局" ,
140+ description: "更改后需要重启" ,
141+ topRadius: true ,
142+ bottomRadius: true ,
143+ onTap: () {
144+ setState (() {
145+ _enableLandscapeInTablet = ! _enableLandscapeInTablet;
146+ appProvider.enableLandscapeInTablet =
147+ _enableLandscapeInTablet;
148+ });
149+ },
150+ ),
131151 const SizedBox (height: 10 ),
132152 ItemBuilder .buildCaptionItem (context: context, title: "首页" ),
133153 ItemBuilder .buildRadioItem (
0 commit comments