|
|
|
@@ -9,8 +9,8 @@ import '../../../constant/colors.dart';
|
|
|
|
|
/// والنهاري يتبعان `Theme.of(context)` بلا ألوان مثبّتة داخل الصفحات.
|
|
|
|
|
///
|
|
|
|
|
/// **لا تضع منطقاً هنا** — القطع كلها عرض صرف بلا حالة ولا كنترولرات.
|
|
|
|
|
class SiroUi {
|
|
|
|
|
const SiroUi._();
|
|
|
|
|
class TripzUi {
|
|
|
|
|
const TripzUi._();
|
|
|
|
|
|
|
|
|
|
// --- المسافات والانحناءات (مقياس واحد لكل التطبيق) ---
|
|
|
|
|
static const double gap = 12;
|
|
|
|
@@ -50,7 +50,7 @@ class SiroUi {
|
|
|
|
|
/// يستبدل الخليط الحالي: `Scaffold` عادي و`CupertinoPageScaffold` و`SliverAppBar`
|
|
|
|
|
/// وخلفيات `Colors.white` المثبّتة (التي كانت تُنتج صفحة بيضاء بنص أبيض في
|
|
|
|
|
/// الوضع الليلي — كما في سجل الرحلات).
|
|
|
|
|
class SiroPage extends StatelessWidget {
|
|
|
|
|
class TripzPage extends StatelessWidget {
|
|
|
|
|
final String title;
|
|
|
|
|
final Widget body;
|
|
|
|
|
final List<Widget>? actions;
|
|
|
|
@@ -61,7 +61,7 @@ class SiroPage extends StatelessWidget {
|
|
|
|
|
final Future<void> Function()? onRefresh;
|
|
|
|
|
final EdgeInsetsGeometry? padding;
|
|
|
|
|
|
|
|
|
|
const SiroPage({
|
|
|
|
|
const TripzPage({
|
|
|
|
|
super.key,
|
|
|
|
|
required this.title,
|
|
|
|
|
required this.body,
|
|
|
|
@@ -83,7 +83,7 @@ class SiroPage extends StatelessWidget {
|
|
|
|
|
if (onRefresh != null) {
|
|
|
|
|
content = RefreshIndicator(
|
|
|
|
|
onRefresh: onRefresh!,
|
|
|
|
|
color: SiroUi.interactive(context),
|
|
|
|
|
color: TripzUi.interactive(context),
|
|
|
|
|
child: content,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
@@ -110,14 +110,14 @@ class SiroPage extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// البطاقة الموحّدة: سطح + حدّ رفيع + انحناء واحد. بلا ظلال ثقيلة.
|
|
|
|
|
class SiroCard extends StatelessWidget {
|
|
|
|
|
class TripzCard extends StatelessWidget {
|
|
|
|
|
final Widget child;
|
|
|
|
|
final EdgeInsetsGeometry padding;
|
|
|
|
|
final EdgeInsetsGeometry? margin;
|
|
|
|
|
final VoidCallback? onTap;
|
|
|
|
|
final Color? accent;
|
|
|
|
|
|
|
|
|
|
const SiroCard({
|
|
|
|
|
const TripzCard({
|
|
|
|
|
super.key,
|
|
|
|
|
required this.child,
|
|
|
|
|
this.padding = const EdgeInsets.all(16),
|
|
|
|
@@ -128,11 +128,11 @@ class SiroCard extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final radius = BorderRadius.circular(SiroUi.cardRadius);
|
|
|
|
|
final radius = BorderRadius.circular(TripzUi.cardRadius);
|
|
|
|
|
return Padding(
|
|
|
|
|
padding: margin ?? const EdgeInsets.only(bottom: SiroUi.gap),
|
|
|
|
|
padding: margin ?? const EdgeInsets.only(bottom: TripzUi.gap),
|
|
|
|
|
child: Material(
|
|
|
|
|
color: SiroUi.surface(context),
|
|
|
|
|
color: TripzUi.surface(context),
|
|
|
|
|
borderRadius: radius,
|
|
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
|
child: InkWell(
|
|
|
|
@@ -142,7 +142,7 @@ class SiroCard extends StatelessWidget {
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
borderRadius: radius,
|
|
|
|
|
border: Border.all(
|
|
|
|
|
color: accent?.withValues(alpha: 0.35) ?? SiroUi.border(context),
|
|
|
|
|
color: accent?.withValues(alpha: 0.35) ?? TripzUi.border(context),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: child,
|
|
|
|
@@ -154,11 +154,11 @@ class SiroCard extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// عنوان قسم داخل الصفحة، بخط جانبي بلون العلامة.
|
|
|
|
|
class SiroSectionTitle extends StatelessWidget {
|
|
|
|
|
class TripzSectionTitle extends StatelessWidget {
|
|
|
|
|
final String title;
|
|
|
|
|
final Widget? trailing;
|
|
|
|
|
|
|
|
|
|
const SiroSectionTitle(this.title, {super.key, this.trailing});
|
|
|
|
|
const TripzSectionTitle(this.title, {super.key, this.trailing});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
@@ -170,7 +170,7 @@ class SiroSectionTitle extends StatelessWidget {
|
|
|
|
|
width: 3,
|
|
|
|
|
height: 16,
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: SiroUi.interactive(context),
|
|
|
|
|
color: TripzUi.interactive(context),
|
|
|
|
|
borderRadius: BorderRadius.circular(2),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
@@ -192,12 +192,12 @@ class SiroSectionTitle extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// أيقونة داخل دائرة ملوّنة خفيفة — نفس نمط أيقونات القائمة الجانبية.
|
|
|
|
|
class SiroIconBadge extends StatelessWidget {
|
|
|
|
|
class TripzIconBadge extends StatelessWidget {
|
|
|
|
|
final IconData icon;
|
|
|
|
|
final Color color;
|
|
|
|
|
final double size;
|
|
|
|
|
|
|
|
|
|
const SiroIconBadge(this.icon,
|
|
|
|
|
const TripzIconBadge(this.icon,
|
|
|
|
|
{super.key, required this.color, this.size = 20});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@@ -214,12 +214,12 @@ class SiroIconBadge extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// شارة نصية صغيرة (حالة رحلة، نوع عرض، ...).
|
|
|
|
|
class SiroTag extends StatelessWidget {
|
|
|
|
|
class TripzTag extends StatelessWidget {
|
|
|
|
|
final String label;
|
|
|
|
|
final Color color;
|
|
|
|
|
final IconData? icon;
|
|
|
|
|
|
|
|
|
|
const SiroTag(this.label, {super.key, required this.color, this.icon});
|
|
|
|
|
const TripzTag(this.label, {super.key, required this.color, this.icon});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
@@ -248,13 +248,13 @@ class SiroTag extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// خانة إحصاء (قيمة كبيرة + تسمية) — تُستعمل في الأرباح والمحفظة والملف.
|
|
|
|
|
class SiroStat extends StatelessWidget {
|
|
|
|
|
class TripzStat extends StatelessWidget {
|
|
|
|
|
final String value;
|
|
|
|
|
final String label;
|
|
|
|
|
final IconData? icon;
|
|
|
|
|
final Color? color;
|
|
|
|
|
|
|
|
|
|
const SiroStat({
|
|
|
|
|
const TripzStat({
|
|
|
|
|
super.key,
|
|
|
|
|
required this.value,
|
|
|
|
|
required this.label,
|
|
|
|
@@ -264,12 +264,12 @@ class SiroStat extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
final c = color ?? SiroUi.interactive(context);
|
|
|
|
|
final c = color ?? TripzUi.interactive(context);
|
|
|
|
|
return Column(
|
|
|
|
|
mainAxisSize: MainAxisSize.min,
|
|
|
|
|
children: [
|
|
|
|
|
if (icon != null) ...[
|
|
|
|
|
SiroIconBadge(icon!, color: c, size: 18),
|
|
|
|
|
TripzIconBadge(icon!, color: c, size: 18),
|
|
|
|
|
const SizedBox(height: 8),
|
|
|
|
|
],
|
|
|
|
|
FittedBox(
|
|
|
|
@@ -296,10 +296,10 @@ class SiroStat extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// صفّ إحصاءات متساوية داخل بطاقة واحدة، بفواصل رأسية.
|
|
|
|
|
class SiroStatRow extends StatelessWidget {
|
|
|
|
|
final List<SiroStat> stats;
|
|
|
|
|
class TripzStatRow extends StatelessWidget {
|
|
|
|
|
final List<TripzStat> stats;
|
|
|
|
|
|
|
|
|
|
const SiroStatRow(this.stats, {super.key});
|
|
|
|
|
const TripzStatRow(this.stats, {super.key});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
@@ -309,12 +309,12 @@ class SiroStatRow extends StatelessWidget {
|
|
|
|
|
children.add(Container(
|
|
|
|
|
width: 1,
|
|
|
|
|
height: 40,
|
|
|
|
|
color: SiroUi.border(context),
|
|
|
|
|
color: TripzUi.border(context),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
children.add(Expanded(child: stats[i]));
|
|
|
|
|
}
|
|
|
|
|
return SiroCard(
|
|
|
|
|
return TripzCard(
|
|
|
|
|
padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 8),
|
|
|
|
|
child: Row(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
@@ -324,16 +324,16 @@ class SiroStatRow extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// حالة الفراغ. **منفصلة عمداً عن [SiroErrorState]**: عرض «لا يوجد» عند فشل
|
|
|
|
|
/// حالة الفراغ. **منفصلة عمداً عن [TripzErrorState]**: عرض «لا يوجد» عند فشل
|
|
|
|
|
/// الشبكة يُضلّل الكابتن ويجعله يظن أن لا عمل لديه.
|
|
|
|
|
class SiroEmptyState extends StatelessWidget {
|
|
|
|
|
class TripzEmptyState extends StatelessWidget {
|
|
|
|
|
final IconData icon;
|
|
|
|
|
final String title;
|
|
|
|
|
final String? message;
|
|
|
|
|
final String? actionLabel;
|
|
|
|
|
final VoidCallback? onAction;
|
|
|
|
|
|
|
|
|
|
const SiroEmptyState({
|
|
|
|
|
const TripzEmptyState({
|
|
|
|
|
super.key,
|
|
|
|
|
required this.icon,
|
|
|
|
|
required this.title,
|
|
|
|
@@ -354,10 +354,10 @@ class SiroEmptyState extends StatelessWidget {
|
|
|
|
|
Container(
|
|
|
|
|
padding: const EdgeInsets.all(22),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: SiroUi.interactive(context).withValues(alpha: 0.08),
|
|
|
|
|
color: TripzUi.interactive(context).withValues(alpha: 0.08),
|
|
|
|
|
shape: BoxShape.circle,
|
|
|
|
|
),
|
|
|
|
|
child: Icon(icon, size: 40, color: SiroUi.interactive(context)),
|
|
|
|
|
child: Icon(icon, size: 40, color: TripzUi.interactive(context)),
|
|
|
|
|
),
|
|
|
|
|
const SizedBox(height: 18),
|
|
|
|
|
Text(
|
|
|
|
@@ -388,11 +388,11 @@ class SiroEmptyState extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// حالة الخطأ — بلون تحذيري وبزر إعادة محاولة صريح.
|
|
|
|
|
class SiroErrorState extends StatelessWidget {
|
|
|
|
|
class TripzErrorState extends StatelessWidget {
|
|
|
|
|
final String message;
|
|
|
|
|
final VoidCallback? onRetry;
|
|
|
|
|
|
|
|
|
|
const SiroErrorState({super.key, required this.message, this.onRetry});
|
|
|
|
|
const TripzErrorState({super.key, required this.message, this.onRetry});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
@@ -434,9 +434,9 @@ class SiroErrorState extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// مؤشّر التحميل الموحّد.
|
|
|
|
|
class SiroLoading extends StatelessWidget {
|
|
|
|
|
class TripzLoading extends StatelessWidget {
|
|
|
|
|
final String? label;
|
|
|
|
|
const SiroLoading({super.key, this.label});
|
|
|
|
|
const TripzLoading({super.key, this.label});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
@@ -446,7 +446,7 @@ class SiroLoading extends StatelessWidget {
|
|
|
|
|
children: [
|
|
|
|
|
CircularProgressIndicator(
|
|
|
|
|
strokeWidth: 2.6,
|
|
|
|
|
color: SiroUi.interactive(context),
|
|
|
|
|
color: TripzUi.interactive(context),
|
|
|
|
|
),
|
|
|
|
|
if (label != null) ...[
|
|
|
|
|
const SizedBox(height: 14),
|
|
|
|
@@ -459,13 +459,13 @@ class SiroLoading extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// صفّ «تسمية ← قيمة» داخل بطاقة تفاصيل.
|
|
|
|
|
class SiroDetailRow extends StatelessWidget {
|
|
|
|
|
class TripzDetailRow extends StatelessWidget {
|
|
|
|
|
final String label;
|
|
|
|
|
final String value;
|
|
|
|
|
final IconData? icon;
|
|
|
|
|
final Color? valueColor;
|
|
|
|
|
|
|
|
|
|
const SiroDetailRow({
|
|
|
|
|
const TripzDetailRow({
|
|
|
|
|
super.key,
|
|
|
|
|
required this.label,
|
|
|
|
|
required this.value,
|
|
|
|
@@ -480,7 +480,7 @@ class SiroDetailRow extends StatelessWidget {
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|
|
|
|
|
if (icon != null) ...[
|
|
|
|
|
Icon(icon, size: 17, color: SiroUi.subtle(context)),
|
|
|
|
|
Icon(icon, size: 17, color: TripzUi.subtle(context)),
|
|
|
|
|
const SizedBox(width: 8),
|
|
|
|
|
],
|
|
|
|
|
Expanded(
|
|
|
|
@@ -504,14 +504,14 @@ class SiroDetailRow extends StatelessWidget {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// رأس بارز بتدرّج العلامة — بديل الـ `SliverAppBar` الملوّن يدوياً في كل صفحة.
|
|
|
|
|
class SiroHeroHeader extends StatelessWidget {
|
|
|
|
|
class TripzHeroHeader extends StatelessWidget {
|
|
|
|
|
final String label;
|
|
|
|
|
final String value;
|
|
|
|
|
final String? caption;
|
|
|
|
|
final IconData? icon;
|
|
|
|
|
final Widget? trailing;
|
|
|
|
|
|
|
|
|
|
const SiroHeroHeader({
|
|
|
|
|
const TripzHeroHeader({
|
|
|
|
|
super.key,
|
|
|
|
|
required this.label,
|
|
|
|
|
required this.value,
|
|
|
|
@@ -524,11 +524,11 @@ class SiroHeroHeader extends StatelessWidget {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Container(
|
|
|
|
|
width: double.infinity,
|
|
|
|
|
margin: const EdgeInsets.only(bottom: SiroUi.gap),
|
|
|
|
|
margin: const EdgeInsets.only(bottom: TripzUi.gap),
|
|
|
|
|
padding: const EdgeInsets.all(20),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
gradient: SiroUi.brandGradient(context),
|
|
|
|
|
borderRadius: BorderRadius.circular(SiroUi.cardRadius),
|
|
|
|
|
gradient: TripzUi.brandGradient(context),
|
|
|
|
|
borderRadius: BorderRadius.circular(TripzUi.cardRadius),
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
children: [
|