AIR版的功能添加
This commit is contained in:
@@ -9,6 +9,8 @@ import 'package:maibu_satabot_v2/core/theme/AppTheme.dart';
|
||||
import 'package:maibu_satabot_v2/core/storage/user_storage.dart';
|
||||
import 'package:maibu_satabot_v2/features/auth/presentation/bloc/auth_cubit.dart';
|
||||
import 'package:maibu_satabot_v2/features/main_container/presentation/cubit/tab_config_cubit.dart';
|
||||
import 'package:maibu_satabot_v2/features/main_container/domain/tab_config.dart';
|
||||
import 'package:maibu_satabot_v2/core/app/app_user_cubit.dart';
|
||||
import 'package:maibu_satabot_v2/features/v2/device_list/presentation/float_bar/cubit/float_bar_setting_cubit.dart';
|
||||
|
||||
/// 系统设置综合页面
|
||||
@@ -121,6 +123,8 @@ class _SystemSettingsPageState extends State<SystemSettingsPage> {
|
||||
|
||||
/// Tab 设置
|
||||
Widget _buildTabSettingsSection() {
|
||||
final roleKey = context.watch<AppUserCubit>().state.user?.roleKey;
|
||||
final isPersonal = roleKey == TabConfig.personalRoleKey;
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
@@ -152,7 +156,7 @@ class _SystemSettingsPageState extends State<SystemSettingsPage> {
|
||||
return const Center(child: CircularProgressIndicator());
|
||||
}
|
||||
|
||||
final tabs = state.config.items;
|
||||
final tabs = state.config.settingItemsForRole(roleKey);
|
||||
|
||||
return ListView.builder(
|
||||
shrinkWrap: true,
|
||||
@@ -174,10 +178,12 @@ class _SystemSettingsPageState extends State<SystemSettingsPage> {
|
||||
),
|
||||
),
|
||||
Switch(
|
||||
value: tab.isEnabled,
|
||||
onChanged: (value) {
|
||||
context.read<TabConfigCubit>().toggleTab(tab.id);
|
||||
},
|
||||
value: isPersonal ? true : tab.isEnabled,
|
||||
onChanged: isPersonal
|
||||
? null
|
||||
: (value) {
|
||||
context.read<TabConfigCubit>().toggleTab(tab.id);
|
||||
},
|
||||
activeColor: const Color(0xFF165DFF),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user