استكمال قرار 2026-07-27 (كوميت fff76c9 أرشف الباك إند):
apps/rider → apps/rider-archive-cubit
apps/driver → apps/driver-archive-cubit
dashboards/admin-web → dashboards/admin-web-archive
dashboards/service-web → dashboards/service-web-archive
إعادة تسمية بلا تعديل محتوى. rider/driver كانا إعادة بناء Cubit مبنية على
عقد NestJS المؤرشف. admin-web و service-web نموذجان بملف HTML واحد (164 و
128 سطراً) — يحلّ محلهما siro_admin و siro_service المكتملان.
يُحمل من المؤرشف ولا يُعاد اكتشافه: عقد map-saas المثبَّت بالتجربة في
apps/rider-archive-cubit/lib/core/api/ (x-api-key ترويسة، reverse مصفوفة،
route في points) ودرس مسار FCM.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
119 lines
3.6 KiB
Dart
119 lines
3.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import '../../../core/l10n/app_localizations.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
import '../../../core/design/tokens.dart';
|
|
import '../../../core/ui/tripz_button.dart';
|
|
import '../../../core/ui/tripz_scaffold.dart';
|
|
import '../bloc/trip_bloc.dart';
|
|
import '../bloc/trip_state.dart';
|
|
import '../bloc/trip_event.dart';
|
|
|
|
/// شاشة تقييم الرحلة.
|
|
class RatingScreen extends StatefulWidget {
|
|
const RatingScreen({super.key});
|
|
|
|
@override
|
|
State<RatingScreen> createState() => _RatingScreenState();
|
|
}
|
|
|
|
class _RatingScreenState extends State<RatingScreen> {
|
|
int _stars = 0;
|
|
final _commentController = TextEditingController();
|
|
|
|
@override
|
|
void dispose() {
|
|
_commentController.dispose();
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final l10n = AppLocalizations.of(context)!;
|
|
final cs = Theme.of(context).colorScheme;
|
|
|
|
return BlocListener<TripBloc, TripState>(
|
|
listenWhen: (prev, cur) => prev.rated != cur.rated,
|
|
listener: (context, state) {
|
|
if (state.rated) {
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
SnackBar(content: Text(l10n.thankYou)),
|
|
);
|
|
context.read<TripBloc>().add(const TripClear());
|
|
context.go('/home');
|
|
}
|
|
},
|
|
child: TripzScaffold(
|
|
title: l10n.rateYourTrip,
|
|
showBackButton: true,
|
|
onBack: () {
|
|
context.read<TripBloc>().add(const TripClear());
|
|
context.go('/home');
|
|
},
|
|
child: Column(
|
|
children: [
|
|
const Spacer(flex: 2),
|
|
|
|
// نجوم التقييم
|
|
Text(
|
|
l10n.rateDriver,
|
|
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
|
|
fontWeight: FontWeight.w700,
|
|
),
|
|
),
|
|
const SizedBox(height: T.s24),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: List.generate(5, (i) {
|
|
final index = i + 1;
|
|
return GestureDetector(
|
|
onTap: () => setState(() => _stars = index),
|
|
child: Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 6),
|
|
child: Icon(
|
|
index <= _stars ? Icons.star_rounded : Icons.star_outline_rounded,
|
|
size: 48,
|
|
color: index <= _stars ? Colors.amber : cs.onSurfaceVariant,
|
|
),
|
|
),
|
|
);
|
|
}),
|
|
),
|
|
|
|
const SizedBox(height: T.s24),
|
|
|
|
// حقل التعليق
|
|
TextField(
|
|
controller: _commentController,
|
|
maxLines: 3,
|
|
decoration: InputDecoration(
|
|
hintText: l10n.ratingComment,
|
|
border: const OutlineInputBorder(),
|
|
),
|
|
),
|
|
|
|
const Spacer(flex: 3),
|
|
|
|
// زر الإرسال
|
|
SizedBox(
|
|
width: double.infinity,
|
|
child: TripzButton(
|
|
label: l10n.submitRating,
|
|
onPressed: _stars > 0
|
|
? () {
|
|
context.read<TripBloc>().add(TripRate(
|
|
stars: _stars,
|
|
comment: _commentController.text,
|
|
));
|
|
}
|
|
: null,
|
|
),
|
|
),
|
|
const SizedBox(height: T.s8),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|