Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mo7amedaliEbaid committed Jul 19, 2024
1 parent dfe1641 commit 1b4bdbd
Show file tree
Hide file tree
Showing 7 changed files with 178 additions and 128 deletions.
2 changes: 1 addition & 1 deletion lib/presentation/screens/cart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class _CartScreenState extends State<CartScreen> {
"$totalPrice KWD",
style: AppText.h1b?.copyWith(color: AppColors.deepRed),
),
Space.yf(1.8),
Space.yf(9.8),
customElevatedButton(
withArrow: true,
width: double.infinity,
Expand Down
304 changes: 177 additions & 127 deletions lib/presentation/screens/reservation_checkout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,153 +16,203 @@ class ReservationCheckoutScreen extends StatelessWidget {

@override
Widget build(BuildContext context) {
return Scaffold(
appBar:
customAppBar(context: context, title: "Checkout", isWithArrow: true),
body: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: Space.all(1.3, 2),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
reservation.restaurant.capitalize(),
style: AppText.h2b,
),
Space.yf(.2),
Row(
pay() {
context.read<AddReservationCubit>().addReservation(reservation).then(
(value) =>
Navigator.of(context).pushNamed(AppRouter.successfulBooking),
);
}

return BlocListener<PaymentCubit, PaymentState>(
listener: (context, state) {
if (state is PaymentSuccess) {
pay();
}
},
child: Scaffold(
appBar: customAppBar(
context: context,
title: "Checkout",
isWithArrow: true,
),
body: SingleChildScrollView(
child: Column(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Padding(
padding: Space.all(1.3, 2),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Icon(
Icons.location_on_rounded,
size: AppDimensions.normalize(8),
),
Space.xf(.2),
Text(
reservation.branch.capitalize(),
style: AppText.h3,
)
],
),
Space.yf(1.5),
Text(
"Customer Name:",
style: AppText.h3,
),
Space.yf(.2),
Text(
reservation.name.capitalize(),
style: AppText.h3b,
),
Space.yf(1.5),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Booking Date:",
style: AppText.h3,
),
Space.yf(.2),
Text(
reservation.date,
style: AppText.h3b,
)
],
reservation.restaurant.capitalize(),
style: AppText.h2b,
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
Space.yf(.2),
Row(
children: [
Text(
"Booking Time:",
style: AppText.h3,
Icon(
Icons.location_on_rounded,
size: AppDimensions.normalize(8),
),
Space.yf(.2),
Space.xf(.2),
Text(
reservation.time,
style: AppText.h3b,
reservation.branch.capitalize(),
style: AppText.h3,
)
],
)
],
),
Space.yf(1.5),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
),
Space.yf(1.5),
Text(
"Customer Name:",
style: AppText.h3,
),
Space.yf(.2),
Text(
reservation.name.capitalize(),
style: AppText.h3b,
),
Space.yf(1.5),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"No. of Persons:",
style: AppText.h3,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Booking Date:",
style: AppText.h3,
),
Space.yf(.2),
Text(
reservation.date,
style: AppText.h3b,
)
],
),
Space.yf(.2),
Text(
reservation.personsNumber,
style: AppText.h3b,
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
"Booking Time:",
style: AppText.h3,
),
Space.yf(.2),
Text(
reservation.time,
style: AppText.h3b,
)
],
)
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
Space.yf(1.5),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
"Tawla Location:",
style: AppText.h3,
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"No. of Persons:",
style: AppText.h3,
),
Space.yf(.2),
Text(
reservation.personsNumber,
style: AppText.h3b,
)
],
),
Space.yf(.2),
Text(
"Any",
style: AppText.h3b,
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
"Tawla Location:",
style: AppText.h3,
),
Space.yf(.2),
Text(
"Any",
style: AppText.h3b,
)
],
)
],
)
),
Space.yf(1.5),
Text(
"Occasion:",
style: AppText.h3,
),
Space.yf(.2),
Text(
"No Occasion",
style: AppText.h3b,
),
Space.yf(1.5),
Text(
"Special Request:",
style: AppText.h3,
),
Space.yf(.2),
Text(
"dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown.",
style: AppText.b1,
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
],
),
Space.yf(1.5),
Text(
"Occasion:",
style: AppText.h3,
),
Space.yf(.2),
Text(
"No Occasion",
style: AppText.h3b,
),
Space.yf(1.5),
Text(
"Special Request:",
style: AppText.h3,
),
Space.yf(.2),
Text(
"dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry’s standard dummy text ever since the 1500s, when an unknown.",
style: AppText.b1,
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
],
),
),
reservationAmountColumn("25"),
// Space.y!,
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
customElevatedButton(
width: AppDimensions.normalize(65),
height: AppDimensions.normalize(20),
color: AppColors.deepRed,
borderRadius: AppDimensions.normalize(7),
text: "Pay 25 USD",
textStyle: AppText.b1b!.copyWith(color: Colors.white),
onPressed: () {
// Navigator.of(context).pushNamed(AppRouter.payment);
context.read<PaymentCubit>().createPaymentIntent(
amount: '25',
);
}),
customOutlinedButton(
width: AppDimensions.normalize(65),
height: AppDimensions.normalize(20),
borderColor: AppColors.darkRed,
borderRadius: AppDimensions.normalize(7),
text: "Pay On Arrival",
textStyle: AppText.b1b!.copyWith(color: AppColors.darkRed),
onPressed: () {
pay();
// context.read<SelectedTapCubit>().updateIndex(1);
})
],
),
Space.yf(),
/*customElevatedButton(
width: double.infinity,
height: AppDimensions.normalize(22),
color: AppColors.deepRed,
borderRadius: 0,
text: "Proceed",
textStyle: AppText.h3b!.copyWith(color: Colors.white),
onPressed: () async {
await context
.read<AddReservationCubit>()
.addReservation(reservation);
Navigator.of(context).pushNamed(AppRouter.successfulBooking);
})*/
],
),
reservationAmountColumn("25"),
customElevatedButton(
width: double.infinity,
height: AppDimensions.normalize(22),
color: AppColors.deepRed,
borderRadius: 0,
text: "Proceed",
textStyle: AppText.h3b!.copyWith(color: Colors.white),
onPressed: () async {
await context
.read<AddReservationCubit>()
.addReservation(reservation);
Navigator.of(context).pushNamed(AppRouter.successfulBooking);
})
],
),
),
);
}
Expand Down
Binary file added screenshots/cart.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/pickup2.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/pickup_order_checkout.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/preorders.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/reservasions.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1b4bdbd

Please sign in to comment.