Update codebase

This commit is contained in:
Hamza-Ayed
2026-08-11 00:11:23 +03:00
parent 6726fcd917
commit 0ff7d04f9a
345 changed files with 3756 additions and 3369 deletions
@@ -3,7 +3,7 @@ import 'package:get/get.dart';
import '../../../constant/colors.dart';
import '../../../controller/insurance/driver_insurance_controller.dart';
import '../../widgets/ui/siro_ui.dart';
import '../../widgets/ui/tripz_ui.dart';
/// شاشة التأمين: الوثيقة النشطة ودفترها، أو الخطط المتاحة.
///
@@ -17,19 +17,19 @@ class DriverInsurancePage extends StatelessWidget {
Widget build(BuildContext context) {
final c = Get.put(DriverInsuranceController());
return SiroPage(
return TripzPage(
title: 'Insurance'.tr,
body: Obx(() {
if (c.isLoading.value) {
return const SiroLoading();
return const TripzLoading();
}
return RefreshIndicator(
onRefresh: c.refreshAll,
color: SiroUi.interactive(context),
color: TripzUi.interactive(context),
child: ListView(
physics: const AlwaysScrollableScrollPhysics(),
padding: SiroUi.pageInsets,
padding: TripzUi.pageInsets,
children:
c.hasPolicy ? _policyView(context, c) : _plansView(context, c),
),
@@ -43,14 +43,14 @@ class DriverInsurancePage extends StatelessWidget {
final p = c.policy.value!;
return [
SiroCard(
TripzCard(
accent: AppColor.greenColor,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
const SiroIconBadge(Icons.verified_user_rounded,
const TripzIconBadge(Icons.verified_user_rounded,
color: AppColor.greenColor),
const SizedBox(width: 10),
Expanded(
@@ -90,7 +90,7 @@ class DriverInsurancePage extends StatelessWidget {
// ── دفتر الأقساط ──
// يظهر في نفس الشاشة لا في أخرى: الخصم الذي لا يرى السائق مقابله
// مفاجأة تُفقد الثقة، مهما كان مشروحاً في مكان آخر.
SiroCard(
TripzCard(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -152,7 +152,7 @@ class DriverInsurancePage extends StatelessWidget {
// ‏نقص أهلية — ونقولها صراحة حتى لا يظن الكابتن أن التطبيق خربان.
return [
const SizedBox(height: 48),
SiroEmptyState(
TripzEmptyState(
icon: Icons.health_and_safety_outlined,
title: 'No insurance plans available yet'.tr,
message:
@@ -168,7 +168,7 @@ class DriverInsurancePage extends StatelessWidget {
final progress = (plan['progress_rides'] ?? 0) as num;
final required = (plan['required_rides'] ?? 0) as num;
return SiroCard(
return TripzCard(
accent: eligible ? AppColor.greenColor : null,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -183,7 +183,7 @@ class DriverInsurancePage extends StatelessWidget {
?.copyWith(fontWeight: FontWeight.bold)),
),
if (eligible)
SiroTag('Eligible'.tr,
TripzTag('Eligible'.tr,
color: AppColor.greenColor,
icon: Icons.check_circle_rounded),
],
@@ -196,7 +196,7 @@ class DriverInsurancePage extends StatelessWidget {
'${plan['billing_cycle'] == 'monthly' ? 'Monthly'.tr : 'Daily'.tr}',
style: Theme.of(context).textTheme.titleMedium?.copyWith(
fontWeight: FontWeight.bold,
color: SiroUi.interactive(context),
color: TripzUi.interactive(context),
),
),
if ((plan['coverage'] ?? '').toString().isNotEmpty) ...[
@@ -214,7 +214,7 @@ class DriverInsurancePage extends StatelessWidget {
child: LinearProgressIndicator(
minHeight: 7,
value: required == 0 ? 0 : (progress / required).clamp(0, 1),
backgroundColor: SiroUi.border(context),
backgroundColor: TripzUi.border(context),
),
),
const SizedBox(height: 6),
@@ -290,5 +290,5 @@ class DriverInsurancePage extends StatelessWidget {
(double.tryParse('${v ?? 0}') ?? 0).toStringAsFixed(2);
Widget _row(String label, String value) =>
SiroDetailRow(label: label, value: value);
TripzDetailRow(label: label, value: value);
}
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../controller/scheduled/driver_scheduled_rides_controller.dart';
import '../../../constant/colors.dart';
import '../../widgets/ui/siro_ui.dart';
import '../../widgets/ui/tripz_ui.dart';
class DriverScheduledRidesPage extends StatelessWidget {
const DriverScheduledRidesPage({super.key});
@@ -11,17 +11,17 @@ class DriverScheduledRidesPage extends StatelessWidget {
Widget build(BuildContext context) {
final controller = Get.put(DriverScheduledRidesController());
return SiroPage(
return TripzPage(
title: 'Upcoming Scheduled Rides'.tr,
body: Obx(() {
if (controller.isLoading.value) {
return const SiroLoading();
return const TripzLoading();
}
// ‏تعذّر الجلب: نقولها بدل ادّعاء "لا حجوزات" — الفرق بينهما
// ‏هو الفرق بين كابتن يطمئن وكابتن يفوته عمل مؤكد.
if (controller.hasError.value) {
return SiroErrorState(
return TripzErrorState(
message: '${'Could not load scheduled rides'.tr}\n'
'${'Please check your connection and try again.'.tr}',
onRetry: controller.fetch,
@@ -29,7 +29,7 @@ class DriverScheduledRidesPage extends StatelessWidget {
}
if (controller.bookings.isEmpty) {
return SiroEmptyState(
return TripzEmptyState(
icon: Icons.calendar_month_rounded,
title: 'You have no upcoming scheduled rides'.tr,
);
@@ -37,10 +37,10 @@ class DriverScheduledRidesPage extends StatelessWidget {
return RefreshIndicator(
onRefresh: controller.fetch,
color: SiroUi.interactive(context),
color: TripzUi.interactive(context),
child: ListView.builder(
physics: const AlwaysScrollableScrollPhysics(),
padding: SiroUi.pageInsets,
padding: TripzUi.pageInsets,
itemCount: controller.bookings.length,
itemBuilder: (context, index) {
final booking = controller.bookings[index];
@@ -53,7 +53,7 @@ class DriverScheduledRidesPage extends StatelessWidget {
}
Widget _buildBookingCard(Map<String, dynamic> booking, BuildContext context) {
return SiroCard(
return TripzCard(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -62,9 +62,9 @@ class DriverScheduledRidesPage extends StatelessWidget {
Expanded(
child: Align(
alignment: AlignmentDirectional.centerStart,
child: SiroTag(
child: TripzTag(
booking['scheduled_at'] ?? '',
color: SiroUi.interactive(context),
color: TripzUi.interactive(context),
icon: Icons.access_time_rounded,
),
),
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import '../../../controller/home/journal/schedule_controller.dart';
import '../../widgets/ui/siro_ui.dart';
import '../../widgets/ui/tripz_ui.dart';
class SchedulePage extends StatelessWidget {
SchedulePage({super.key});
@@ -9,15 +9,15 @@ class SchedulePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SiroPage(
return TripzPage(
title: 'My Schedule'.tr,
padding: SiroUi.pageInsets,
padding: TripzUi.pageInsets,
body: GetBuilder<ScheduleController>(builder: (sc) {
return SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SiroHeroHeader(
TripzHeroHeader(
label: 'Weekly Plan'.tr,
value: '${sc.totalWeeklyHours.toStringAsFixed(1)}h',
caption: '${sc.activeDays} ${'Days'.tr}',
@@ -32,7 +32,7 @@ class SchedulePage extends StatelessWidget {
color: Colors.white, size: 26),
),
),
SiroSectionTitle('Work Days'.tr),
TripzSectionTitle('Work Days'.tr),
...sc.schedule.map((slot) => _buildDayCard(context, slot, sc)),
const SizedBox(height: 16),
],
@@ -45,10 +45,10 @@ class SchedulePage extends StatelessWidget {
Widget _buildDayCard(
BuildContext context, WorkSlot slot, ScheduleController sc) {
final isAr = Get.locale?.languageCode == 'ar';
final accent = SiroUi.interactive(context);
final off = SiroUi.subtle(context);
final accent = TripzUi.interactive(context);
final off = TripzUi.subtle(context);
return SiroCard(
return TripzCard(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 10),
margin: const EdgeInsets.only(bottom: 10),
accent: slot.isActive ? accent : null,
@@ -135,7 +135,7 @@ class SchedulePage extends StatelessWidget {
child: Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 5),
decoration: BoxDecoration(
color: SiroUi.interactive(context).withValues(alpha: 0.10),
color: TripzUi.interactive(context).withValues(alpha: 0.10),
borderRadius: BorderRadius.circular(8),
),
child: Text(
@@ -143,7 +143,7 @@ class SchedulePage extends StatelessWidget {
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w700,
color: SiroUi.interactive(context),
color: TripzUi.interactive(context),
),
),
),