6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 14ed9cf7
Changed files
.gitignore | 1 + comwell_key_app/.env.example | 0 comwell_key_app/android/app/build.gradle | 3 + comwell_key_app/android/key.properties.template | 8 ++ comwell_key_app/ios/Podfile | 7 +- .../choose_share_room_repository.dart | 2 +- .../components/share_room_confirm_dialog.dart | 5 +- .../choose_share_room_shimmer_loader.dart | 3 +- .../lib/force_update/force_update_page.dart | 121 +++++++++++---------- .../lib/hotel_information/components/email.dart | 3 +- .../components/hotel_bottom_sheet_button.dart | 2 +- .../components/structured_text.dart | 121 +++++++++++---------- .../lib/login/components/create_user_button.dart | 8 +- .../lib/my_booking/my_booking_repository.dart | 2 - .../lib/profile/profile_repository.dart | 9 +- .../components/date_time_picker.dart | 11 +- .../lib/routing/go_router_observer.dart | 39 +++++-- comwell_key_app/lib/services/api.dart | 24 ++-- .../interceptors/response_handle_interceptor.dart | 3 +- .../lib/services/utils/api_endpoints.dart | 33 ++++-- comwell_key_app/lib/themes/dark_theme.dart | 4 +- .../components/catalog/other_upgrade_catalog.dart | 34 +++--- .../components/catalog/room_uprade_catalog.dart | 41 ++++--- .../components/catalog/service_catalog.dart | 4 +- .../up_sales/components/comwell_radio_button.dart | 2 +- .../components/facilities_bottom_sheet.dart | 13 ++- .../components/up_sales_services_widget.dart | 2 +- .../components/up_sales_upgrades_widget.dart | 2 +- .../lib/up_sales/cubit/up_sales_cubit.dart | 2 +- comwell_key_app/lib/utils/launch_util.dart | 27 +++-- .../booking_details_repository_test.dart | 7 +- .../seos_mobile_keys_plugin/AppUsage.kt | 102 ----------------- 32 files changed, 306 insertions(+), 339 deletions(-)
Diff
diff --git a/.gitignore b/.gitignore
index 879c94b1..0c3fdfe9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
comwell_key_app/.env.releasetest
comwell_key_app/.env.develop
comwell_key_app/.env.dev.old
+comwell_key_app/android/key.properties.dev
diff --git a/comwell_key_app/.env.example b/comwell_key_app/.env.example
new file mode 100644
index 00000000..e69de29b
diff --git a/comwell_key_app/android/app/build.gradle b/comwell_key_app/android/app/build.gradle
index 2c689b19..978062dd 100644
--- a/comwell_key_app/android/app/build.gradle
+++ b/comwell_key_app/android/app/build.gradle
@@ -71,6 +71,9 @@ android {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
}
+ debug {
+
+ }
}
buildTypes {
release {
diff --git a/comwell_key_app/android/key.properties.template b/comwell_key_app/android/key.properties.template
new file mode 100644
index 00000000..e8bbf344
--- /dev/null
+++ b/comwell_key_app/android/key.properties.template
@@ -0,0 +1,8 @@
+# Template for production keystore configuration
+# Copy this file to key.properties and fill in your production values
+# NEVER commit the actual key.properties file to version control
+
+storePassword=YOUR_STORE_PASSWORD
+keyPassword=YOUR_KEY_PASSWORD
+keyAlias=YOUR_KEY_ALIAS
+storeFile=YOUR_KEYSTORE_FILE_PATH
\ No newline at end of file
diff --git a/comwell_key_app/ios/Podfile b/comwell_key_app/ios/Podfile
index e0053074..1e170d1d 100644
--- a/comwell_key_app/ios/Podfile
+++ b/comwell_key_app/ios/Podfile
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
-# platform :ios, '12.0'
+platform :ios, '12.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
@@ -42,6 +42,11 @@ end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
+
+ # Set minimum iOS deployment target to 12.0 for all pods
+ target.build_configurations.each do |config|
+ config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
+ end
# Workaround to get SQLCipher to work on release config
# https://github.com/simolus3/drift/issues/1810#issuecomment-1119426006
diff --git a/comwell_key_app/lib/choose_share_room/choose_share_room_repository.dart b/comwell_key_app/lib/choose_share_room/choose_share_room_repository.dart
index 4b3df905..fc6974a9 100644
--- a/comwell_key_app/lib/choose_share_room/choose_share_room_repository.dart
+++ b/comwell_key_app/lib/choose_share_room/choose_share_room_repository.dart
@@ -13,7 +13,7 @@ class ChooseShareRoomRepository {
}
Future<Room> assignRoom(String roomId, String userId) async {
- await Future.delayed(const Duration(seconds: 2));
+ await Future<void>.delayed(const Duration(seconds: 2));
final room =
mockRooms.firstWhere((room) => room.confirmationNumber == roomId);
room.assignedTo = userId;
diff --git a/comwell_key_app/lib/choose_share_room/components/share_room_confirm_dialog.dart b/comwell_key_app/lib/choose_share_room/components/share_room_confirm_dialog.dart
index f8416c34..7a30052d 100644
--- a/comwell_key_app/lib/choose_share_room/components/share_room_confirm_dialog.dart
+++ b/comwell_key_app/lib/choose_share_room/components/share_room_confirm_dialog.dart
@@ -1,13 +1,10 @@
-import 'package:comwell_key_app/choose_share_room/cubit/choose_share_room_cubit.dart';
-import 'package:comwell_key_app/overview/models/booking.dart';
import 'package:comwell_key_app/themes/light_theme.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:easy_localization/easy_localization.dart';
class ShareRoomConfirmDialog extends StatelessWidget {
-
- const ShareRoomConfirmDialog({super.key});
+ const ShareRoomConfirmDialog({super.key});
@override
Widget build(BuildContext context) {
diff --git a/comwell_key_app/lib/common/components/shimmer_loader/choose_share_room_shimmer_loader.dart b/comwell_key_app/lib/common/components/shimmer_loader/choose_share_room_shimmer_loader.dart
index a3a3dcca..dab80819 100644
--- a/comwell_key_app/lib/common/components/shimmer_loader/choose_share_room_shimmer_loader.dart
+++ b/comwell_key_app/lib/common/components/shimmer_loader/choose_share_room_shimmer_loader.dart
@@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
import 'package:shimmer/shimmer.dart';
import 'package:comwell_key_app/themes/light_theme.dart';
import 'package:comwell_key_app/common/components/shimmer_loader/placeholders/title_placeholder.dart';
-import 'package:comwell_key_app/common/components/shimmer_loader/placeholders/content_placeholder.dart';
class ChooseShareRoomShimmerLoader extends StatelessWidget {
const ChooseShareRoomShimmerLoader({super.key});
@@ -27,4 +26,4 @@ class ChooseShareRoomShimmerLoader extends StatelessWidget {
),
);
}
-}
\ No newline at end of file
+}
diff --git a/comwell_key_app/lib/force_update/force_update_page.dart b/comwell_key_app/lib/force_update/force_update_page.dart
index 7c4ad3d2..78fa6060 100644
--- a/comwell_key_app/lib/force_update/force_update_page.dart
+++ b/comwell_key_app/lib/force_update/force_update_page.dart
@@ -4,7 +4,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'dart:io' show Platform;
-
class ForceUpdatePage extends StatelessWidget {
const ForceUpdatePage({super.key});
@@ -23,74 +22,82 @@ class ForceUpdatePage extends StatelessWidget {
},
builder: (context, state) {
return Scaffold(
+ extendBody: true,
+ extendBodyBehindAppBar: true,
body: Container(
constraints: const BoxConstraints.expand(),
decoration: const BoxDecoration(
image: DecorationImage(
- image: AssetImage('assets/images/login_screen_background.png'),
+ image:
+ AssetImage('assets/images/login_screen_background.png'),
fit: BoxFit.cover,
),
),
child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- // Logo
- Expanded(
- flex: 3,
- child: Image.asset('assets/images/Logo.png',
- width: 175, height: 50),
- ),
- const SizedBox(height: 32),
- // Force Update Message
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 40.0),
- child: Column(
- children: [
- Text(
- 'force_update_title'.tr(),
- textAlign: TextAlign.center,
- style: textTheme.headlineMedium?.copyWith(color: Colors.white),
- ),
- const SizedBox(height: 8),
- Text(
- 'force_update_description'.tr(),
- textAlign: TextAlign.center,
- style: textTheme.bodySmall?.copyWith(color: Colors.white.withValues(alpha: 0.65)),
- ),
- ],
- ),
- ),
- const SizedBox(height: 36),
- // Update Button
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 32.0),
- child: ElevatedButton(
- style: ElevatedButton.styleFrom(
- backgroundColor: Colors.white,
- textStyle: textTheme.headlineSmall?.copyWith(color: Colors.black),
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ // Logo
+ Expanded(
+ flex: 3,
+ child: Image.asset('assets/images/Logo.png',
+ width: 175, height: 50),
+ ),
+ const SizedBox(height: 32),
+ // Force Update Message
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 40.0),
+ child: Column(
+ children: [
+ Text(
+ 'force_update_title'.tr(),
+ textAlign: TextAlign.center,
+ style: textTheme.headlineMedium
+ ?.copyWith(color: Colors.white),
),
- onPressed: state.isLoading
- ? null
- : () {
- if (Platform.isAndroid) {
- context.read<ForceUpdateCubit>().startAndroidUpdate();
- } else if (Platform.isIOS) {
- context.read<ForceUpdateCubit>().openAppStore();
- }
- },
- child: state.isLoading
- ? const SizedBox(
- width: 24,
- height: 24,
- child: CircularProgressIndicator(strokeWidth: 2),
- )
- : Text('force_update_button'.tr()),
+ const SizedBox(height: 8),
+ Text(
+ 'force_update_description'.tr(),
+ textAlign: TextAlign.center,
+ style: textTheme.bodySmall?.copyWith(
+ color: Colors.white.withValues(alpha: 0.65)),
+ ),
+ ],
+ ),
+ ),
+ const SizedBox(height: 36),
+ // Update Button
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 32.0),
+ child: ElevatedButton(
+ style: ElevatedButton.styleFrom(
+ backgroundColor: Colors.white,
+ textStyle: textTheme.headlineSmall
+ ?.copyWith(color: Colors.black),
),
+ onPressed: state.isLoading
+ ? null
+ : () {
+ if (Platform.isAndroid) {
+ context
+ .read<ForceUpdateCubit>()
+ .startAndroidUpdate();
+ } else if (Platform.isIOS) {
+ context.read<ForceUpdateCubit>().openAppStore();
+ }
+ },
+ child: state.isLoading
+ ? const SizedBox(
+ width: 24,
+ height: 24,
+ child: CircularProgressIndicator(strokeWidth: 2),
+ )
+ : Text('force_update_button'.tr()),
),
- const SizedBox(height: 60),
- ],
- ),
+ ),
+ SizedBox(height: 60 + MediaQuery.of(context).padding.bottom),
+ ],
),
+ ),
);
},
),
diff --git a/comwell_key_app/lib/hotel_information/components/email.dart b/comwell_key_app/lib/hotel_information/components/email.dart
index 1631afa0..fc6397da 100644
--- a/comwell_key_app/lib/hotel_information/components/email.dart
+++ b/comwell_key_app/lib/hotel_information/components/email.dart
@@ -1,7 +1,6 @@
import 'package:comwell_key_app/hotel_information/components/contact_hotel_button.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
-import 'package:url_launcher/url_launcher.dart';
import 'package:comwell_key_app/utils/launch_util.dart';
class Email extends StatelessWidget {
@@ -19,4 +18,4 @@ class Email extends StatelessWidget {
},
);
}
-}
\ No newline at end of file
+}
diff --git a/comwell_key_app/lib/hotel_information/components/hotel_bottom_sheet_button.dart b/comwell_key_app/lib/hotel_information/components/hotel_bottom_sheet_button.dart
index 46554bd0..6e4953a9 100644
--- a/comwell_key_app/lib/hotel_information/components/hotel_bottom_sheet_button.dart
+++ b/comwell_key_app/lib/hotel_information/components/hotel_bottom_sheet_button.dart
@@ -4,7 +4,7 @@ import 'package:flutter/material.dart';
class HotelBottomSheetButton extends StatelessWidget {
final bool isLoading;
- final Function() onPressed;
+ final VoidCallback onPressed;
const HotelBottomSheetButton(
{super.key, required this.isLoading, required this.onPressed});
diff --git a/comwell_key_app/lib/hotel_information/components/structured_text.dart b/comwell_key_app/lib/hotel_information/components/structured_text.dart
index aa28690c..a97821d1 100644
--- a/comwell_key_app/lib/hotel_information/components/structured_text.dart
+++ b/comwell_key_app/lib/hotel_information/components/structured_text.dart
@@ -5,7 +5,6 @@ import 'package:comwell_key_app/hotel_information/components/contact_hotel_butto
import 'package:comwell_key_app/themes/dark_theme.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
-import 'package:url_launcher/url_launcher.dart';
import 'package:comwell_key_app/hotel_information/components/image_widget.dart';
import 'package:comwell_key_app/hotel_information/components/spa_booking_link.dart';
import 'package:comwell_key_app/hotel_information/components/hotel_information_list_tile.dart';
@@ -28,83 +27,87 @@ class StructuredText extends StatelessWidget {
children: blocks.map((block) {
return switch (block) {
HeaderStructuredTextModel b => Padding(
- padding: const EdgeInsets.only(bottom: 16.0),
- child: Text(
- b.header,
- style: theme.textTheme.headlineMedium,
+ padding: const EdgeInsets.only(bottom: 16.0),
+ child: Text(
+ b.header,
+ style: theme.textTheme.headlineMedium,
+ ),
),
- ),
TextModelStructuredTextModel b => Padding(
- padding: const EdgeInsets.only(bottom: 16.0),
- child: Text(
- b.text,
- style: theme.textTheme.bodySmall?.copyWith(
- color: colorHeadlineText,
+ padding: const EdgeInsets.only(bottom: 16.0),
+ child: Text(
+ b.text,
+ style: theme.textTheme.bodySmall?.copyWith(
+ color: colorHeadlineText,
+ ),
),
),
- ),
AddressStructuredTextModel b => Padding(
- padding: const EdgeInsets.only(bottom: 16.0),
- child: Address(address: b.address),
- ),
+ padding: const EdgeInsets.only(bottom: 16.0),
+ child: Address(address: b.address),
+ ),
EmailContactStructuredTextModel b => Padding(
- padding: const EdgeInsets.only(bottom: 16.0),
- child: ContactHotelButton(
- title: b.headline,
- subtitle: b.email,
- iconPath: "assets/icons/ic_send.svg",
- onClick: () async {
- await launchEmail(context, b.email, errorMessage: "email_launch_error".tr());
- },
+ padding: const EdgeInsets.only(bottom: 16.0),
+ child: ContactHotelButton(
+ title: b.headline,
+ subtitle: b.email,
+ iconPath: "assets/icons/ic_send.svg",
+ onClick: () async {
+ await launchEmail(context, b.email,
+ errorMessage: "email_launch_error".tr());
+ },
+ ),
),
- ),
PhoneContactStructuredTextModel b => Padding(
- padding: const EdgeInsets.only(bottom: 16.0),
- child: PhoneNumber(phoneNumber: b.phoneNumber),
- ),
+ padding: const EdgeInsets.only(bottom: 16.0),
+ child: PhoneNumber(phoneNumber: b.phoneNumber),
+ ),
ImageWidgetStructuredTextModel b => Padding(
- padding: const EdgeInsets.only(bottom: 16.0),
- child: ImageWidget(image: b.image),
- ),
+ padding: const EdgeInsets.only(bottom: 16.0),
+ child: ImageWidget(image: b.image),
+ ),
SpaBookingLinkStructuredTextModel b => Padding(
- padding: const EdgeInsets.only(bottom: 16.0),
- child: SpaBookingLink(link: b.link),
- ),
+ padding: const EdgeInsets.only(bottom: 16.0),
+ child: SpaBookingLink(link: b.link),
+ ),
HotelInformationListTileStructuredTextModel b => Padding(
- padding: const EdgeInsets.only(bottom: 16.0),
- child: HotelInformationListTile(
- iconPath: b.iconPath,
- title: b.title,
- onClick: () {}, // You may want to provide a callback
+ padding: const EdgeInsets.only(bottom: 16.0),
+ child: HotelInformationListTile(
+ iconPath: b.iconPath,
+ title: b.title,
+ onClick: () {}, // You may want to provide a callback
+ ),
),
- ),
MapsBottomModalStructuredTextModel b => Padding(
- padding: const EdgeInsets.only(bottom: 16.0),
- child: Builder(
- builder: (context) => ElevatedButton(
- onPressed: () => MapsBottomModal.show(context, b.address),
- child: Text(b.address),
+ padding: const EdgeInsets.only(bottom: 16.0),
+ child: Builder(
+ builder: (context) => ElevatedButton(
+ onPressed: () => MapsBottomModal.show(context, b.address),
+ child: Text(b.address),
+ ),
),
),
- ),
OpeningHoursStructuredTextModel b => Padding(
- padding: const EdgeInsets.only(bottom: 16.0),
- child: OpeningHours(openingHours: b.openingHours),
- ),
+ padding: const EdgeInsets.only(bottom: 16.0),
+ child: OpeningHours(openingHours: b.openingHours),
+ ),
PageTitleStructuredTextModel b => Padding(
- padding: const EdgeInsets.only(bottom: 16.0),
- child: PageTitle(title: b.title),
- ),
+ padding: const EdgeInsets.only(bottom: 16.0),
+ child: PageTitle(title: b.title),
+ ),
PracticalInformationStructuredTextModel b => Padding(
- padding: const EdgeInsets.only(bottom: 16.0),
- child: Text('Practical Information for Restaurant: \\${b.restaurantId}', style: theme.textTheme.bodySmall?.copyWith(
- color: colorHeadlineText,
- ),),
- ),
+ padding: const EdgeInsets.only(bottom: 16.0),
+ child: Text(
+ 'Practical Information for Restaurant: \\${b.restaurantId}',
+ style: theme.textTheme.bodySmall?.copyWith(
+ color: colorHeadlineText,
+ ),
+ ),
+ ),
EmailStructuredTextModel b => Padding(
- padding: const EdgeInsets.only(bottom: 16.0),
- child: Email(email: b.email),
- ),
+ padding: const EdgeInsets.only(bottom: 16.0),
+ child: Email(email: b.email),
+ ),
};
}).toList(),
);
diff --git a/comwell_key_app/lib/login/components/create_user_button.dart b/comwell_key_app/lib/login/components/create_user_button.dart
index 69702b55..403d91f3 100644
--- a/comwell_key_app/lib/login/components/create_user_button.dart
+++ b/comwell_key_app/lib/login/components/create_user_button.dart
@@ -21,8 +21,12 @@ class CreateUserButton extends StatelessWidget {
},
child: Text(
'create_user_button'.tr(),
- style: TextStyle(color: Theme.of(context).colorScheme.surface, fontSize: 16, fontWeight: FontWeight.w600, backgroundColor: Colors.transparents),
+ style: TextStyle(
+ color: Theme.of(context).colorScheme.surface,
+ fontSize: 16,
+ fontWeight: FontWeight.w600,
+ backgroundColor: Colors.transparent),
),
);
}
-}
\ No newline at end of file
+}
diff --git a/comwell_key_app/lib/my_booking/my_booking_repository.dart b/comwell_key_app/lib/my_booking/my_booking_repository.dart
index 64870005..898b9687 100644
--- a/comwell_key_app/lib/my_booking/my_booking_repository.dart
+++ b/comwell_key_app/lib/my_booking/my_booking_repository.dart
@@ -1,5 +1,3 @@
-
-import 'package:comwell_key_app/database/comwell_db.dart';
import 'package:comwell_key_app/profile/profile_repository.dart';
import 'package:comwell_key_app/profile_settings/model/user.dart';
import 'package:comwell_key_app/services/api.dart';
diff --git a/comwell_key_app/lib/profile/profile_repository.dart b/comwell_key_app/lib/profile/profile_repository.dart
index 515b1369..f1e42197 100644
--- a/comwell_key_app/lib/profile/profile_repository.dart
+++ b/comwell_key_app/lib/profile/profile_repository.dart
@@ -50,9 +50,10 @@ class ProfileRepository {
Future<Booking> getBookingDetails(String bookingId) async {
user = await fetchProfileSettings();
final response = await api.getBookingDetails(bookingId);
- await locator<ComwellDatabase>().bookingsDao.insertBookings(BookingsDTO(current: [response!], past: [], cancelled: []));
+ await locator<ComwellDatabase>().bookingsDao.insertBookings(
+ BookingsDTO(current: [response!], past: [], cancelled: []));
final booking = response.toBooking(user.id, BookingStatus.current, []);
-
+
return booking;
}
@@ -70,13 +71,13 @@ class ProfileRepository {
try {
await locator<ComwellDatabase>().userDAO.saveUser(userDto);
} catch (dbError) {
- debugPrint("Database error while saving user: "+dbError.toString());
+ debugPrint("Database error while saving user: $dbError");
// Continue execution even if database save fails
}
return user;
} catch (e) {
- debugPrint("Error fetching profile settings: "+e.toString());
+ debugPrint("Error fetching profile settings: $e");
rethrow;
}
}
diff --git a/comwell_key_app/lib/profile_settings/components/date_time_picker.dart b/comwell_key_app/lib/profile_settings/components/date_time_picker.dart
index 2933d93d..6bfa5fc3 100644
--- a/comwell_key_app/lib/profile_settings/components/date_time_picker.dart
+++ b/comwell_key_app/lib/profile_settings/components/date_time_picker.dart
@@ -29,7 +29,7 @@ class _DatePickerState extends State<DateTimePicker> {
final initial = widget.initialValue;
if (initial.isAfter(maxDate)) {
// Show generic dialog to user
- await showDialog(
+ await showDialog<void>(
context: context,
builder: (context) => GenericDialog(
title: 'invalid_birthday'.tr(),
@@ -49,15 +49,18 @@ class _DatePickerState extends State<DateTimePicker> {
setState(() => _selectedDate = null);
context.read<ProfileSettingsCubit>().updateBirthDate(defaultBirthday);
// Open the date picker after dialog is closed
- await Future.delayed(Duration(milliseconds: 100));
- await _showValidDatePicker(context, defaultBirthday, maxDate);
+ await Future<void>.delayed(const Duration(milliseconds: 100));
+ if (context.mounted) {
+ await _showValidDatePicker(context, defaultBirthday, maxDate);
+ }
}
return;
}
await _showValidDatePicker(context, initial, maxDate);
}
- Future<void> _showValidDatePicker(BuildContext context, DateTime initial, DateTime maxDate) async {
+ Future<void> _showValidDatePicker(
+ BuildContext context, DateTime initial, DateTime maxDate) async {
await showDatePicker(
builder: (context, child) {
final theme = Theme.of(context);
diff --git a/comwell_key_app/lib/routing/go_router_observer.dart b/comwell_key_app/lib/routing/go_router_observer.dart
index c2da6fdc..ded2214e 100644
--- a/comwell_key_app/lib/routing/go_router_observer.dart
+++ b/comwell_key_app/lib/routing/go_router_observer.dart
@@ -5,6 +5,12 @@ import 'package:flutter/services.dart';
import 'package:comwell_key_app/common/system_ui.dart';
import 'dart:io' show Platform;
+// Routes that should use edge-to-edge mode
+final Set<String> edgeToEdgeRoutes = {
+ 'forceUpdate',
+ // Add other routes that need edge-to-edge mode
+};
+
final Map<String, SystemUiOverlayStyle> routeSystemUiStyles = {
'overview': kDefaultSystemUiOverlayStyle,
// Example custom style for login page:
@@ -15,18 +21,26 @@ final Map<String, SystemUiOverlayStyle> routeSystemUiStyles = {
systemNavigationBarIconBrightness: Brightness.light,
),
// Custom style for key page:
- 'key': const SystemUiOverlayStyle(
+ 'key': const SystemUiOverlayStyle(
statusBarColor: Colors.black,
systemNavigationBarColor: Colors.black,
statusBarIconBrightness: Brightness.light,
systemNavigationBarIconBrightness: Brightness.light,
),
+ 'forceUpdate': const SystemUiOverlayStyle(
+ statusBarColor: Colors.transparent,
+ statusBarBrightness: Brightness.dark,
+ statusBarIconBrightness: Brightness.light,
+ systemStatusBarContrastEnforced: false,
+ systemNavigationBarColor: Colors.transparent,
+ systemNavigationBarDividerColor: Colors.transparent,
+ systemNavigationBarContrastEnforced: false,
+ systemNavigationBarIconBrightness: Brightness.light,
+ ),
// Add more custom styles as needed
};
class GoRouterObserver extends NavigatorObserver {
-
-
@override
void didPush(Route<dynamic> route, Route<dynamic>? previousRoute) {
debugPrint('DidPush: $route');
@@ -57,18 +71,27 @@ class GoRouterObserver extends NavigatorObserver {
void didReplace({Route<dynamic>? newRoute, Route<dynamic>? oldRoute}) {
debugPrint('DidReplace: $newRoute');
}
+
void _setSystemUiForRoute(Route<dynamic> route) {
// Only apply custom system UI styles on Android
if (!Platform.isAndroid) return;
-
+
final routeName = route.settings.name ?? '';
- final style = routeSystemUiStyles[routeName] ?? kDefaultSystemUiOverlayStyle;
+ final style =
+ routeSystemUiStyles[routeName] ?? kDefaultSystemUiOverlayStyle;
SystemChrome.setSystemUIOverlayStyle(style);
+
+ // Enable edge-to-edge mode for specific routes
+ if (edgeToEdgeRoutes.contains(routeName)) {
+ SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
+ } else {
+ // Reset to normal mode for other routes
+ SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual,
+ overlays: [SystemUiOverlay.top, SystemUiOverlay.bottom]);
+ }
}
}
-
-
String getPath(String routeName) {
switch (routeName) {
case 'overview':
@@ -105,6 +128,8 @@ String getPath(String routeName) {
return '/overview/pastCancelledBookings';
case 'profileSettings':
return '/overview/profile/profileSettings';
+ case 'forceUpdate':
+ return '/forceUpdate';
// Add more cases as needed
default:
diff --git a/comwell_key_app/lib/services/api.dart b/comwell_key_app/lib/services/api.dart
index 24ee76b9..28389234 100644
--- a/comwell_key_app/lib/services/api.dart
+++ b/comwell_key_app/lib/services/api.dart
@@ -80,7 +80,7 @@ class Api {
Future<Response<dynamic>> fetchProfileSettings() async {
final response = await dio.get<dynamic>(ApiEndpoints.getGuestProfile);
-
+
return response;
}
@@ -154,8 +154,9 @@ class Api {
Future<dynamic> getHotelInfo(String hotelCode, Locale culture) async {
final cultureString = culture.toString().replaceAll('_', '-');
- final response = await dio.get<Json>('/Content/v1/api/v1/hotel?hotelCode=$hotelCode&culture=$cultureString');
-
+ final response = await dio.get<Json>(
+ '${ApiEndpoints.getHotelInfo}x?hotelCode=$hotelCode&culture=$cultureString');
+
return response;
}
@@ -164,9 +165,9 @@ class Api {
"confirmationId": confirmationId,
};
final data = jsonEncode(body);
-
+
final response = await dio.post<Json>(ApiEndpoints.checkIn, data: data);
-
+
return response.data;
}
@@ -181,7 +182,8 @@ class Api {
"refill": housekeeping.refill,
};
final data = jsonEncode(body);
- final response = await dio.post<Json>(ApiEndpoints.orderHousekeeping, data: data);
+ final response =
+ await dio.post<Json>(ApiEndpoints.orderHousekeeping, data: data);
return response.data;
}
@@ -230,18 +232,20 @@ class Api {
}
Future<BookingDTO?> getBookingDetails(String bookingId) async {
- final response = await dio.get<Json>('${ApiEndpoints.getBookingDetails}$bookingId');
-
+ final response =
+ await dio.get<Json>('${ApiEndpoints.getBookingDetails}$bookingId');
+
return BookingDTO.fromJson(response.data!);
}
- Future<Json> postRoomSelection(String bookingId, String userId ) async {
+ Future<Json> postRoomSelection(String bookingId, String userId) async {
final body = {
"bookingConfirmationId": bookingId,
"userId": userId,
};
final data = jsonEncode(body);
- final response = await dio.post<Json>('ApiEndpoints.roomSelection', data: data);
+ final response =
+ await dio.post<Json>('ApiEndpoints.roomSelection', data: data);
return response.data!;
}
diff --git a/comwell_key_app/lib/services/interceptors/response_handle_interceptor.dart b/comwell_key_app/lib/services/interceptors/response_handle_interceptor.dart
index 6e0d6c74..961fdb86 100644
--- a/comwell_key_app/lib/services/interceptors/response_handle_interceptor.dart
+++ b/comwell_key_app/lib/services/interceptors/response_handle_interceptor.dart
@@ -5,7 +5,6 @@ import 'package:dio/dio.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:comwell_key_app/common/const.dart' as constants;
-import 'package:comwell_key_app/routing/app_routes.dart';
import 'package:go_router/go_router.dart';
import 'package:flutter/material.dart';
@@ -113,7 +112,7 @@ class ResponseHandleInterceptor extends Interceptor {
} catch (e) {
final err = DioException(
requestOptions: response.requestOptions,
- error: 'Failed to handle the response: \\${e}');
+ error: 'Failed to handle the response: \\$e');
handler.next(err);
}
}
diff --git a/comwell_key_app/lib/services/utils/api_endpoints.dart b/comwell_key_app/lib/services/utils/api_endpoints.dart
index b7d63c9a..9542f3ab 100644
--- a/comwell_key_app/lib/services/utils/api_endpoints.dart
+++ b/comwell_key_app/lib/services/utils/api_endpoints.dart
@@ -1,30 +1,39 @@
class ApiEndpoints {
// Auth endpoints
static const String logout = '/logout';
-
+
// Booking endpoints
static const String getCurrentBookings = '/booking/v1/GetCurrentBookings';
static const String preRegistration = '/booking/v1/Preregistration';
static const String checkIn = '/booking/v1/CheckIn';
- static const String getBookingDetails = '/booking/v1/GetBookingDetails?confirmationId=';
-
+ static const String getBookingDetails =
+ '/booking/v1/GetBookingDetails?confirmationId=';
+
//Default endpoints
static const String orderHousekeeping = '/Content/v1/api/v1/house-keeping';
-
+
// Payment endpoints
- static const String storedPaymentMethods = '/Payment/v1/stored-payment-methods';
- static const String createAdyenSession = '/Payment/v1/CreateAdyenSessionForBooking';
- static const String adyenPayments = 'https://checkout-test.adyen.com/v71/payments';
- static const String adyenPaymentsDetails = 'https://checkout-test.adyen.com/v71/payments/details';
-
+ static const String storedPaymentMethods =
+ '/Payment/v1/stored-payment-methods';
+ static const String createAdyenSession =
+ '/Payment/v1/CreateAdyenSessionForBooking';
+ static const String adyenPayments =
+ 'https://checkout-test.adyen.com/v71/payments';
+ static const String adyenPaymentsDetails =
+ 'https://checkout-test.adyen.com/v71/payments/details';
+
// Member endpoints
static const String getGuestProfile = '/Members/v1/GetGuestProfile';
static const String deleteGuest = '/Members/v1/DeleteGuest';
static const String clubSignup = '/Members/v1/ClubSignup';
static const String updateGuestData = '/Members/v1/UpdateGuestData';
static const String communicationPreference = '/Members/v1/guests';
-
+
// Key endpoints
- static const String createEndpointRegistration = '/keys/v1/CreateEndpointRegistration';
+ static const String createEndpointRegistration =
+ '/keys/v1/CreateEndpointRegistration';
static const String provisionKey = '/keys/v1/ProvisionKey';
-}
\ No newline at end of file
+
+ // Hotel endpoints
+ static const String getHotelInfo = '/Content/v1/api/v1/hotel';
+}
diff --git a/comwell_key_app/lib/themes/dark_theme.dart b/comwell_key_app/lib/themes/dark_theme.dart
index 424c3174..8d736413 100644
--- a/comwell_key_app/lib/themes/dark_theme.dart
+++ b/comwell_key_app/lib/themes/dark_theme.dart
@@ -35,7 +35,8 @@ ThemeData darkTheme = ThemeData(
scrim: colorPrimarySystem,
brightness: Brightness.light,
// Material 3+ surface roles:
- surfaceContainerLow: colorCallReceivedBackground, // custom container background
+ surfaceContainerLow:
+ colorCallReceivedBackground, // custom container background
tertiary: colorTertiary,
onTertiary: colorTertiaryText,
tertiaryContainer: colorTertiarySystem,
@@ -72,6 +73,7 @@ const colorTertiarySystem = Color(0xFF000000);
const colorShadow = Color(0xFF000000);
const colorError = Color(0xFFEB0026);
final colorHeadlineText = colorPrimaryText.withValues(alpha: 0.65);
+const colorCallReceivedBackground = Color(0xFFF6F4F3);
const int _earthColor = 0xFF677169;
const earthColor = MaterialColor(_earthColor, <int, Color>{
diff --git a/comwell_key_app/lib/up_sales/components/catalog/other_upgrade_catalog.dart b/comwell_key_app/lib/up_sales/components/catalog/other_upgrade_catalog.dart
index d8dc52c9..45ed9263 100644
--- a/comwell_key_app/lib/up_sales/components/catalog/other_upgrade_catalog.dart
+++ b/comwell_key_app/lib/up_sales/components/catalog/other_upgrade_catalog.dart
@@ -10,13 +10,12 @@ import 'package:go_router/go_router.dart';
class OtherUpgradeCatalog extends StatelessWidget {
final List<RoomUpgrade> upSales;
final List<RoomUpgrade> selectedUpSales;
- final Function(RoomUpgrade, int)? onOtherUpgradeSelected;
- const OtherUpgradeCatalog({
- super.key,
- required this.upSales,
- required this.selectedUpSales,
- this.onOtherUpgradeSelected
- });
+ final void Function(RoomUpgrade, int)? onOtherUpgradeSelected;
+ const OtherUpgradeCatalog(
+ {super.key,
+ required this.upSales,
+ required this.selectedUpSales,
+ this.onOtherUpgradeSelected});
@override
Widget build(BuildContext context) {
@@ -29,7 +28,8 @@ class OtherUpgradeCatalog extends StatelessWidget {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Text('no_room_upgrades_available'.tr(),
- style: theme.textTheme.headlineMedium?.copyWith(color: colorHeadlineText)),
+ style: theme.textTheme.headlineMedium
+ ?.copyWith(color: colorHeadlineText)),
);
}
@@ -42,13 +42,14 @@ class OtherUpgradeCatalog extends StatelessWidget {
return GestureDetector(
onTap: () async {
final result = await context.pushNamed(
- AppRoutes.otherUpgrade.name,
- extra: RoomUpgradeExtra(
- roomUpgrade: otherUpSales.elementAt(index),
- quantity: selectedUpSales.where((e) => e.id == otherUpSales.elementAt(index).id).length,
- )
- );
-
+ AppRoutes.otherUpgrade.name,
+ extra: RoomUpgradeExtra(
+ roomUpgrade: otherUpSales.elementAt(index),
+ quantity: selectedUpSales
+ .where((e) => e.id == otherUpSales.elementAt(index).id)
+ .length,
+ ));
+
if (result is int) {
final roomUpgrade = otherUpSales.elementAt(index);
onOtherUpgradeSelected?.call(roomUpgrade, result);
@@ -58,7 +59,8 @@ class OtherUpgradeCatalog extends StatelessWidget {
width: 328,
height: 268,
roomUpgrade: otherUpSales.elementAt(index),
- isSelected: selectedUpSales.contains(otherUpSales.elementAt(index)),
+ isSelected:
+ selectedUpSales.contains(otherUpSales.elementAt(index)),
routeName: AppRoutes.otherUpgrade.name,
showCounter: true,
selectedUpSales: selectedUpSales,
diff --git a/comwell_key_app/lib/up_sales/components/catalog/room_uprade_catalog.dart b/comwell_key_app/lib/up_sales/components/catalog/room_uprade_catalog.dart
index 80b05e0f..d4c6c36b 100644
--- a/comwell_key_app/lib/up_sales/components/catalog/room_uprade_catalog.dart
+++ b/comwell_key_app/lib/up_sales/components/catalog/room_uprade_catalog.dart
@@ -11,15 +11,14 @@ import 'package:go_router/go_router.dart';
class RoomUpgradeCatalog extends StatelessWidget {
final List<RoomUpgrade> upSales;
final List<RoomUpgrade> selectedUpSales;
- final Function(RoomUpgrade, bool)? onRoomUpgradeSelected;
- final Function(RoomUpgrade)? onTap;
- const RoomUpgradeCatalog({
- super.key,
- required this.upSales,
- required this.selectedUpSales,
- this.onRoomUpgradeSelected,
- this.onTap
- });
+ final void Function(RoomUpgrade, bool)? onRoomUpgradeSelected;
+ final void Function(RoomUpgrade)? onTap;
+ const RoomUpgradeCatalog(
+ {super.key,
+ required this.upSales,
+ required this.selectedUpSales,
+ this.onRoomUpgradeSelected,
+ this.onTap});
@override
Widget build(BuildContext context) {
@@ -32,7 +31,8 @@ class RoomUpgradeCatalog extends StatelessWidget {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16),
child: Text('no_room_upgrades_available'.tr(),
- style: theme.textTheme.headlineMedium?.copyWith(color: colorHeadlineText)),
+ style: theme.textTheme.headlineMedium
+ ?.copyWith(color: colorHeadlineText)),
);
}
@@ -44,18 +44,16 @@ class RoomUpgradeCatalog extends StatelessWidget {
itemBuilder: (context, index) {
return GestureDetector(
onTap: () async {
- final result = await context.pushNamed(
- AppRoutes.roomUpgrade.name,
- extra: RoomUpgradeList(
- roomUpgrade: roomUpSales.elementAt(index),
- roomUpgrades: selectedUpSales,
- )
- );
-
+ final result = await context.pushNamed(AppRoutes.roomUpgrade.name,
+ extra: RoomUpgradeList(
+ roomUpgrade: roomUpSales.elementAt(index),
+ roomUpgrades: selectedUpSales,
+ ));
+
if (result is List && result.length == 2) {
final roomUpgrade = result[0] as RoomUpgrade;
final isSelected = result[1] as bool;
-
+
onRoomUpgradeSelected?.call(roomUpgrade, isSelected);
}
},
@@ -63,7 +61,8 @@ class RoomUpgradeCatalog extends StatelessWidget {
width: kUpSalesServiceWidgetWidthLarge,
height: kUpSalesServiceWidgetHeightLarge,
roomUpgrade: roomUpSales.elementAt(index),
- isSelected: selectedUpSales.contains(roomUpSales.elementAt(index)),
+ isSelected:
+ selectedUpSales.contains(roomUpSales.elementAt(index)),
routeName: AppRoutes.roomUpgrade.name,
showCounter: false,
selectedUpSales: selectedUpSales,
@@ -76,4 +75,4 @@ class RoomUpgradeCatalog extends StatelessWidget {
),
);
}
-}
\ No newline at end of file
+}
diff --git a/comwell_key_app/lib/up_sales/components/catalog/service_catalog.dart b/comwell_key_app/lib/up_sales/components/catalog/service_catalog.dart
index 357a3b24..c94204d3 100644
--- a/comwell_key_app/lib/up_sales/components/catalog/service_catalog.dart
+++ b/comwell_key_app/lib/up_sales/components/catalog/service_catalog.dart
@@ -11,10 +11,10 @@ import 'package:go_router/go_router.dart';
class ServiceCatalog extends StatelessWidget {
final List<RoomUpgrade> upSales;
final double? height;
- final Function(RoomUpgrade)? onTap;
+ final void Function(RoomUpgrade)? onTap;
final List<RoomUpgrade>? selectedUpSales;
final bool showRadioButton;
- final Function(RoomUpgrade, bool)? onServiceSelected;
+ final void Function(RoomUpgrade, bool)? onServiceSelected;
const ServiceCatalog(
{super.key,
required this.upSales,
diff --git a/comwell_key_app/lib/up_sales/components/comwell_radio_button.dart b/comwell_key_app/lib/up_sales/components/comwell_radio_button.dart
index 99cda7ea..51fad3db 100644
--- a/comwell_key_app/lib/up_sales/components/comwell_radio_button.dart
+++ b/comwell_key_app/lib/up_sales/components/comwell_radio_button.dart
@@ -3,7 +3,7 @@ import 'package:flutter/material.dart';
class ComwellRadioButton extends StatelessWidget {
final bool selected;
- final Function()? onTap;
+ final void Function()? onTap;
const ComwellRadioButton({super.key, required this.selected, this.onTap});
@override
diff --git a/comwell_key_app/lib/up_sales/components/facilities_bottom_sheet.dart b/comwell_key_app/lib/up_sales/components/facilities_bottom_sheet.dart
index a90fc22d..8dc5b2f4 100644
--- a/comwell_key_app/lib/up_sales/components/facilities_bottom_sheet.dart
+++ b/comwell_key_app/lib/up_sales/components/facilities_bottom_sheet.dart
@@ -10,11 +10,12 @@ class FacilitiesBottomSheet extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
-
+
// Group facilities for display dynamically
final Map<FacilityType, List<RoomFacility>> grouped = {};
for (final type in FacilityType.values) {
- final facilitiesOfType = facilities.where((f) => f.facilityType == type).toList();
+ final facilitiesOfType =
+ facilities.where((f) => f.facilityType == type).toList();
if (facilitiesOfType.isNotEmpty) {
grouped[type] = facilitiesOfType;
}
@@ -24,7 +25,7 @@ class FacilitiesBottomSheet extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 16),
decoration: BoxDecoration(
color: theme.colorScheme.surface,
- borderRadius: BorderRadius.vertical(top: Radius.circular(24)),
+ borderRadius: const BorderRadius.vertical(top: Radius.circular(24)),
),
child: ListView(
children: [
@@ -71,11 +72,13 @@ class FacilitiesBottomSheet extends StatelessWidget {
borderRadius: BorderRadius.circular(8),
),
child: Center(
- child: FacilityIconText(facility: f, showDivider: false)),
+ child: FacilityIconText(
+ facility: f, showDivider: false)),
))
.toList()
: entry.value
- .map((f) => FacilityIconText(facility: f, showDivider: false))
+ .map((f) => FacilityIconText(
+ facility: f, showDivider: false))
.toList(),
),
const SizedBox(height: 16),
diff --git a/comwell_key_app/lib/up_sales/components/up_sales_services_widget.dart b/comwell_key_app/lib/up_sales/components/up_sales_services_widget.dart
index 3f8f0689..5f4c4a14 100644
--- a/comwell_key_app/lib/up_sales/components/up_sales_services_widget.dart
+++ b/comwell_key_app/lib/up_sales/components/up_sales_services_widget.dart
@@ -11,7 +11,7 @@ class UpSalesServicesWidget extends StatelessWidget {
final RoomUpgrade roomUpgrade;
final bool? isSelected;
final bool? isPopular;
- final Function(RoomUpgrade)? onTap;
+ final void Function(RoomUpgrade)? onTap;
final bool showRadioButton;
final List<RoomUpgrade>? selectedUpSales;
const UpSalesServicesWidget(
diff --git a/comwell_key_app/lib/up_sales/components/up_sales_upgrades_widget.dart b/comwell_key_app/lib/up_sales/components/up_sales_upgrades_widget.dart
index 31128857..24a1de72 100644
--- a/comwell_key_app/lib/up_sales/components/up_sales_upgrades_widget.dart
+++ b/comwell_key_app/lib/up_sales/components/up_sales_upgrades_widget.dart
@@ -13,7 +13,7 @@ class UpSalesUpgradesWidget extends StatelessWidget {
final bool isSelected;
final String routeName;
final bool showCounter;
- final Function(RoomUpgrade) onTap;
+ final void Function(RoomUpgrade) onTap;
final List<RoomUpgrade> selectedUpSales;
const UpSalesUpgradesWidget(
{super.key,
diff --git a/comwell_key_app/lib/up_sales/cubit/up_sales_cubit.dart b/comwell_key_app/lib/up_sales/cubit/up_sales_cubit.dart
index 13268fdc..e0b41475 100644
--- a/comwell_key_app/lib/up_sales/cubit/up_sales_cubit.dart
+++ b/comwell_key_app/lib/up_sales/cubit/up_sales_cubit.dart
@@ -100,7 +100,7 @@ class UpSalesCubit extends Cubit<UpSalesState> {
Future<void> confirmUpSales() async {
// Simulate network/API call
- await Future.delayed(const Duration(seconds: 2));
+ await Future<void>.delayed(const Duration(seconds: 2));
// You can add logic here to update state if needed
}
}
diff --git a/comwell_key_app/lib/utils/launch_util.dart b/comwell_key_app/lib/utils/launch_util.dart
index ee675f27..f4cc76f4 100644
--- a/comwell_key_app/lib/utils/launch_util.dart
+++ b/comwell_key_app/lib/utils/launch_util.dart
@@ -2,21 +2,22 @@ import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
Future<void> makePhoneCall(String phoneNumber) async {
- final Uri launchUri = Uri(
- scheme: 'tel',
- path: phoneNumber,
- );
- await launchUrl(launchUri);
- }
+ final Uri launchUri = Uri(
+ scheme: 'tel',
+ path: phoneNumber,
+ );
+ await launchUrl(launchUri);
+}
-Future<void> launchAppUrl(BuildContext context, Uri uri, {String? errorMessage}) async {
- debugPrint('Trying to launch: ' + uri.toString());
+Future<void> launchAppUrl(BuildContext context, Uri uri,
+ {String? errorMessage}) async {
+ debugPrint('Trying to launch: $uri');
final canLaunch = await canLaunchUrl(uri);
debugPrint('canLaunchUrl result: $canLaunch');
if (canLaunch) {
await launchUrl(uri, mode: LaunchMode.externalApplication);
} else {
- debugPrint('canLaunchUrl returned false for: ' + uri.toString());
+ debugPrint('canLaunchUrl returned false for: $uri');
if (context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(errorMessage ?? 'Could not open the app.')),
@@ -25,7 +26,9 @@ Future<void> launchAppUrl(BuildContext context, Uri uri, {String? errorMessage})
}
}
-Future<void> launchEmail(BuildContext context, String email, {String? errorMessage}) async {
+Future<void> launchEmail(BuildContext context, String email,
+ {String? errorMessage}) async {
final Uri emailUri = Uri(scheme: 'mailto', path: email);
- await launchAppUrl(context, emailUri, errorMessage: errorMessage ?? 'Could not open email app.');
-}
\ No newline at end of file
+ await launchAppUrl(context, emailUri,
+ errorMessage: errorMessage ?? 'Could not open email app.');
+}
diff --git a/comwell_key_app/test/booking_details_test/booking_details_repository_test.dart b/comwell_key_app/test/booking_details_test/booking_details_repository_test.dart
index b5ff68a7..52eadc16 100644
--- a/comwell_key_app/test/booking_details_test/booking_details_repository_test.dart
+++ b/comwell_key_app/test/booking_details_test/booking_details_repository_test.dart
@@ -1,5 +1,4 @@
// Import necessary testing packages and mockito
-import 'package:comwell_key_app/booking_details/booking_details_repository.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/mockito.dart';
import 'package:seos_mobile_keys_plugin/seos_mobile_keys_plugin.dart';
@@ -8,14 +7,10 @@ class MockSeosMobileKeysPlugin extends Mock implements SeosMobileKeysPlugin {}
void main() {
// Declare the mock SeosMobileKeysPlugin
- late SeosMobileKeysPlugin mockSeosMobileKeysPlugin;
- late BookingDetailsRepository bookingDetailsRepository;
// Setup function runs before every test
setUp(() {
// Initialize the mock SeosMobileKeysPlugin
TestWidgetsFlutterBinding.ensureInitialized();
- mockSeosMobileKeysPlugin = MockSeosMobileKeysPlugin();
- bookingDetailsRepository = BookingDetailsRepository();
});
-}
\ No newline at end of file
+}
diff --git a/mobilekeys_sdk_plugin/android/src/main/kotlin/com/assaabloy/flutter/seosmobilekeyssdk/seos_mobile_keys_plugin/AppUsage.kt b/mobilekeys_sdk_plugin/android/src/main/kotlin/com/assaabloy/flutter/seosmobilekeyssdk/seos_mobile_keys_plugin/AppUsage.kt
index c4a7f9bd..a3484484 100644
--- a/mobilekeys_sdk_plugin/android/src/main/kotlin/com/assaabloy/flutter/seosmobilekeyssdk/seos_mobile_keys_plugin/AppUsage.kt
+++ b/mobilekeys_sdk_plugin/android/src/main/kotlin/com/assaabloy/flutter/seosmobilekeyssdk/seos_mobile_keys_plugin/AppUsage.kt
@@ -31,9 +31,6 @@ private fun wrapError(exception: Throwable): List<Any?> {
}
}
-private fun createConnectionError(channelName: String): FlutterError {
- return FlutterError("channel-error", "Unable to establish connection on channel: '$channelName'.", "")}
-
/**
* Error class for passing custom error details to Flutter via a thrown PlatformException.
* @property code The error code.
@@ -1145,102 +1142,3 @@ interface AppUsageAPI {
}
}
}
-@Suppress("UNCHECKED_CAST")
-private object MobileKeysCallbackCodec : StandardMessageCodec() {
- override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? {
- return when (type) {
- 128.toByte() -> {
- return (readValue(buffer) as? List<Any?>)?.let {
- DataTypeDate.fromList(it)
- }
- }
- 129.toByte() -> {
- return (readValue(buffer) as? List<Any?>)?.let {
- MobileKeysReader.fromList(it)
- }
- }
- 130.toByte() -> {
- return (readValue(buffer) as? List<Any?>)?.let {
- MobileKeysRssiMeasurement.fromList(it)
- }
- }
- else -> super.readValueOfType(type, buffer)
- }
- }
- override fun writeValue(stream: ByteArrayOutputStream, value: Any?) {
- when (value) {
- is DataTypeDate -> {
- stream.write(128)
- writeValue(stream, value.toList())
- }
- is MobileKeysReader -> {
- stream.write(129)
- writeValue(stream, value.toList())
- }
- is MobileKeysRssiMeasurement -> {
- stream.write(130)
- writeValue(stream, value.toList())
- }
- else -> super.writeValue(stream, value)
- }
- }
-}
-
-/** Generated class from Pigeon that represents Flutter messages that can be called from Kotlin. */
-@Suppress("UNCHECKED_CAST")
-class MobileKeysCallback(private val binaryMessenger: BinaryMessenger) {
- companion object {
- /** The codec used by MobileKeysCallback. */
- val codec: MessageCodec<Any?> by lazy {
- MobileKeysCallbackCodec
- }
- }
- fun onReaderConnected(readerArg: MobileKeysReader, openingTypeArg: OpeningType, callback: (Result<Unit>) -> Unit)
-{
- val channelName = "dev.flutter.pigeon.seos_mobile_keys_plugin.MobileKeysCallback.onReaderConnected"
- val channel = BasicMessageChannel<Any?>(binaryMessenger, channelName, codec)
- channel.send(listOf(readerArg, openingTypeArg.raw)) {
- if (it is List<*>) {
- if (it.size > 1) {
- callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?)))
- } else {
- callback(Result.success(Unit))
- }
- } else {
- callback(Result.failure(createConnectionError(channelName)))
- }
- }
- }
- fun onReaderConnectionFailed(readerArg: MobileKeysReader, openingTypeArg: OpeningType, statusArg: String, callback: (Result<Unit>) -> Unit)
-{
- val channelName = "dev.flutter.pigeon.seos_mobile_keys_plugin.MobileKeysCallback.onReaderConnectionFailed"
- val channel = BasicMessageChannel<Any?>(binaryMessenger, channelName, codec)
- channel.send(listOf(readerArg, openingTypeArg.raw, statusArg)) {
- if (it is List<*>) {
- if (it.size > 1) {
- callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?)))
- } else {
- callback(Result.success(Unit))
- }
- } else {
- callback(Result.failure(createConnectionError(channelName)))
- }
- }
- }
- fun onReaderDisconnected(readerArg: MobileKeysReader, openingTypeArg: OpeningType, wasSuccessfulArg: Boolean, callback: (Result<Unit>) -> Unit)
-{
- val channelName = "dev.flutter.pigeon.seos_mobile_keys_plugin.MobileKeysCallback.onReaderDisconnected"
- val channel = BasicMessageChannel<Any?>(binaryMessenger, channelName, codec)
- channel.send(listOf(readerArg, openingTypeArg.raw, wasSuccessfulArg)) {
- if (it is List<*>) {
- if (it.size > 1) {
- callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?)))
- } else {
- callback(Result.success(Unit))
- }
- } else {
- callback(Result.failure(createConnectionError(channelName)))
- }
- }
- }
-}