6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 9b9e6a40

AuthorNKL<nikolaj.king@gmail.com>
Date2025-01-28 09:35:12 +0100
push to branch for delivery

Changed files

comwell_key_app/ios/Pods/Pods.xcodeproj/project.pbxproj     | 12 ++++++------
 comwell_key_app/lib/comwell_app.dart                        |  8 ++++++++
 comwell_key_app/lib/home/home_page.dart                     | 13 +++++++++----
 .../lib/hotel_information/hotel_information_page.dart       |  5 ++---
 .../lib/hotel_information/models/facilities.dart            |  4 ++++
 comwell_key_app/lib/hotel_information/models/hotel.dart     |  6 +++++-
 .../lib/hotel_information/models/parking_info.dart          |  3 +++
 .../lib/hotel_information/models/restaurant.dart            |  4 ++++
 comwell_key_app/lib/hotel_information/models/spa.dart       |  4 ++++
 comwell_key_app/lib/routing/app_router.dart                 |  9 ++++++++-
 comwell_key_app/lib/routing/app_routes.dart                 |  1 +
 comwell_key_app/lib/utils/locator.dart                      |  3 +++
 12 files changed, 57 insertions(+), 15 deletions(-)

Diff

diff --git a/comwell_key_app/ios/Pods/Pods.xcodeproj/project.pbxproj b/comwell_key_app/ios/Pods/Pods.xcodeproj/project.pbxproj
index 37388054..32cccb07 100644
--- a/comwell_key_app/ios/Pods/Pods.xcodeproj/project.pbxproj
+++ b/comwell_key_app/ios/Pods/Pods.xcodeproj/project.pbxproj
@@ -498,8 +498,8 @@
607CCDB9D70C5704921615D64D7CC9E3 /* DelegatedAuthenticationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 75C8B64BAB955CF805B16F7529B24EC5 /* DelegatedAuthenticationView.swift */; };
608F616E729E7EF85AA543B3C03560D4 /* StorePaymentMethodFieldAware.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7182CCDB9A25231B8E22F28A0B5A81F9 /* StorePaymentMethodFieldAware.swift */; };
609ED78F48F6723D762A2C3729C9CE20 /* ActionComponentData.swift in Sources */ = {isa = PBXBuildFile; fileRef = F4DEFDC20CE0A0894F0D3958279E20CA /* ActionComponentData.swift */; };
- 60F6257A2D43B88100611249 /* SeosMobileKeysSDK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 60F625792D43B88100611249 /* SeosMobileKeysSDK.xcframework */; };
- 60F6257D2D43B88B00611249 /* SeosMobileKeysSDK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 60F625792D43B88100611249 /* SeosMobileKeysSDK.xcframework */; };
+ 60F625812D43C65A00611249 /* SeosMobileKeysSDK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 60F625802D43C65A00611249 /* SeosMobileKeysSDK.xcframework */; };
+ 60F625842D43C66300611249 /* SeosMobileKeysSDK.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 60F625802D43C65A00611249 /* SeosMobileKeysSDK.xcframework */; };
615CE18AA9C42286624E3D4BD0B19B74 /* DateValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C675377EEB1EFD28BC2C2CB183AA5376 /* DateValidator.swift */; };
615DC04DEF01B945F67890ADEEE83634 /* FIRInstallationsIIDTokenStore.h in Headers */ = {isa = PBXBuildFile; fileRef = DDE0CE14A97FE53EEAFF4D75F8D6280B /* FIRInstallationsIIDTokenStore.h */; settings = {ATTRIBUTES = (Project, ); }; };
616AB49526C4CCB0C0EF77317D3DB122 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = DFB2CC743E09ED4832DF29CC5667AADC /* PrivacyInfo.xcprivacy */; };
@@ -2398,7 +2398,7 @@
60D400D1CD47378118CD6C14818F9051 /* nanopb.modulemap */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.module; path = nanopb.modulemap; sourceTree = "<group>"; };
60E94424B2CD061CCAA45C57B9DFD88B /* SelectableFormItemStyle.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SelectableFormItemStyle.swift; path = Adyen/UI/Form/Items/SelectableFormItem/SelectableFormItemStyle.swift; sourceTree = "<group>"; };
60F0417D7D51133998750125ACD12B4D /* messages.g.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = messages.g.swift; path = "../../../../../../../../../../../../.pub-cache/hosted/pub.dev/path_provider_foundation-2.4.0/darwin/path_provider_foundation/Sources/path_provider_foundation/messages.g.swift"; sourceTree = "<group>"; };
- 60F625792D43B88100611249 /* SeosMobileKeysSDK.xcframework */ = {isa = PBXFileReference; expectedSignature = "AppleDeveloperProgram:333BNLD22V:ASSAABLOY AB"; lastKnownFileType = wrapper.xcframework; name = SeosMobileKeysSDK.xcframework; path = "/Users/nkl/Documents/GitHub/comwell-app/comwell_key_app/ios/../../mobilekeys_sdk_plugin/XCFrameworks/SeosMobileKeysSDK.xcframework"; sourceTree = "<absolute>"; };
+ 60F625802D43C65A00611249 /* SeosMobileKeysSDK.xcframework */ = {isa = PBXFileReference; expectedSignature = "AppleDeveloperProgram:333BNLD22V:ASSAABLOY AB"; lastKnownFileType = wrapper.xcframework; name = SeosMobileKeysSDK.xcframework; path = "/Users/nkl/Documents/GitHub/comwell-app/comwell_key_app/ios/../../mobilekeys_sdk_plugin/XCFrameworks/SeosMobileKeysSDK.xcframework"; sourceTree = "<absolute>"; };
614A7A44E3F83816A568862E6CD5C84F /* messages.g.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = messages.g.swift; path = "../../../../../../../../../../../../.pub-cache/hosted/pub.dev/url_launcher_ios-6.3.2/ios/url_launcher_ios/Sources/url_launcher_ios/messages.g.swift"; sourceTree = "<group>"; };
618A447E2A4DCAF99F61964E9847170E /* JSONModel.h */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.c.h; name = JSONModel.h; path = JSONModel/JSONModel/JSONModel.h; sourceTree = "<group>"; };
61D24602E1314FA474504F8105A55646 /* SimpleScheduler.swift */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = sourcecode.swift; name = SimpleScheduler.swift; path = AdyenNetworking/APIClient/SimpleScheduler.swift; sourceTree = "<group>"; };
@@ -3420,7 +3420,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- 60F6257D2D43B88B00611249 /* SeosMobileKeysSDK.xcframework in Frameworks */,
+ 60F625812D43C65A00611249 /* SeosMobileKeysSDK.xcframework in Frameworks */,
1BA7E7CDE434910A21FD7A43B83763AD /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -3499,7 +3499,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
- 60F6257A2D43B88100611249 /* SeosMobileKeysSDK.xcframework in Frameworks */,
+ 60F625842D43C66300611249 /* SeosMobileKeysSDK.xcframework in Frameworks */,
383D2E4656BA62C3BE398594EB9D5D0D /* Foundation.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -7491,7 +7491,7 @@
B94D7768568A9992200DB461E8CF687F /* Frameworks */ = {
isa = PBXGroup;
children = (
- 60F625792D43B88100611249 /* SeosMobileKeysSDK.xcframework */,
+ 60F625802D43C65A00611249 /* SeosMobileKeysSDK.xcframework */,
68D0E262FF83215AD89592F4FDBDE96C /* iOS */,
);
name = Frameworks;
diff --git a/comwell_key_app/lib/comwell_app.dart b/comwell_key_app/lib/comwell_app.dart
index 1b7ac184..bf31fc53 100644
--- a/comwell_key_app/lib/comwell_app.dart
+++ b/comwell_key_app/lib/comwell_app.dart
@@ -2,6 +2,9 @@ import 'package:comwell_key_app/authentication/authentication_repository.dart';
import 'package:comwell_key_app/authentication/bloc/authentication_bloc.dart';
import 'package:comwell_key_app/home/bloc/home_bloc.dart';
import 'package:comwell_key_app/home/home_repository.dart';
+import 'package:comwell_key_app/hotel_information/cubit/hotel_information_cubit.dart';
+import 'package:comwell_key_app/hotel_information/models/hotel.dart';
+import 'package:comwell_key_app/hotel_information/repository/hotel_information_repostiory.dart';
import 'package:comwell_key_app/key/bloc/key_bloc.dart';
import 'package:comwell_key_app/key/repository/key_repository.dart';
import 'package:comwell_key_app/overview/cubit/overview_cubit.dart';
@@ -74,4 +77,9 @@ final List<BlocProvider> blocProviderList = [
profileSettingsRepository: locator<ProfileSettingsRepository>(),
authenticationRepository: locator<AuthenticationRepository>()),
),
+ BlocProvider<HotelInformationCubit>(
+ lazy: false,
+ create: (BuildContext context) =>
+ HotelInformationCubit(hotelInformationRepository: locator<HotelInformationRepository>()),
+ ),
];
diff --git a/comwell_key_app/lib/home/home_page.dart b/comwell_key_app/lib/home/home_page.dart
index 4524c945..4429eb87 100644
--- a/comwell_key_app/lib/home/home_page.dart
+++ b/comwell_key_app/lib/home/home_page.dart
@@ -70,9 +70,14 @@ class _HomeWidget extends State<HomeWidget> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Spacer(),
- RoomKeyWidget(onPressed: () {
- context.pushNamed(AppRoutes.contact.name);
- }),
+ Row(mainAxisAlignment: MainAxisAlignment.center, children: [
+ RoomKeyWidget(onPressed: () {
+ context.pushNamed(AppRoutes.hotelInformation.name);
+ }),
+ RoomKeyWidget(onPressed: () {
+ context.pushNamed(AppRoutes.contact.name);
+ }),
+ ]),
if (state.status == HomeStatus.invalidOrNoKey)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
@@ -84,7 +89,7 @@ class _HomeWidget extends State<HomeWidget> {
},
child: const Text('Get Key')),
),
- if(state.status == HomeStatus.validKey ||
+ if (state.status == HomeStatus.validKey ||
state.status == HomeStatus.multipleKeys)
Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
diff --git a/comwell_key_app/lib/hotel_information/hotel_information_page.dart b/comwell_key_app/lib/hotel_information/hotel_information_page.dart
index 1a34ec0b..09b12284 100644
--- a/comwell_key_app/lib/hotel_information/hotel_information_page.dart
+++ b/comwell_key_app/lib/hotel_information/hotel_information_page.dart
@@ -1,11 +1,9 @@
import 'package:comwell_key_app/common/components/comwell_app_bar.dart';
import 'package:comwell_key_app/hotel_information/components/hotel_information_list_tile.dart';
import 'package:comwell_key_app/hotel_information/cubit/hotel_information_cubit.dart';
-import 'package:comwell_key_app/themes/light_theme.dart';
-import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
-import 'package:flutter_svg/svg.dart';
+
class HotelInformationPage extends StatelessWidget {
const HotelInformationPage({super.key});
@@ -13,6 +11,7 @@ class HotelInformationPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
final height = MediaQuery.of(context).size.height;
+ context.read<HotelInformationCubit>().fetchHotelInformation();
return BlocBuilder<HotelInformationCubit, HotelInformationState>(
builder: (context, state) {
if (state is HotelInformationLoading || state is HotelInformationInitial) {
diff --git a/comwell_key_app/lib/hotel_information/models/facilities.dart b/comwell_key_app/lib/hotel_information/models/facilities.dart
index 0d902d8b..cf750860 100644
--- a/comwell_key_app/lib/hotel_information/models/facilities.dart
+++ b/comwell_key_app/lib/hotel_information/models/facilities.dart
@@ -1,6 +1,7 @@
import 'package:comwell_key_app/hotel_information/models/parking_info.dart';
import 'package:comwell_key_app/hotel_information/models/restaurant.dart';
import 'package:comwell_key_app/hotel_information/models/spa.dart';
+import 'package:comwell_key_app/utils/json.dart';
import 'package:json_annotation/json_annotation.dart';
part '../../.generated/hotel_information/models/facilities.g.dart';
@@ -16,4 +17,7 @@ class Facilities {
required this.spas,
required this.parking
});
+
+ Json toJson() => _$FacilitiesToJson(this);
+ factory Facilities.fromJson(Map<String, dynamic> json) => _$FacilitiesFromJson(json);
}
diff --git a/comwell_key_app/lib/hotel_information/models/hotel.dart b/comwell_key_app/lib/hotel_information/models/hotel.dart
index 35e6b796..555f2e1e 100644
--- a/comwell_key_app/lib/hotel_information/models/hotel.dart
+++ b/comwell_key_app/lib/hotel_information/models/hotel.dart
@@ -1,4 +1,5 @@
import 'package:comwell_key_app/hotel_information/models/facilities.dart';
+import 'package:comwell_key_app/utils/json.dart';
import 'package:json_annotation/json_annotation.dart';
part '../../.generated/hotel_information/models/hotel.g.dart';
@@ -14,6 +15,8 @@ class Hotel {
final String image;
final Facilities facilities;
+
+
Hotel({
required this.id,
required this.name,
@@ -25,5 +28,6 @@ class Hotel {
required this.facilities
});
- //Json toJson() => _$HotelToJson(this);
+factory Hotel.fromJson(Map<String, dynamic> json) => _$HotelFromJson(json);
+ Json toJson() => _$HotelToJson(this);
}
diff --git a/comwell_key_app/lib/hotel_information/models/parking_info.dart b/comwell_key_app/lib/hotel_information/models/parking_info.dart
index d5006c90..0e6ecd3d 100644
--- a/comwell_key_app/lib/hotel_information/models/parking_info.dart
+++ b/comwell_key_app/lib/hotel_information/models/parking_info.dart
@@ -1,4 +1,5 @@
+import 'package:comwell_key_app/utils/json.dart';
import 'package:json_annotation/json_annotation.dart';
part '../../.generated/hotel_information/models/parking_info.g.dart';
@@ -19,4 +20,6 @@ class ParkingInfo {
required this.electricChargingDescription
});
+ Json toJson() => _$ParkingInfoToJson(this);
+ factory ParkingInfo.fromJson(Map<String, dynamic> json) => _$ParkingInfoFromJson(json);
}
diff --git a/comwell_key_app/lib/hotel_information/models/restaurant.dart b/comwell_key_app/lib/hotel_information/models/restaurant.dart
index c23a699d..93a4d368 100644
--- a/comwell_key_app/lib/hotel_information/models/restaurant.dart
+++ b/comwell_key_app/lib/hotel_information/models/restaurant.dart
@@ -1,3 +1,4 @@
+import 'package:comwell_key_app/utils/json.dart';
import 'package:json_annotation/json_annotation.dart';
part '../../.generated/hotel_information/models/restaurant.g.dart';
@@ -21,4 +22,7 @@ class Restaurant {
required this.phoneNumber,
required this.email
});
+
+ Json toJson() => _$RestaurantToJson(this);
+ factory Restaurant.fromJson(Map<String, dynamic> json) => _$RestaurantFromJson(json);
}
\ No newline at end of file
diff --git a/comwell_key_app/lib/hotel_information/models/spa.dart b/comwell_key_app/lib/hotel_information/models/spa.dart
index 12f67f8d..4306f6d1 100644
--- a/comwell_key_app/lib/hotel_information/models/spa.dart
+++ b/comwell_key_app/lib/hotel_information/models/spa.dart
@@ -1,3 +1,4 @@
+import 'package:comwell_key_app/utils/json.dart';
import 'package:json_annotation/json_annotation.dart';
part '../../.generated/hotel_information/models/spa.g.dart';
@@ -13,4 +14,7 @@ class Spa {
required this.description,
required this.image
});
+
+ Json toJson() => _$SpaToJson(this);
+ factory Spa.fromJson(Map<String, dynamic> json) => _$SpaFromJson(json);
}
diff --git a/comwell_key_app/lib/routing/app_router.dart b/comwell_key_app/lib/routing/app_router.dart
index b390cc3c..eb970cab 100644
--- a/comwell_key_app/lib/routing/app_router.dart
+++ b/comwell_key_app/lib/routing/app_router.dart
@@ -6,6 +6,7 @@ import 'package:comwell_key_app/contact/contact_page.dart';
import 'package:comwell_key_app/find_booking/find_booking_page.dart';
import 'package:comwell_key_app/find_booking/loading_page.dart';
import 'package:comwell_key_app/home/home_page.dart';
+import 'package:comwell_key_app/hotel_information/hotel_information_page.dart';
import 'package:comwell_key_app/key/key_page.dart';
import 'package:comwell_key_app/login/login_page.dart';
import 'package:comwell_key_app/overview/models/booking.dart';
@@ -58,7 +59,13 @@ GoRouter goRouter(AuthenticationBloc authBloc) {
},
routes: <RouteBase>[
GoRoute(
- path: '//${AppRoutes.contact.name}',
+ path: '/${AppRoutes.hotelInformation.name}',
+ name: AppRoutes.hotelInformation.name,
+ builder: (context, state) {
+ return const HotelInformationPage();
+ }),
+ GoRoute(
+ path: '/${AppRoutes.contact.name}',
name: AppRoutes.contact.name,
builder: (context, state) {
return const ContactPage(
diff --git a/comwell_key_app/lib/routing/app_routes.dart b/comwell_key_app/lib/routing/app_routes.dart
index 47ad22c4..f5986d43 100644
--- a/comwell_key_app/lib/routing/app_routes.dart
+++ b/comwell_key_app/lib/routing/app_routes.dart
@@ -18,4 +18,5 @@ enum AppRoutes {
checkIn,
contact,
preregistration,
+ hotelInformation
}
diff --git a/comwell_key_app/lib/utils/locator.dart b/comwell_key_app/lib/utils/locator.dart
index 83886e1c..d8a56153 100644
--- a/comwell_key_app/lib/utils/locator.dart
+++ b/comwell_key_app/lib/utils/locator.dart
@@ -1,6 +1,8 @@
import 'package:comwell_key_app/authentication/authentication_repository.dart';
import 'package:comwell_key_app/database/comwell_db.dart';
import 'package:comwell_key_app/home/home_repository.dart';
+import 'package:comwell_key_app/hotel_information/cubit/hotel_information_cubit.dart';
+import 'package:comwell_key_app/hotel_information/repository/hotel_information_repostiory.dart';
import 'package:comwell_key_app/key/repository/key_repository.dart';
import 'package:comwell_key_app/overview/repository/overview_repository.dart';
import 'package:comwell_key_app/pregistration/pregistration_repository.dart';
@@ -33,6 +35,7 @@ void setupLocator() {
() => PreregistrationRepository());
locator.registerSingleton<ComwellTracking>(ComwellTracking());
locator.registerSingleton<ComwellDatabase>(ComwellDatabase());
+ locator.registerFactory<HotelInformationRepository>(() => HotelInformationRepository());
}
}