استكمال قرار 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>
79 lines
2.4 KiB
Dart
79 lines
2.4 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
import 'package:driver/core/l10n/app_localizations.dart';
|
|
import '../cubit/auth_cubit.dart';
|
|
import '../cubit/auth_state.dart';
|
|
import '../../../core/ui/tripz_scaffold.dart';
|
|
import '../../../core/ui/tripz_button.dart';
|
|
import '../../../core/ui/tripz_text_field.dart';
|
|
|
|
class OtpScreen extends StatefulWidget {
|
|
const OtpScreen({super.key});
|
|
@override
|
|
State<OtpScreen> createState() => _OtpScreenState();
|
|
}
|
|
|
|
class _OtpScreenState extends State<OtpScreen> {
|
|
final _controller = TextEditingController();
|
|
|
|
@override
|
|
void dispose() {
|
|
_controller.dispose();
|
|
super.dispose();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final l10n = AppLocalizations.of(context)!;
|
|
|
|
return TripzScaffold(
|
|
showBackButton: true,
|
|
onBack: () => context.go('/phone'),
|
|
child: BlocConsumer<AuthCubit, AuthState>(
|
|
listener: (context, state) {
|
|
if (state.status == AuthStatus.error && state.error != null) {
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
SnackBar(content: Text(state.error!)),
|
|
);
|
|
}
|
|
},
|
|
builder: (context, state) {
|
|
return Column(
|
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
children: [
|
|
const SizedBox(height: 24),
|
|
Text(
|
|
l10n.otpTitle,
|
|
style: Theme.of(context).textTheme.titleLarge,
|
|
),
|
|
const SizedBox(height: 8),
|
|
Text(
|
|
l10n.otpSentTo(state.phone),
|
|
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
|
color: Theme.of(context).colorScheme.onSurfaceVariant,
|
|
),
|
|
),
|
|
const SizedBox(height: 28),
|
|
TripzTextField(
|
|
controller: _controller,
|
|
label: l10n.otpLabel,
|
|
keyboardType: TextInputType.number,
|
|
textAlign: TextAlign.center,
|
|
maxLength: 6,
|
|
),
|
|
const SizedBox(height: 20),
|
|
TripzButton(
|
|
label: l10n.confirm,
|
|
loading: state.status == AuthStatus.authenticating,
|
|
onPressed: () =>
|
|
context.read<AuthCubit>().verify(_controller.text),
|
|
),
|
|
],
|
|
);
|
|
},
|
|
),
|
|
);
|
|
}
|
|
}
|