6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 74ba85a3

AuthorMikkel Thygesen<mth@dwarf.dk>
Date2025-01-20 11:19:59 +0100
462: updated prereg flow to reflect changes in add-card implementation

Changed files

comwell_key_app/assets/translations/en-US.json     |  1 +
 .../services/adyen/stored_payment_method.g.dart    | 12 ------------
 comwell_key_app/lib/check_in/check_in_page.dart    |  7 +++++--
 .../lib/pregistration/components/add_card.dart     |  2 +-
 .../lib/pregistration/components/card_item.dart    |  2 +-
 .../pages/prereg_confirmation_page.dart            |  2 +-
 .../pages/prereg_information_page.dart             |  6 ++++--
 .../lib/pregistration/preregistration_flow.dart    |  5 ++++-
 .../lib/services/adyen/stored_payment_method.dart  | 22 +++++++---------------
 9 files changed, 24 insertions(+), 35 deletions(-)

Diff

diff --git a/comwell_key_app/assets/translations/en-US.json b/comwell_key_app/assets/translations/en-US.json
index e45b82f9..ca8e96d7 100644
--- a/comwell_key_app/assets/translations/en-US.json
+++ b/comwell_key_app/assets/translations/en-US.json
@@ -93,6 +93,7 @@
"check_in_error_title": "Room not found...",
"check_in_error_subtitle": "We could not find the room. Please check in at the reception.",
"preregistration_address_title": "Address",
+ "check_in_your_digital_card_room_prefix": "Room",
"preregistration_address_subtitle": "It is required by law to know your address",
"preregistration_address_label_address": "Address",
"preregistration_address_label_postal_code": "Postal code",
diff --git a/comwell_key_app/lib/.generated/services/adyen/stored_payment_method.g.dart b/comwell_key_app/lib/.generated/services/adyen/stored_payment_method.g.dart
index 254bb574..589d22a1 100644
--- a/comwell_key_app/lib/.generated/services/adyen/stored_payment_method.g.dart
+++ b/comwell_key_app/lib/.generated/services/adyen/stored_payment_method.g.dart
@@ -8,33 +8,21 @@ part of '../../../services/adyen/stored_payment_method.dart';
StoredPaymentMethod _$StoredPaymentMethodFromJson(Map<String, dynamic> json) =>
StoredPaymentMethod(
- brand: json['brand'] as String,
expiryMonth: json['expiryMonth'] as String,
expiryYear: json['expiryYear'] as String,
holderName: json['holderName'] as String,
id: json['id'] as String,
lastFour: json['lastFour'] as String,
- name: json['name'] as String,
- shopperEmail: json['shopperEmail'] as String,
- supportedRecurringProcessingModels:
- (json['supportedRecurringProcessingModels'] as List<dynamic>)
- .map((e) => e as String)
- .toList(),
type: json['type'] as String,
);
Map<String, dynamic> _$StoredPaymentMethodToJson(
StoredPaymentMethod instance) =>
<String, dynamic>{
- 'brand': instance.brand,
'expiryMonth': instance.expiryMonth,
'expiryYear': instance.expiryYear,
'holderName': instance.holderName,
'id': instance.id,
'lastFour': instance.lastFour,
- 'name': instance.name,
- 'shopperEmail': instance.shopperEmail,
- 'supportedRecurringProcessingModels':
- instance.supportedRecurringProcessingModels,
'type': instance.type,
};
diff --git a/comwell_key_app/lib/check_in/check_in_page.dart b/comwell_key_app/lib/check_in/check_in_page.dart
index f7b4a593..c24d51d9 100644
--- a/comwell_key_app/lib/check_in/check_in_page.dart
+++ b/comwell_key_app/lib/check_in/check_in_page.dart
@@ -5,6 +5,7 @@ import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/flutter_svg.dart';
+import 'package:go_router/go_router.dart';
import 'package:lottie/lottie.dart';
class CheckInPage extends StatefulWidget {
@@ -213,7 +214,9 @@ class _CheckInPageState extends State<CheckInPage>
child: Padding(
padding: const EdgeInsets.all(16.0),
child: ElevatedButton(
- onPressed: () {},
+ onPressed: () {
+ context.pop();
+ },
style: const ButtonStyle(
backgroundColor:
WidgetStatePropertyAll(
@@ -224,7 +227,7 @@ class _CheckInPageState extends State<CheckInPage>
child: const Padding(
padding: EdgeInsets.symmetric(
vertical: 16.0),
- child: Text("Done"),
+ child: Text("Færdig"),
)),
),
),
diff --git a/comwell_key_app/lib/pregistration/components/add_card.dart b/comwell_key_app/lib/pregistration/components/add_card.dart
index 64b8e873..994f9499 100644
--- a/comwell_key_app/lib/pregistration/components/add_card.dart
+++ b/comwell_key_app/lib/pregistration/components/add_card.dart
@@ -29,7 +29,7 @@ class AddCard extends StatelessWidget {
return InkWell(
onTap: () async {
try {
- await showModalBottomSheet(
+ await showModalBottomSheet(
isDismissible: false,
isScrollControlled: true,
context: context,
diff --git a/comwell_key_app/lib/pregistration/components/card_item.dart b/comwell_key_app/lib/pregistration/components/card_item.dart
index a5bb8cdc..2eab51e4 100644
--- a/comwell_key_app/lib/pregistration/components/card_item.dart
+++ b/comwell_key_app/lib/pregistration/components/card_item.dart
@@ -36,7 +36,7 @@ class CardItem extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
- paymentMethod.name,
+ paymentMethod.holderName,
style: Theme.of(context).textTheme.bodySmall,
),
Text(
diff --git a/comwell_key_app/lib/pregistration/pages/prereg_confirmation_page.dart b/comwell_key_app/lib/pregistration/pages/prereg_confirmation_page.dart
index f454a9d3..a9ab9e58 100644
--- a/comwell_key_app/lib/pregistration/pages/prereg_confirmation_page.dart
+++ b/comwell_key_app/lib/pregistration/pages/prereg_confirmation_page.dart
@@ -102,7 +102,7 @@ class PreregConfirmationPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
- "${state.selectedPaymentMethod?.name}",
+ "${state.selectedPaymentMethod?.holderName}",
style: Theme
.of(context)
.textTheme
diff --git a/comwell_key_app/lib/pregistration/pages/prereg_information_page.dart b/comwell_key_app/lib/pregistration/pages/prereg_information_page.dart
index 8ad06356..3f9c18cd 100644
--- a/comwell_key_app/lib/pregistration/pages/prereg_information_page.dart
+++ b/comwell_key_app/lib/pregistration/pages/prereg_information_page.dart
@@ -35,8 +35,8 @@ class PreregInformationPage extends StatelessWidget {
!cubit.isCountryValid && state.missingInformation
? "generic_information_required".tr()
: null;
- return Column(
- crossAxisAlignment: CrossAxisAlignment.start,
+ return ListView(
+ key: const PageStorageKey("information_form"),
children: [
const SizedBox(height: 40),
Text("preregistration_address_title".tr(),
@@ -46,6 +46,7 @@ class PreregInformationPage extends StatelessWidget {
style: Theme.of(context).textTheme.bodySmall),
const SizedBox(height: 40),
ComwellTextField(
+ key: const Key("address"),
fieldName: "preregistration_address_label_address".tr(),
initialValue: "",
readOnly: false,
@@ -73,6 +74,7 @@ class PreregInformationPage extends StatelessWidget {
errorMessage: countryErrorMessage,
readOnly: false,
controller: cubit.countryTextController),
+ const SizedBox(height: 100),
],
);
}
diff --git a/comwell_key_app/lib/pregistration/preregistration_flow.dart b/comwell_key_app/lib/pregistration/preregistration_flow.dart
index 1cfa01df..27a5a446 100644
--- a/comwell_key_app/lib/pregistration/preregistration_flow.dart
+++ b/comwell_key_app/lib/pregistration/preregistration_flow.dart
@@ -6,6 +6,7 @@ import 'package:comwell_key_app/pregistration/pages/prereg_payment_page.dart';
import 'package:comwell_key_app/themes/dark_theme.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:go_router/go_router.dart';
enum PreregistrationPage {
information,
@@ -57,7 +58,9 @@ class _PreregistrationFlowState extends State<PreregistrationFlow> {
leading: BackButton(
color: Colors.black,
onPressed: () {
- cubit.onBackClicked();
+ if(!cubit.onBackClicked()){
+ context.pop();
+ }
},
),
),
diff --git a/comwell_key_app/lib/services/adyen/stored_payment_method.dart b/comwell_key_app/lib/services/adyen/stored_payment_method.dart
index 34bb8e9b..33174ed2 100644
--- a/comwell_key_app/lib/services/adyen/stored_payment_method.dart
+++ b/comwell_key_app/lib/services/adyen/stored_payment_method.dart
@@ -6,27 +6,19 @@ part '../../.generated/services/adyen/stored_payment_method.g.dart';
@JsonSerializable()
class StoredPaymentMethod extends Equatable {
- String brand;
- String expiryMonth;
- String expiryYear;
- String holderName;
- String id;
- String lastFour;
- String name;
- String shopperEmail;
- List<String> supportedRecurringProcessingModels;
- String type;
+ final String expiryMonth;
+ final String expiryYear;
+ final String holderName;
+ final String id;
+ final String lastFour;
+ final String type;
- StoredPaymentMethod({
- required this.brand,
+ const StoredPaymentMethod({
required this.expiryMonth,
required this.expiryYear,
required this.holderName,
required this.id,
required this.lastFour,
- required this.name,
- required this.shopperEmail,
- required this.supportedRecurringProcessingModels,
required this.type,
});