fix order history, add CheckUser check before starting the trip, fix dialog for cancel the order, add dialog for finish the order
This commit is contained in:
@@ -8,6 +8,7 @@ import '../../../di/service_locator.dart';
|
||||
import '../../event/active_ride_event.dart';
|
||||
import '../../state/active_ride_state.dart';
|
||||
import '../../viewmodel/active_ride_bloc.dart';
|
||||
import '../dialog/finish_ride_confirmation_dialog.dart';
|
||||
import '../notification_toast.dart';
|
||||
|
||||
class ActiveRideSheet extends StatefulWidget {
|
||||
@@ -290,32 +291,25 @@ class _ActiveRideSheetState extends State<ActiveRideSheet> {
|
||||
child: InkWell(
|
||||
onTap: state.status == ActiveRideStatus.loading
|
||||
? null
|
||||
: () {
|
||||
_bloc.add(FinishRide(widget.orderId));
|
||||
Navigator.pop(context);
|
||||
context.go("/home/order-photos/${widget.orderId}");
|
||||
},
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.stop,
|
||||
color: Colors.white,
|
||||
size: 24,
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
const Text(
|
||||
'ЗАВЕРШИТЬ',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
: () async {
|
||||
// 🔹 Показываем диалог подтверждения
|
||||
final result = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (context) => const FinishRideConfirmationDialog(),
|
||||
);
|
||||
|
||||
// 🔹 Если пользователь подтвердил — завершаем и переходим
|
||||
if (result == true) {
|
||||
_bloc.add(FinishRide(widget.orderId));
|
||||
Navigator.pop(context); // закрываем ActiveRideSheet
|
||||
context.go("/home/order-photos/${widget.orderId}");
|
||||
}
|
||||
// 🔹 Если отменил — ничего не делаем, диалог уже закрылся
|
||||
},
|
||||
),
|
||||
|
||||
|
||||
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user