feat(apps): نظام التصميم والمصادقة الكاملة — المرحلتان 2 و3

## تصحيح بنيوي أولاً
بنية المرحلة 1 كانت تخالف docs/23 §1 المُلزِم. أُعيدت للشجرة المفروضة
حرفياً: app.dart في الجذر · core/{config,build_config,di,router}.dart ·
core/{design,ui,l10n,api,storage,session}/ · features/<f>/{cubit,data,view}/

## المرحلة 2 — نظام التصميم (docs/26)
- core/design: tokens (مسافات/زوايا/حركة/أحجام — الشاشة لا تخترع رقماً) ·
  typography (IBM Plex Sans Arabic + Inter محليّان، بأرقام tabular للأسعار
  والعدّادات) · TripzColors كـThemeExtension للأدوار الدلالية ·
  buildTheme(brightness, locale) بمدخلين لا ثالث لهما
- core/ui: 11 مكوّناً. TripzScaffold يحوّل status الـCubit وحده إلى
  skeleton/خطأ/فراغ/محتوى — فلا تكتب أي شاشة if (loading)
- core/l10n: ARB عربي/إنجليزي + gen_l10n. لا نص مرئي داخل widget
- SettingsCubit: المظهر واللغة. الاتجاه يتبع اللغة آلياً بلا Directionality
  مفروضة، وسقف تكبير النص 1.3

## المرحلة 3 — المصادقة
- طبقة الشبكة: تجديد استباقي بطلقة واحدة (عمر التوكن 15 دقيقة) ·
  x-app-role · x-device-id من device_info_plus — يُرسَل الآن كي يُفعَّل علم
  الخادم لاحقاً بلا تعديل التطبيق
- SessionCubit في core/session خلف واجهة SessionSource: الجلسة حالة على
  مستوى التطبيق لا ميزة، و core لا يستورد من features
- LoginCubit بخطواته الخمس، ProfileCubit، وست شاشات:
  الشروط ← إذن الموقع ← الهاتف ← الرمز ← إكمال الملف ← هيكل الرئيسية

من سيرو نُقل السلوك لا الكود: بوابتان قبل أي حقل إدخال · إعادة فحص الإذن عند
العودة من إعدادات النظام · تحقّق الهاتف الثلاثي. وأُضيف ما ينقصه: عدّاد إعادة
إرسال الرمز — بدونه تُحظر ثلاث ضغطات المستخدمَ خمس دقائق (docs/38 §2).

قراران موثّقان في docs/37: لا packages/tripz_ui (الوثيقتان المُلزِمتان تفرضان
core/design و core/ui داخل التطبيق)، والـCubit يُصدر رمز فشل لا نصّاً
(يجمع بين docs/23 §3 و docs/26 §4).

flutter analyze نظيف في التطبيقين · 48 ملف و3,140 سطر لكل تطبيق · الفرق
بينهما أربعة ملفات فقط: build_config · config · ملفّا ARB.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Hamza-Ayed
2026-08-04 21:42:19 +03:00
co-authored by Claude Opus 5
parent 0de8573d27
commit c52338f3bb
117 changed files with 6061 additions and 374 deletions
+67
View File
@@ -0,0 +1,67 @@
{
"@@locale": "ar",
"appTitle": "Tripz",
"actionRetry": "أعد المحاولة",
"actionCancel": "إلغاء",
"actionContinue": "متابعة",
"actionSave": "حفظ",
"actionOpenSettings": "افتح الإعدادات",
"errorGeneric": "حدث خطأ غير متوقّع",
"errorNetwork": "تعذّر الاتصال بالخادم",
"errorTimeout": "انتهت مهلة الاتصال",
"emptyDefault": "لا يوجد شيء هنا بعد",
"splashRider": "تطبيق الراكب",
"splashDriver": "تطبيق السائق",
"agreementTitle": "شروط الاستخدام",
"agreementLead": "قبل أن نبدأ، اقرأ الشروط ووافق عليها.",
"agreementCheckbox": "قرأت الشروط وأوافق عليها",
"agreementAccept": "أوافق وأتابع",
"permissionTitle": "نحتاج موقعك",
"permissionLead": "الموقع هو ما يجعل الرحلة ممكنة: به نعرف أين أنت وأين السائق.",
"permissionAllow": "السماح بالوصول للموقع",
"permissionDeniedForever": "رفضتَ الإذن نهائياً. افتح الإعدادات وفعّله يدوياً ثم عُد.",
"phoneTitle": "أهلاً بك، كابتن",
"phoneLead": "أدخل رقم هاتفك، ونرسل لك رمز تحقّق.",
"phoneLabel": "رقم الهاتف",
"phoneHint": "بلا الصفر في البداية",
"phoneSend": "أرسل رمز التحقّق",
"phoneErrEmpty": "أدخل رقم هاتفك",
"phoneErrLeadingZero": "أدخل الرقم بلا الصفر في البداية",
"phoneErrShort": "الرقم قصير جداً",
"otpTitle": "أدخل رمز التحقّق",
"otpLead": "أرسلنا رمزاً من أربع خانات إلى {phone}",
"@otpLead": { "placeholders": { "phone": { "type": "String" } } },
"otpVerify": "تحقّق وتابع",
"otpResend": "إعادة إرسال الرمز",
"otpResendIn": "إعادة الإرسال بعد {seconds} ثانية",
"@otpResendIn": { "placeholders": { "seconds": { "type": "int" } } },
"otpErrIncomplete": "أدخل الرمز كاملاً",
"otpErrInvalid": "الرمز غير صحيح أو انتهت صلاحيته",
"otpErrTooManyAttempts": "محاولات كثيرة. اطلب رمزاً جديداً.",
"otpErrRateLimited": "طلبتَ الرمز مرات كثيرة. انتظر قليلاً ثم أعد المحاولة.",
"otpChangeNumber": "تعديل الرقم",
"profileTitle": "أكمل ملفك",
"profileLead": "اسمك يظهر للراكب عند الرحلة.",
"profileNameLabel": "الاسم",
"profileNameErrEmpty": "أدخل اسمك",
"sessionExpired": "انتهت جلستك. سجّل الدخول من جديد.",
"settingsTitle": "الإعدادات",
"settingsTheme": "المظهر",
"settingsThemeSystem": "حسب النظام",
"settingsThemeLight": "فاتح",
"settingsThemeDark": "داكن",
"settingsLanguage": "اللغة",
"settingsLanguageArabic": "العربية",
"settingsLanguageEnglish": "English"
}
+67
View File
@@ -0,0 +1,67 @@
{
"@@locale": "en",
"appTitle": "Tripz",
"actionRetry": "Try again",
"actionCancel": "Cancel",
"actionContinue": "Continue",
"actionSave": "Save",
"actionOpenSettings": "Open settings",
"errorGeneric": "Something went wrong",
"errorNetwork": "Could not reach the server",
"errorTimeout": "The connection timed out",
"emptyDefault": "Nothing here yet",
"splashRider": "Rider app",
"splashDriver": "Driver app",
"agreementTitle": "Terms of use",
"agreementLead": "Before we start, read the terms and accept them.",
"agreementCheckbox": "I have read and accept the terms",
"agreementAccept": "Accept and continue",
"permissionTitle": "We need your location",
"permissionLead": "Location is what makes a trip possible: it tells us where you are and where your driver is.",
"permissionAllow": "Allow location access",
"permissionDeniedForever": "You denied the permission permanently. Open settings, enable it, then come back.",
"phoneTitle": "Welcome, captain",
"phoneLead": "Enter your phone number and we'll send you a verification code.",
"phoneLabel": "Phone number",
"phoneHint": "without the leading zero",
"phoneSend": "Send verification code",
"phoneErrEmpty": "Enter your phone number",
"phoneErrLeadingZero": "Enter the number without the leading zero",
"phoneErrShort": "That number is too short",
"otpTitle": "Enter your code",
"otpLead": "We sent a 4-digit code to {phone}",
"@otpLead": { "placeholders": { "phone": { "type": "String" } } },
"otpVerify": "Verify and continue",
"otpResend": "Resend the code",
"otpResendIn": "Resend in {seconds}s",
"@otpResendIn": { "placeholders": { "seconds": { "type": "int" } } },
"otpErrIncomplete": "Enter the full code",
"otpErrInvalid": "That code is wrong or expired",
"otpErrTooManyAttempts": "Too many attempts. Request a new code.",
"otpErrRateLimited": "You requested the code too many times. Wait a moment and try again.",
"otpChangeNumber": "Change number",
"profileTitle": "Complete your profile",
"profileLead": "Your name is shown to the rider during a trip.",
"profileNameLabel": "Name",
"profileNameErrEmpty": "Enter your name",
"sessionExpired": "Your session ended. Please sign in again.",
"settingsTitle": "Settings",
"settingsTheme": "Appearance",
"settingsThemeSystem": "Follow system",
"settingsThemeLight": "Light",
"settingsThemeDark": "Dark",
"settingsLanguage": "Language",
"settingsLanguageArabic": "العربية",
"settingsLanguageEnglish": "English"
}
+10
View File
@@ -0,0 +1,10 @@
import 'package:flutter/widgets.dart';
import 'gen/app_localizations.dart';
export 'gen/app_localizations.dart';
/// كل نص مرئي يمرّ من هنا: `context.l10n.phoneTitle` (docs/26 §4).
extension L10nX on BuildContext {
L10n get l10n => L10n.of(this);
}