6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit bee5771c
Changed files
.../check_out/pages/check_out_success_page.dart | 103 +++++++++++---------- 1 file changed, 55 insertions(+), 48 deletions(-)
Diff
diff --git a/comwell_key_app/lib/check_out/pages/check_out_success_page.dart b/comwell_key_app/lib/check_out/pages/check_out_success_page.dart
index 7a204921..d82b038c 100644
--- a/comwell_key_app/lib/check_out/pages/check_out_success_page.dart
+++ b/comwell_key_app/lib/check_out/pages/check_out_success_page.dart
@@ -1,4 +1,5 @@
import 'package:comwell_key_app/check_out/bloc/check_out_cubit.dart';
+import 'package:comwell_key_app/check_out/bloc/check_out_state.dart';
import 'package:comwell_key_app/check_out/components/check_out_countdown.dart';
import 'package:comwell_key_app/routing/app_routes.dart';
import 'package:comwell_key_app/themes/light_theme.dart';
@@ -14,62 +15,68 @@ class CheckOutSuccessPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
- final cubit = context.read<CheckoutCubit>();
- return Scaffold(
- backgroundColor: sandColor[80],
- body: Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16.0),
- child: Padding(
- padding: const EdgeInsets.symmetric(vertical: 40.0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.center,
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- const SizedBox(),
- digitalCard ? const CheckOutCountdown() : const SizedBox(),
- Column(
+ return BlocBuilder<CheckoutCubit, CheckoutState>(
+ builder: (context, state) {
+ final cubit = context.read<CheckoutCubit>();
+ return Scaffold(
+ backgroundColor: sandColor[80],
+ body: Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16.0),
+ child: Padding(
+ padding: const EdgeInsets.symmetric(vertical: 40.0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
- Text(
- context.strings.checkout_page_processing_success_title,
- style: Theme.of(
- context,
- ).textTheme.headlineMedium?.copyWith(color: colorBackground),
- ),
- Text(
- digitalCard
- ? context.strings.checkout_page_processing_success_subtitle
- : context.strings.checkout_page_processing_success_subtitle_no_digital_card,
- textAlign: TextAlign.center,
- style: Theme.of(context).textTheme.bodySmall?.copyWith(color: colorDivider),
- ),
- ],
- ),
- Row(
- children: [
- Expanded(
- child: ElevatedButton(
- onPressed: () {
- context.go(AppRoutes.overview);
- context.push(AppRoutes.bookingDetails, extra: cubit.booking);
- },
- style: const ButtonStyle(
- backgroundColor: WidgetStatePropertyAll(colorBackground),
+ const SizedBox(),
+ digitalCard ? const CheckOutCountdown() : const SizedBox(),
+ Column(
+ children: [
+ Text(
+ context.strings.checkout_page_processing_success_title,
+ style: Theme.of(
+ context,
+ ).textTheme.headlineMedium?.copyWith(color: colorBackground),
+ ),
+ Text(
+ digitalCard
+ ? context.strings.checkout_page_processing_success_subtitle
+ : context
+ .strings
+ .checkout_page_processing_success_subtitle_no_digital_card,
+ textAlign: TextAlign.center,
+ style: Theme.of(context).textTheme.bodySmall?.copyWith(color: colorDivider),
),
- child: Padding(
- padding: const EdgeInsets.all(16.0),
- child: Text(
- context.strings.generic_ok,
- style: const TextStyle(color: colorTertiary),
+ ],
+ ),
+ Row(
+ children: [
+ Expanded(
+ child: ElevatedButton(
+ onPressed: () {
+ context.go(AppRoutes.overview);
+ context.push(AppRoutes.bookingDetails, extra: cubit.booking);
+ },
+ style: const ButtonStyle(
+ backgroundColor: WidgetStatePropertyAll(colorBackground),
+ ),
+ child: Padding(
+ padding: const EdgeInsets.all(16.0),
+ child: Text(
+ context.strings.generic_ok,
+ style: const TextStyle(color: colorTertiary),
+ ),
+ ),
),
),
- ),
+ ],
),
],
),
- ],
+ ),
),
- ),
- ),
+ );
+ },
);
}
}