Update: 2026-05-07 23:06:22
This commit is contained in:
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../controllers/settings_controller.dart';
|
||||
import '../../../app/routes/app_pages.dart';
|
||||
import '../../../core/utils/app_snackbar.dart';
|
||||
|
||||
class SettingsView extends GetView<SettingsController> {
|
||||
const SettingsView({super.key});
|
||||
@@ -79,20 +80,43 @@ class SettingsView extends GetView<SettingsController> {
|
||||
controller.userRole.value == 'super_admin') {
|
||||
return Column(
|
||||
children: [
|
||||
_buildSectionTitle('إدارة المكتب',
|
||||
Icons.admin_panel_settings_rounded, isDark),
|
||||
_buildSectionTitle('إدارة الأعمال والصلاحيات',
|
||||
Icons.admin_panel_settings_rounded, isDark,
|
||||
showBackground: true),
|
||||
const SizedBox(height: 8),
|
||||
_buildSettingsCard(isDark, [
|
||||
_buildInfoTile(
|
||||
icon: Icons.business_rounded,
|
||||
title: 'الشركات والموظفين',
|
||||
trailing: 'إدارة →',
|
||||
isDark: isDark,
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.COMPANIES_MANAGEMENT);
|
||||
},
|
||||
),
|
||||
]),
|
||||
_buildSettingsCard(isDark, [
|
||||
_buildInfoTile(
|
||||
icon: Icons.business_rounded,
|
||||
title: 'الشركات والموظفين',
|
||||
trailing: 'إدارة →',
|
||||
isDark: isDark,
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.COMPANIES_MANAGEMENT);
|
||||
},
|
||||
),
|
||||
if (controller.userRole.value == 'super_admin') ...[
|
||||
const Divider(height: 1),
|
||||
_buildInfoTile(
|
||||
icon: Icons.account_balance_rounded,
|
||||
title: 'المكاتب المحاسبية',
|
||||
trailing: 'إدارة →',
|
||||
isDark: isDark,
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.TENANTS_MANAGEMENT);
|
||||
},
|
||||
),
|
||||
],
|
||||
const Divider(height: 1),
|
||||
_buildInfoTile(
|
||||
icon: Icons.group_rounded,
|
||||
title: 'مستخدمي النظام',
|
||||
trailing: 'إدارة →',
|
||||
isDark: isDark,
|
||||
onTap: () {
|
||||
Get.toNamed(AppRoutes.USERS_MANAGEMENT);
|
||||
},
|
||||
),
|
||||
]),
|
||||
const SizedBox(height: 20),
|
||||
],
|
||||
);
|
||||
@@ -236,17 +260,30 @@ class SettingsView extends GetView<SettingsController> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSectionTitle(String title, IconData icon, bool isDark) {
|
||||
return Row(
|
||||
children: [
|
||||
Icon(icon, size: 18, color: const Color(0xFF0F4C81)),
|
||||
const SizedBox(width: 8),
|
||||
Text(title,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: isDark ? Colors.white70 : const Color(0xFF0F4C81))),
|
||||
],
|
||||
Widget _buildSectionTitle(String title, IconData icon, bool isDark,
|
||||
{bool showBackground = false}) {
|
||||
return Container(
|
||||
padding: showBackground
|
||||
? const EdgeInsets.symmetric(horizontal: 12, vertical: 8)
|
||||
: null,
|
||||
decoration: showBackground
|
||||
? BoxDecoration(
|
||||
color: const Color(0xFF0F4C81).withValues(alpha: 0.1),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
)
|
||||
: null,
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(icon,
|
||||
size: 18, color: showBackground ? const Color(0xFF0F4C81) : const Color(0xFF0F4C81)),
|
||||
const SizedBox(width: 8),
|
||||
Text(title,
|
||||
style: TextStyle(
|
||||
fontSize: 15,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: isDark ? Colors.white70 : const Color(0xFF0F4C81))),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -370,7 +407,7 @@ class SettingsView extends GetView<SettingsController> {
|
||||
buttonColor: const Color(0xFFDC2626),
|
||||
onConfirm: () {
|
||||
Get.back();
|
||||
Get.snackbar('قريباً', 'سيتم تفعيل هذه الميزة قريباً');
|
||||
AppSnackbar.showInfo('قريباً', 'سيتم تفعيل هذه الميزة قريباً');
|
||||
},
|
||||
titleStyle: const TextStyle(fontWeight: FontWeight.bold),
|
||||
radius: 14,
|
||||
|
||||
Reference in New Issue
Block a user