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:
@@ -3,11 +3,8 @@ import 'package:flutter/material.dart';
|
||||
class CancelBookingDialog extends StatelessWidget {
|
||||
const CancelBookingDialog({super.key});
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
bool result = false;
|
||||
|
||||
return Dialog(
|
||||
backgroundColor: Colors.transparent,
|
||||
insetPadding: const EdgeInsets.symmetric(horizontal: 40),
|
||||
@@ -42,6 +39,7 @@ class CancelBookingDialog extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
|
||||
// 🔹 Кнопка "Отменить" — ПЕРВАЯ, зелёная (градиент), возвращает true
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: 52,
|
||||
@@ -52,10 +50,7 @@ class CancelBookingDialog extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
child: ElevatedButton(
|
||||
onPressed: () => {
|
||||
result = false,
|
||||
Navigator.pop(context, result)
|
||||
},
|
||||
onPressed: () => Navigator.pop(context, true), // ✅ true = отменить
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Colors.transparent,
|
||||
shadowColor: Colors.transparent,
|
||||
@@ -64,9 +59,9 @@ class CancelBookingDialog extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
child: const Text(
|
||||
"Оставить",
|
||||
"Отменить",
|
||||
style: TextStyle(
|
||||
color: Color(0xFF1D273A),
|
||||
color: Color(0xFF1D273A), // тёмный текст на светлом градиенте
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
@@ -74,14 +69,13 @@ class CancelBookingDialog extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
// 🔹 Кнопка "Оставить" — ВТОРАЯ, тёмная, возвращает false
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
height: 52,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
result = true;
|
||||
Navigator.pop(context, result);
|
||||
},
|
||||
onPressed: () => Navigator.pop(context, false), // ❌ false = оставить
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: const Color(0xFF0D1024),
|
||||
shape: RoundedRectangleBorder(
|
||||
@@ -89,7 +83,7 @@ class CancelBookingDialog extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
child: const Text(
|
||||
"Отменить",
|
||||
"Оставить",
|
||||
style: TextStyle(color: Colors.white, fontSize: 16),
|
||||
),
|
||||
),
|
||||
@@ -99,4 +93,4 @@ class CancelBookingDialog extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user