6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 9b0ea7b1
Changed files
comwell_key_app/assets/translations/da-DK.json | 3 ++- comwell_key_app/assets/translations/en-US.json | 6 +++--- .../lib/booking_details/booking_details_page.dart | 3 +-- .../my_booking/components/balance_bottom_sheet.dart | 20 ++++++-------------- .../components/comwell_club_signup_bottom_sheet.dart | 10 +++++----- comwell_key_app/lib/profile/profile_repository.dart | 5 +++-- comwell_key_app/lib/profile/utils/constants.dart | 3 +++ comwell_key_app/lib/profile/utils/urls.dart | 4 ++++ 8 files changed, 27 insertions(+), 27 deletions(-)
Diff
diff --git a/comwell_key_app/assets/translations/da-DK.json b/comwell_key_app/assets/translations/da-DK.json
index 6a096ded..13b6f328 100644
--- a/comwell_key_app/assets/translations/da-DK.json
+++ b/comwell_key_app/assets/translations/da-DK.json
@@ -237,5 +237,6 @@
"share_booking": "Del ophold",
"total_charge": "I alt til betaling",
"early_checkin": "Tidlig check-in",
- "payed": "BETALT"
+ "payed": "BETALT",
+ "total_charge_value": "{} kr."
}
\ No newline at end of file
diff --git a/comwell_key_app/assets/translations/en-US.json b/comwell_key_app/assets/translations/en-US.json
index 77d0fa1e..ecc67286 100644
--- a/comwell_key_app/assets/translations/en-US.json
+++ b/comwell_key_app/assets/translations/en-US.json
@@ -235,8 +235,8 @@
"payment_date": "Payment date",
"not_shared": "Not shared",
"share_booking": "Share booking",
- "total_charge": "I alt til betaling",
+ "total_charge": "Total charge",
"early_checkin": "Early check-in",
- "payed": "PAYED"
-
+ "payed": "PAYED",
+ "total_charge_value": "{} kr."
}
diff --git a/comwell_key_app/lib/booking_details/booking_details_page.dart b/comwell_key_app/lib/booking_details/booking_details_page.dart
index 55f98239..f18fa41e 100644
--- a/comwell_key_app/lib/booking_details/booking_details_page.dart
+++ b/comwell_key_app/lib/booking_details/booking_details_page.dart
@@ -27,7 +27,6 @@ class BookingDetailsPage extends StatelessWidget {
listener: (context, state) {},
builder: (context, state) {
final cubit = context.read<BookingDetailsBloc>();
- print("Booking: ${cubit.booking}");
if (state.status == BookingDetailsStatus.initial) {
cubit.add(InitialEvent());
@@ -202,7 +201,7 @@ class BookingDetailsPage extends StatelessWidget {
),
const SizedBox(width: 12),
Text(
- "${cubit.booking.totalCharge.toString()} kr",
+ 'total_charge_value'.tr(args: [cubit.booking.totalCharge.toString()]),
style: theme.textTheme.bodyMedium?.copyWith(
color: Colors.white,
),
diff --git a/comwell_key_app/lib/my_booking/components/balance_bottom_sheet.dart b/comwell_key_app/lib/my_booking/components/balance_bottom_sheet.dart
index b813a834..bfaf3bb4 100644
--- a/comwell_key_app/lib/my_booking/components/balance_bottom_sheet.dart
+++ b/comwell_key_app/lib/my_booking/components/balance_bottom_sheet.dart
@@ -1,11 +1,10 @@
-import 'package:comwell_key_app/common/components/bottom_sheet_widget.dart';
import 'package:comwell_key_app/overview/models/booking.dart';
import 'package:comwell_key_app/themes/light_theme.dart';
import 'package:comwell_key_app/utils/share_button_utils.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
-class BalanceBottomSheet extends StatefulWidget {
+class BalanceBottomSheet extends StatelessWidget {
final num balance;
final String userName;
final Booking booking;
@@ -19,12 +18,6 @@ class BalanceBottomSheet extends StatefulWidget {
required this.items,
});
- @override
- State<BalanceBottomSheet> createState() => _BalanceBottomSheetState();
-}
-
-class _BalanceBottomSheetState extends State<BalanceBottomSheet> {
-
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
@@ -86,13 +79,13 @@ class _BalanceBottomSheetState extends State<BalanceBottomSheet> {
CircleAvatar(
backgroundColor: sandColor,
child: Text(
- generateInitialsString(widget.userName),
+ generateInitialsString(userName),
style: const TextStyle(color: Colors.white),
),
),
const SizedBox(width: 12),
Text(
- widget.userName,
+ userName,
style: theme.textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.bold,
),
@@ -100,7 +93,7 @@ class _BalanceBottomSheetState extends State<BalanceBottomSheet> {
],
),
const SizedBox(height: 16),
- ...widget.items.map((item) => _buildBalanceItem(item, theme)),
+ ...items.map((item) => _buildBalanceItem(item, theme)),
const SizedBox(height: 24),
Container(
@@ -122,8 +115,7 @@ class _BalanceBottomSheetState extends State<BalanceBottomSheet> {
fontWeight: FontWeight.w400,
),
),
- Text(
- '${widget.booking.totalCharge} kr.',
+ Text('total_charge_value'.tr(args: [booking.totalCharge.toString()]),
style: theme.textTheme.titleLarge
?.copyWith(fontWeight: FontWeight.bold),
),
@@ -170,7 +162,7 @@ class _BalanceBottomSheetState extends State<BalanceBottomSheet> {
),
),
child: Text(
- 'Gå til betaling ${widget.balance.toInt()} kr.',
+ 'Gå til betaling ${balance.toInt()} kr.',
style: const TextStyle(
color: Colors.white,
fontSize: 16,
diff --git a/comwell_key_app/lib/profile/components/comwell_club_signup_bottom_sheet.dart b/comwell_key_app/lib/profile/components/comwell_club_signup_bottom_sheet.dart
index ea4d33b7..132900fb 100644
--- a/comwell_key_app/lib/profile/components/comwell_club_signup_bottom_sheet.dart
+++ b/comwell_key_app/lib/profile/components/comwell_club_signup_bottom_sheet.dart
@@ -1,5 +1,7 @@
import 'package:comwell_key_app/common/components/round_icon_button.dart';
import 'package:comwell_key_app/profile/cubit/profile_cubit.dart';
+import 'package:comwell_key_app/profile/utils/constants.dart';
+import 'package:comwell_key_app/profile/utils/urls.dart';
import 'package:comwell_key_app/profile_settings/components/comwell_text_field.dart';
import 'package:comwell_key_app/profile_settings/components/date_time_picker.dart';
import 'package:comwell_key_app/profile_settings/model/address.dart';
@@ -54,7 +56,7 @@ class _ComwellClubSignupBottomSheetState
topRight: Radius.circular(24),
),
),
- height: MediaQuery.of(context).copyWith().size.height * 0.7,
+ height: MediaQuery.of(context).copyWith(viewInsets: EdgeInsets.zero).size.height * ComwellClubConstants.imageHeightRatio,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -187,8 +189,7 @@ class _ComwellClubSignupBottomSheetState
text: "tos_accept_link".tr(),
recognizer: TapGestureRecognizer()
..onTap = () {
- launchUrl(Uri.parse(
- 'https://comwell.com/club/club-regler'));
+ launchUrl(Uri.parse(ComwellUrls.clubRules));
},
style: TextStyle(
fontSize:
@@ -236,8 +237,7 @@ class _ComwellClubSignupBottomSheetState
text: "read_more".tr(),
recognizer: TapGestureRecognizer()
..onTap = () {
- launchUrl(Uri.parse(
- 'https://comwell.com/club/club-permission'));
+ launchUrl(Uri.parse(ComwellUrls.clubPermission));
},
style: TextStyle(
fontSize: theme.textTheme.bodySmall!.fontSize,
diff --git a/comwell_key_app/lib/profile/profile_repository.dart b/comwell_key_app/lib/profile/profile_repository.dart
index 7893f3c0..08870f25 100644
--- a/comwell_key_app/lib/profile/profile_repository.dart
+++ b/comwell_key_app/lib/profile/profile_repository.dart
@@ -9,6 +9,7 @@ import 'package:comwell_key_app/utils/json.dart';
import 'package:comwell_key_app/utils/locator.dart';
import 'package:comwell_key_app/utils/secure_storage.dart';
import 'package:comwell_key_app/utils/seos_repository.dart';
+import 'package:flutter/material.dart';
import 'package:seos_mobile_keys_plugin/seos_mobile_keys_plugin.dart';
class ProfileRepository {
@@ -50,13 +51,13 @@ class ProfileRepository {
try {
await db.userDAO.saveUser(userDto);
} catch (dbError) {
- print("Database error while saving user: ${dbError.toString()}");
+ debugPrint("Database error while saving user: ${dbError.toString()}");
// Continue execution even if database save fails
}
return user;
} catch (e) {
- print("Error fetching profile settings: ${e.toString()}");
+ debugPrint("Error fetching profile settings: ${e.toString()}");
rethrow;
}
}
diff --git a/comwell_key_app/lib/profile/utils/constants.dart b/comwell_key_app/lib/profile/utils/constants.dart
new file mode 100644
index 00000000..8a421c69
--- /dev/null
+++ b/comwell_key_app/lib/profile/utils/constants.dart
@@ -0,0 +1,3 @@
+class ComwellClubConstants {
+ static const double imageHeightRatio = 0.7;
+}
diff --git a/comwell_key_app/lib/profile/utils/urls.dart b/comwell_key_app/lib/profile/utils/urls.dart
new file mode 100644
index 00000000..c81ea4e2
--- /dev/null
+++ b/comwell_key_app/lib/profile/utils/urls.dart
@@ -0,0 +1,4 @@
+class ComwellUrls {
+ static const String clubRules = 'https://comwell.com/club/club-regler';
+ static const String clubPermission = 'https://comwell.com/club/club-permission';
+}