Update: 2026-05-17 18:47:51

This commit is contained in:
Hamza-Ayed
2026-05-17 18:47:51 +03:00
parent 9ad361e992
commit 2f1a6f9c85
6 changed files with 199 additions and 110 deletions

View File

@@ -254,14 +254,16 @@ class DashboardView extends GetView<DashboardController> {
isDark,
() => Get.toNamed(AppRoutes.AUDIT_LOG),
),
const SizedBox(width: 12),
_buildAdminActionCard(
'ادعُ واكسب',
Icons.card_giftcard,
const Color(0xFFD4AF37),
isDark,
() => Get.toNamed(AppRoutes.REFERRAL),
),
if (!GetPlatform.isIOS) ...[
const SizedBox(width: 12),
_buildAdminActionCard(
'ادعُ واكسب',
Icons.card_giftcard,
const Color(0xFFD4AF37),
isDark,
() => Get.toNamed(AppRoutes.REFERRAL),
),
],
const SizedBox(width: 12),
_buildAdminActionCard(
'استهلاك AI',

View File

@@ -5,7 +5,7 @@ import '../../../app/routes/app_pages.dart';
class OnboardingController extends GetxController {
var currentPage = 0.obs;
final List<OnboardingModel> items = [
List<OnboardingModel> get items => [
OnboardingModel(
title: 'مرحباً بك في مُصادَق',
description:
@@ -19,9 +19,10 @@ class OnboardingController extends GetxController {
imageAsset: 'assets/images/onboarding_2.png',
),
OnboardingModel(
title: 'مدفوعات فورية آمنة',
description:
'قم بشحن محفظتك وتفعيل اشتراكك عبر نظام كليك (CliQ) بكل سرعة وأمان.',
title: 'إدارة متكاملة لشركتك',
description: GetPlatform.isIOS
? 'إدارة فواتير الشركات وأرشفة ضريبية متكاملة بأمان وسهولة تامة.'
: 'قم بشحن محفظتك وتفعيل اشتراكك عبر نظام كليك (CliQ) بكل سرعة وأمان.',
imageAsset: 'assets/images/onboarding_3.png',
),
];

View File

@@ -166,7 +166,7 @@ class SettingsView extends GetView<SettingsController> {
_buildInfoTile(
icon: Icons.diamond_rounded,
title: 'الاشتراكات والباقات',
trailing: 'ترقية →',
trailing: GetPlatform.isIOS ? 'التفاصيل →' : 'ترقية →',
isDark: isDark,
onTap: () => Get.toNamed(AppRoutes.SUBSCRIPTION),
),

View File

@@ -34,114 +34,122 @@ class SubscriptionView extends StatelessWidget {
children: [
// Current Subscription Status
if (controller.currentSubscription.value != null)
_buildCurrentPlan(controller.currentSubscription.value!, isDark),
_buildCurrentPlan(controller.currentSubscription.value!, isDark)
else
_buildFreePlanPlaceholder(isDark),
const SizedBox(height: 24),
// Active Payment Request Banner
if (controller.activePaymentRequest.value != null)
_buildActivePaymentBanner(controller.activePaymentRequest.value!, isDark),
if (GetPlatform.isIOS) ...[
_buildIOSB2BInfoCard(isDark),
],
// Plans Header
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
const Icon(Icons.diamond_rounded, color: Color(0xFFD4AF37), size: 22),
const SizedBox(width: 8),
Text(
'اختر باقتك',
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: isDark ? Colors.white : const Color(0xFF0F172A),
),
),
],
),
const SizedBox(height: 4),
Text(
'ادفع عبر CliQ — بدون عمولة!',
style: TextStyle(fontSize: 13, color: isDark ? Colors.white38 : Colors.grey),
),
],
),
],
),
const SizedBox(height: 20),
if (!GetPlatform.isIOS) ...[
// Active Payment Request Banner
if (controller.activePaymentRequest.value != null)
_buildActivePaymentBanner(controller.activePaymentRequest.value!, isDark),
// Toggle
Container(
padding: const EdgeInsets.all(4),
decoration: BoxDecoration(
color: isDark ? Colors.white.withOpacity(0.05) : Colors.black.withOpacity(0.05),
borderRadius: BorderRadius.circular(12),
),
child: Row(
// Plans Header
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: GestureDetector(
onTap: () => controller.isAnnual.value = false,
child: Obx(() => Container(
padding: const EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
color: !controller.isAnnual.value ? const Color(0xFF0F4C81) : Colors.transparent,
borderRadius: BorderRadius.circular(10),
),
child: Center(
child: Text(
'دفع شهري',
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
const Icon(Icons.diamond_rounded, color: Color(0xFFD4AF37), size: 22),
const SizedBox(width: 8),
Text(
'اختر باقتك',
style: TextStyle(
color: !controller.isAnnual.value ? Colors.white : (isDark ? Colors.white60 : Colors.black54),
fontSize: 20,
fontWeight: FontWeight.bold,
fontSize: 13,
color: isDark ? Colors.white : const Color(0xFF0F172A),
),
),
),
)),
),
),
Expanded(
child: GestureDetector(
onTap: () => controller.isAnnual.value = true,
child: Obx(() => Container(
padding: const EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
color: controller.isAnnual.value ? const Color(0xFF0F4C81) : Colors.transparent,
borderRadius: BorderRadius.circular(10),
),
child: Center(
child: Text(
'دفع سنوي (توفير ✨)',
style: TextStyle(
color: controller.isAnnual.value ? Colors.white : (isDark ? Colors.white60 : Colors.black54),
fontWeight: FontWeight.bold,
fontSize: 13,
),
),
),
)),
),
],
),
const SizedBox(height: 4),
Text(
'ادفع عبر CliQ — بدون عمولة!',
style: TextStyle(fontSize: 13, color: isDark ? Colors.white38 : Colors.grey),
),
],
),
],
),
),
const SizedBox(height: 20),
const SizedBox(height: 20),
// Plans Grid
...controller.plans.map((plan) => _buildPlanCard(plan, controller, isDark)),
// Toggle
Container(
padding: const EdgeInsets.all(4),
decoration: BoxDecoration(
color: isDark ? Colors.white.withOpacity(0.05) : Colors.black.withOpacity(0.05),
borderRadius: BorderRadius.circular(12),
),
child: Row(
children: [
Expanded(
child: GestureDetector(
onTap: () => controller.isAnnual.value = false,
child: Obx(() => Container(
padding: const EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
color: !controller.isAnnual.value ? const Color(0xFF0F4C81) : Colors.transparent,
borderRadius: BorderRadius.circular(10),
),
child: Center(
child: Text(
'دفع شهري',
style: TextStyle(
color: !controller.isAnnual.value ? Colors.white : (isDark ? Colors.white60 : Colors.black54),
fontWeight: FontWeight.bold,
fontSize: 13,
),
),
),
)),
),
),
Expanded(
child: GestureDetector(
onTap: () => controller.isAnnual.value = true,
child: Obx(() => Container(
padding: const EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
color: controller.isAnnual.value ? const Color(0xFF0F4C81) : Colors.transparent,
borderRadius: BorderRadius.circular(10),
),
child: Center(
child: Text(
'دفع سنوي (توفير ✨)',
style: TextStyle(
color: controller.isAnnual.value ? Colors.white : (isDark ? Colors.white60 : Colors.black54),
fontWeight: FontWeight.bold,
fontSize: 13,
),
),
),
)),
),
),
],
),
),
const SizedBox(height: 20),
const SizedBox(height: 24),
// Plans Grid
...controller.plans.map((plan) => _buildPlanCard(plan, controller, isDark)),
// Payment History
if (controller.myPayments.isNotEmpty) ...[
const Text('سجل المدفوعات', style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
const SizedBox(height: 12),
...controller.myPayments.map((p) => _buildPaymentHistoryItem(p, isDark)),
const SizedBox(height: 24),
// Payment History
if (controller.myPayments.isNotEmpty) ...[
const Text('سجل المدفوعات', style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
const SizedBox(height: 12),
...controller.myPayments.map((p) => _buildPaymentHistoryItem(p, isDark)),
],
],
const SizedBox(height: 40),
@@ -153,6 +161,84 @@ class SubscriptionView extends StatelessWidget {
);
}
Widget _buildFreePlanPlaceholder(bool isDark) {
return _buildCurrentPlan({
'plan_name': 'الباقة الافتراضية (المجانية)',
'days_remaining': 0,
'invoices': {
'used': 0,
'limit': 100,
}
}, isDark);
}
Widget _buildIOSB2BInfoCard(bool isDark) {
return Container(
width: double.infinity,
padding: const EdgeInsets.all(20),
decoration: BoxDecoration(
color: isDark ? const Color(0xFF1E1E2E) : Colors.white,
borderRadius: BorderRadius.circular(16),
border: Border.all(
color: isDark ? Colors.white10 : Colors.grey.shade200,
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Icon(Icons.business_rounded, color: const Color(0xFF0F4C81), size: 24),
const SizedBox(width: 8),
Text(
'الاشتراكات المؤسسية (B2B)',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: isDark ? Colors.white : const Color(0xFF0F172A),
),
),
],
),
const SizedBox(height: 12),
Text(
'تطبيق "مُصادَق" مخصص لإدارة الفواتير الضريبية للشركات ومكاتب المحاسبة. يتم تفعيل وإدارة باقات الاشتراك والميزات الإضافية مركزياً عن طريق لوحة التحكم الخاصة بالمسؤول في منشأتك.',
style: TextStyle(
fontSize: 13,
height: 1.5,
color: isDark ? Colors.white70 : Colors.black87,
),
),
const SizedBox(height: 16),
Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: const Color(0xFF0F4C81).withOpacity(0.05),
borderRadius: BorderRadius.circular(10),
),
child: Row(
children: [
Icon(Icons.info_outline, color: const Color(0xFF0F4C81), size: 20),
const SizedBox(width: 10),
Expanded(
child: Text(
'إذا كنت بحاجة إلى ترقية باقتك أو زيادة الحصص (Quotas)، يرجى التواصل مع مسؤول تكنولوجيا المعلومات أو المحاسب المسؤول في شركتك.',
style: TextStyle(
fontSize: 12,
height: 1.4,
color: const Color(0xFF0F4C81),
fontWeight: FontWeight.w600,
),
),
),
],
),
),
],
),
);
}
Widget _buildCurrentPlan(Map<String, dynamic> sub, bool isDark) {
final planName = sub['plan_name'] ?? sub['plan_name_en'] ?? sub['plan_id'] ?? 'مجانية';
final daysLeft = sub['days_remaining'] ?? 0;

View File

@@ -892,10 +892,10 @@ packages:
dependency: transitive
description:
name: matcher
sha256: "12956d0ad8390bbcc63ca2e1469c0619946ccb52809807067a7020d57e647aa6"
sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861
url: "https://pub.dev"
source: hosted
version: "0.12.18"
version: "0.12.19"
material_color_utilities:
dependency: transitive
description:
@@ -1465,10 +1465,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "93167629bfc610f71560ab9312acdda4959de4df6fac7492c89ff0d3886f6636"
sha256: "8161c84903fd860b26bfdefb7963b3f0b68fee7adea0f59ef805ecca346f0c7a"
url: "https://pub.dev"
source: hosted
version: "0.7.9"
version: "0.7.10"
timing:
dependency: transitive
description:

View File

@@ -1,7 +1,7 @@
name: musadaq_app
description: Jordanian E-Invoicing Automation SaaS
publish_to: 'none'
version: 1.0.3+3
version: 1.0.5+5
environment:
sdk: '>=3.2.0 <4.0.0'