Update Saqel Platform: 2026-09-08 18:44:36
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
description: This file stores settings for Dart & Flutter DevTools.
|
||||||
|
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
|
||||||
|
extensions:
|
||||||
@@ -113,7 +113,7 @@ class TeacherRepository {
|
|||||||
Uri.parse('$baseUrl${AppConfig.meEndpoint}'),
|
Uri.parse('$baseUrl${AppConfig.meEndpoint}'),
|
||||||
headers: headers,
|
headers: headers,
|
||||||
)
|
)
|
||||||
.timeout(const Duration(seconds: 4));
|
.timeout(const Duration(seconds: 30));
|
||||||
|
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
return json.decode(response.body);
|
return json.decode(response.body);
|
||||||
@@ -134,19 +134,21 @@ class TeacherRepository {
|
|||||||
Uri.parse('$baseUrl${AppConfig.profileStatusEndpoint}'),
|
Uri.parse('$baseUrl${AppConfig.profileStatusEndpoint}'),
|
||||||
headers: headers,
|
headers: headers,
|
||||||
)
|
)
|
||||||
.timeout(const Duration(seconds: 4));
|
.timeout(const Duration(seconds: 30));
|
||||||
|
|
||||||
|
final decoded = json.decode(response.body);
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
final decoded = json.decode(response.body);
|
|
||||||
if (decoded['status'] == 'success') {
|
if (decoded['status'] == 'success') {
|
||||||
return TeacherProfileModel.fromJson(decoded);
|
return TeacherProfileModel.fromJson(decoded);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
throw StateError(decoded['message']?.toString() ??
|
||||||
|
'فشل تحميل ملف المعلم (HTTP ${response.statusCode}).');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
AppLogger.log('getProfileStatus notice: $e', tag: 'TEACHER_REPO');
|
AppLogger.log('getProfileStatus notice: $e', tag: 'TEACHER_REPO');
|
||||||
|
if (e is StateError) rethrow;
|
||||||
|
throw StateError('تعذر الاتصال بملف المعلم: $e');
|
||||||
}
|
}
|
||||||
|
|
||||||
throw StateError('تعذر تحميل ملف المعلم من الخادم.');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<TeacherProfileModel> setupProfile({
|
Future<TeacherProfileModel> setupProfile({
|
||||||
@@ -569,10 +571,11 @@ class TeacherRepository {
|
|||||||
totalLessons:
|
totalLessons:
|
||||||
int.tryParse(c['lessons_total']?.toString() ?? '0') ?? 0,
|
int.tryParse(c['lessons_total']?.toString() ?? '0') ?? 0,
|
||||||
militaryStudents: (c['military_students'] as num?)?.toInt() ?? 0,
|
militaryStudents: (c['military_students'] as num?)?.toInt() ?? 0,
|
||||||
externalSubscribers: (c['external_subscribers'] as num?)?.toInt() ?? 0,
|
externalSubscribers:
|
||||||
priceJod:
|
(c['external_subscribers'] as num?)?.toInt() ?? 0,
|
||||||
double.tryParse(c['price_jod']?.toString() ?? '') ?? 0,
|
priceJod: double.tryParse(c['price_jod']?.toString() ?? '') ?? 0,
|
||||||
netRevenueJod: double.tryParse(c['net_revenue_jod']?.toString() ?? '') ?? 0,
|
netRevenueJod:
|
||||||
|
double.tryParse(c['net_revenue_jod']?.toString() ?? '') ?? 0,
|
||||||
);
|
);
|
||||||
}).toList();
|
}).toList();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,21 +77,29 @@ class _TeacherAuthScreenState extends State<TeacherAuthScreen> {
|
|||||||
SaqelToast.showError(context, 'يرجى إدخال رمز التحقق المكون من 6 أرقام');
|
SaqelToast.showError(context, 'يرجى إدخال رمز التحقق المكون من 6 أرقام');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (_fullNameController.text.trim().isEmpty ||
|
final hasAnyProfileData = _fullNameController.text.trim().isNotEmpty ||
|
||||||
_selectedSubject == null ||
|
_selectedSubject != null ||
|
||||||
_schoolController.text.trim().isEmpty ||
|
_schoolController.text.trim().isNotEmpty ||
|
||||||
_selectedGrades.isEmpty) {
|
_selectedGrades.isNotEmpty;
|
||||||
|
final hasCompleteProfileData = _fullNameController.text.trim().isNotEmpty &&
|
||||||
|
_selectedSubject != null &&
|
||||||
|
_schoolController.text.trim().isNotEmpty &&
|
||||||
|
_selectedGrades.isNotEmpty;
|
||||||
|
if (hasAnyProfileData && !hasCompleteProfileData) {
|
||||||
SaqelToast.showError(context,
|
SaqelToast.showError(context,
|
||||||
'أكمل الاسم والمادة والمدرسة وصفًا واحدًا على الأقل قبل التحقق');
|
'إما اترك بيانات الملف فارغة لتسجيل الدخول، أو أكملها كلها لإنشاء ملف معلم جديد');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
context.read<TeacherAuthCubit>().verifyOtp(
|
context.read<TeacherAuthCubit>().verifyOtp(
|
||||||
phone,
|
phone,
|
||||||
otp,
|
otp,
|
||||||
fullName: _fullNameController.text.trim(),
|
fullName:
|
||||||
specialization: _selectedSubject,
|
hasCompleteProfileData ? _fullNameController.text.trim() : null,
|
||||||
schoolName: _schoolController.text.trim(),
|
specialization: hasCompleteProfileData ? _selectedSubject : null,
|
||||||
gradesTaught: _selectedGrades.toList(),
|
schoolName:
|
||||||
|
hasCompleteProfileData ? _schoolController.text.trim() : null,
|
||||||
|
gradesTaught:
|
||||||
|
hasCompleteProfileData ? _selectedGrades.toList() : null,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -340,10 +340,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: matcher
|
name: matcher
|
||||||
sha256: dc0b7dc7651697ea4ff3e69ef44b0407ea32c487a39fff6a4004fa585e901861
|
sha256: "12956d0ad8390bbcc63ca2e1469c0619946ccb52809807067a7020d57e647aa6"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.12.19"
|
version: "0.12.18"
|
||||||
material_color_utilities:
|
material_color_utilities:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -356,10 +356,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: meta
|
name: meta
|
||||||
sha256: "1741988757a65eb6b36abe716829688cf01910bbf91c34354ff7ec1c3de2b349"
|
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.18.0"
|
version: "1.17.0"
|
||||||
nested:
|
nested:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -585,10 +585,10 @@ packages:
|
|||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
name: test_api
|
name: test_api
|
||||||
sha256: "949a932224383300f01be9221c39180316445ecb8e7547f70a41a35bf421fb9e"
|
sha256: "93167629bfc610f71560ab9312acdda4959de4df6fac7492c89ff0d3886f6636"
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.11"
|
version: "0.7.9"
|
||||||
typed_data:
|
typed_data:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
Reference in New Issue
Block a user