flagged bugs fix
This commit is contained in:
@@ -130,6 +130,12 @@ class _BookingPickupScreenState extends State<BookingPickupScreen> {
|
||||
if (match != null) draft.pickupPincode = match.group(0)!;
|
||||
}
|
||||
|
||||
if (draft.pickupPincode.isEmpty) {
|
||||
_showValidationError('Missing Pickup Pincode',
|
||||
'We couldn\'t detect a pincode for your pickup address. Please use "Use GPS current location", pick a saved address, or include the 6-digit pincode in the address.');
|
||||
return;
|
||||
}
|
||||
|
||||
setState(() => _loading = true);
|
||||
await appState.fetchPriceEstimate();
|
||||
setState(() => _loading = false);
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:doormile/main.dart';
|
||||
import 'package:doormile/shared/state/app_state.dart';
|
||||
import 'package:doormile/core/utils/snackbar_utils.dart';
|
||||
import 'package:doormile/core/theme/app_colors.dart';
|
||||
import 'package:doormile/core/theme/app_theme.dart';
|
||||
import 'package:doormile/core/widgets/common.dart';
|
||||
@@ -51,13 +52,20 @@ class _PaymentSheetState extends State<_PaymentSheet> {
|
||||
state.draft.paymentMethod = _methods[_selected].name;
|
||||
await Future.delayed(const Duration(milliseconds: 1400));
|
||||
if (!mounted) return;
|
||||
state.placeOrder();
|
||||
Navigator.pop(context); // close sheet
|
||||
Navigator.pushNamedAndRemoveUntil(
|
||||
context,
|
||||
Routes.bookingSuccess,
|
||||
(r) => r.settings.name == Routes.home,
|
||||
);
|
||||
try {
|
||||
await state.placeOrder();
|
||||
if (!mounted) return;
|
||||
Navigator.pop(context); // close sheet
|
||||
Navigator.pushNamedAndRemoveUntil(
|
||||
context,
|
||||
Routes.bookingSuccess,
|
||||
(r) => r.settings.name == Routes.home,
|
||||
);
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
setState(() => _processing = false);
|
||||
SnackbarUtils.showError(context, e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
Reference in New Issue
Block a user