6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 80c05c8a
Changed files
comwell_key_app/assets/translations/da-DK.json | 2 + comwell_key_app/assets/translations/en-US.json | 2 + .../components/get_a_phone_call_section.dart | 85 ++++++++++++++++------ comwell_key_app/lib/contact/contact_page.dart | 6 +- .../lib/contact/cubit/contact_cubit.dart | 6 +- .../components/intl_phone_field.dart | 3 +- comwell_key_app/lib/themes/dark_theme.dart | 2 +- comwell_key_app/lib/themes/light_theme.dart | 7 +- 8 files changed, 79 insertions(+), 34 deletions(-)
Diff
diff --git a/comwell_key_app/assets/translations/da-DK.json b/comwell_key_app/assets/translations/da-DK.json
index 395b6b43..39a0e2df 100644
--- a/comwell_key_app/assets/translations/da-DK.json
+++ b/comwell_key_app/assets/translations/da-DK.json
@@ -154,6 +154,8 @@
"call_us_description": "Har du brug for at komme i kontakt med et af vores hoteller? Benyt knappen nedenfor for at ringe op.",
"get_a_call": "Bliv ringet op",
"get_a_call_description": "Indtast dit telefonnummer herunder og bliv ringet op.",
+ "call_received_title": "Modtaget",
+ "call_received_description": "Vi har modtaget din kontaktforespørgsel. Vores team vil kontakte dig snart.",
"telephone_number": "Telefonnummer",
"comwell_telefon_number": "+4570274274",
"restaurant_page_practical_information": "Praktisk information",
diff --git a/comwell_key_app/assets/translations/en-US.json b/comwell_key_app/assets/translations/en-US.json
index bb8a0f06..ef23b31e 100644
--- a/comwell_key_app/assets/translations/en-US.json
+++ b/comwell_key_app/assets/translations/en-US.json
@@ -122,6 +122,8 @@
"call_us_description": "Enter your phone number below and we will call you.",
"get_a_call": "Get a call",
"get_a_call_description": "Enter your phone number below and we will call you.",
+ "call_received_title": "Received",
+ "call_received_description": "We have received your contact request. Our team will get back to you soon.",
"telephone_number": "Telephone number",
"comwell_telephone_number": "+4570274274",
"booking_details_page_hotel_information_button_title": "Hotel information",
diff --git a/comwell_key_app/lib/contact/components/get_a_phone_call_section.dart b/comwell_key_app/lib/contact/components/get_a_phone_call_section.dart
index 19149c30..ee0de96d 100644
--- a/comwell_key_app/lib/contact/components/get_a_phone_call_section.dart
+++ b/comwell_key_app/lib/contact/components/get_a_phone_call_section.dart
@@ -5,25 +5,22 @@ import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
class GetAPhoneCallSection extends StatelessWidget {
- final VoidCallback onPressed;
- const GetAPhoneCallSection({
- super.key,
- required this.onPressed,
- });
+ const GetAPhoneCallSection({super.key});
@override
Widget build(BuildContext context) {
final theme = Theme.of(context);
final cubit = context.read<ContactCubit>();
-
-
+ final contactState = context.watch<ContactCubit>().state;
+
+ if (contactState == const ContactState.contactSend()) {
+ return _ReceivedCard(theme: theme);
+ }
+
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
- Text(
- 'get_a_call'.tr(),
- style: theme.textTheme.headlineMedium,
- ),
+ Text('get_a_call'.tr(), style: theme.textTheme.headlineMedium),
const SizedBox(height: 8),
Text('get_a_call_description'.tr(), style: theme.textTheme.bodySmall),
const SizedBox(height: 8),
@@ -39,16 +36,62 @@ class GetAPhoneCallSection extends StatelessWidget {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 0),
child: ElevatedButton(
- onPressed: () async {
- // await makePhoneCall('comwell_telefon_number'.tr());
- },
- child: Text(
- 'get_a_call'.tr(),
- style: theme.textTheme.headlineSmall?.copyWith(
- color: Colors.white,
- ),
- )),
- )
+ onPressed: () async {
+ await cubit.sendContact(cubit.phoneNumber);
+ },
+ child: Text(
+ 'get_a_call'.tr(),
+ style:
+ theme.textTheme.headlineSmall?.copyWith(color: Colors.white),
+ ),
+ ),
+ ),
+ ],
+ );
+ }
+}
+
+class _ReceivedCard extends StatelessWidget {
+ final ThemeData theme;
+ const _ReceivedCard({required this.theme});
+
+ @override
+ Widget build(BuildContext context) {
+ return Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Text('get_a_call'.tr(), style: theme.textTheme.headlineMedium),
+ const SizedBox(height: 8),
+ Text('get_a_call_description'.tr(), style: theme.textTheme.bodySmall),
+ const SizedBox(height: 8),
+ SizedBox(
+ height: 132,
+ width: double.infinity,
+ child: Card(
+ margin: EdgeInsets.zero,
+ elevation: 0,
+ color: theme.colorScheme.surfaceContainerLow,
+ child: Padding(
+ padding:
+ const EdgeInsets.symmetric(horizontal: 36.0, vertical: 16.0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ children: [
+ Text('call_received_title'.tr(),
+ style: theme.textTheme.headlineSmall),
+ const SizedBox(height: 10),
+ Text(
+ 'call_received_description'.tr(),
+ textAlign: TextAlign.center,
+ style: theme.textTheme.bodySmall?.copyWith(
+ color: theme.colorScheme.surfaceTint,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
],
);
}
diff --git a/comwell_key_app/lib/contact/contact_page.dart b/comwell_key_app/lib/contact/contact_page.dart
index 7d417180..df75cbad 100644
--- a/comwell_key_app/lib/contact/contact_page.dart
+++ b/comwell_key_app/lib/contact/contact_page.dart
@@ -36,11 +36,7 @@ class ContactPage extends StatelessWidget {
const SizedBox(height: 20),
const Divider(color: colorDivider),
const SizedBox(height: 20),
- GetAPhoneCallSection(
- onPressed: () {
-
- },
- ),
+ const GetAPhoneCallSection(),
],
),
),
diff --git a/comwell_key_app/lib/contact/cubit/contact_cubit.dart b/comwell_key_app/lib/contact/cubit/contact_cubit.dart
index 34786a3b..f0fb2b11 100644
--- a/comwell_key_app/lib/contact/cubit/contact_cubit.dart
+++ b/comwell_key_app/lib/contact/cubit/contact_cubit.dart
@@ -19,12 +19,12 @@ class ContactCubit extends Cubit<ContactState> {
late String phoneNumber = '';
ContactCubit({required this.contactRepository, required this.overviewRepository, required this.profileRepository}) : super(const ContactState.initial());
- void sendContact(String hotelCode) async {
+ Future<void> sendContact(String hotelCode) async {
emit(const ContactState.contactSend());
try {
- final bookings = await overviewRepository.fetchAllBookingsForUser();
+ //final bookings = await overviewRepository.fetchAllBookingsForUser();
// Send contact
- contactRepository.sendContact(bookings.current.first.hotelCode);
+ //contactRepository.sendContact(bookings.current.first.hotelCode);
emit(const ContactState.contactSent());
} catch (e) {
emit(const ContactState.contactError());
diff --git a/comwell_key_app/lib/profile_settings/components/intl_phone_field.dart b/comwell_key_app/lib/profile_settings/components/intl_phone_field.dart
index 80d85d5b..fdecff75 100644
--- a/comwell_key_app/lib/profile_settings/components/intl_phone_field.dart
+++ b/comwell_key_app/lib/profile_settings/components/intl_phone_field.dart
@@ -95,8 +95,7 @@ class IntlPhoneFieldState extends State<IntlPhoneField> {
onSubmitted: widget.onSubmitted,
onChanged: widget.onPhoneNumberChanged,
- keyboardType:
- const TextInputType.numberWithOptions(signed: true),
+ keyboardType: TextInputType.number,
inputFormatters: [
FilteringTextInputFormatter.digitsOnly,
],
diff --git a/comwell_key_app/lib/themes/dark_theme.dart b/comwell_key_app/lib/themes/dark_theme.dart
index 171e5f3d..c3990b3a 100644
--- a/comwell_key_app/lib/themes/dark_theme.dart
+++ b/comwell_key_app/lib/themes/dark_theme.dart
@@ -19,7 +19,7 @@ ThemeData darkTheme = ThemeData(
headlineMedium: TextStyle(fontSize: 18.0, fontWeight: FontWeight.w600),
headlineSmall: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600),
bodyMedium: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600),
- bodySmall: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w400)),
+ bodySmall: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w500)),
colorScheme: ColorScheme(
primary: colorPrimary,
secondary: colorSecondary,
diff --git a/comwell_key_app/lib/themes/light_theme.dart b/comwell_key_app/lib/themes/light_theme.dart
index 13e61394..320af959 100644
--- a/comwell_key_app/lib/themes/light_theme.dart
+++ b/comwell_key_app/lib/themes/light_theme.dart
@@ -20,7 +20,7 @@ ThemeData lightTheme = ThemeData(
headlineMedium: TextStyle(fontSize: 18.0, fontWeight: FontWeight.w600),
headlineSmall: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600),
bodyMedium: TextStyle(fontSize: 16.0, fontWeight: FontWeight.w600),
- bodySmall: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w400),
+ bodySmall: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w500),
labelLarge: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600),
titleLarge: TextStyle(fontSize: 28.0, fontWeight: FontWeight.w600),
),
@@ -39,7 +39,9 @@ ThemeData lightTheme = ThemeData(
onError: Colors.white,
brightness: Brightness.light,
shadow: colorShadow,
- surfaceTint: colorHeadlineText),
+ surfaceTint: colorHeadlineText,
+ surfaceContainerLow: colorCallReceivedBackground,
+ ),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
elevation: 0,
@@ -72,6 +74,7 @@ const colorShadow = Color(0xFF000000);
const colorDivider = Color(0xFFE0E0E0);
const disabledButtonColor = Color(0xFFF0F0F0);
final colorHeadlineText = colorPrimaryText.withValues(alpha: 0.65);
+const colorCallReceivedBackground = Color(0xFFF6F4F3);
const colorBlack = MaterialColor(0xFF000000, {
75: Color(0xB3000000),
65: Color(0xA6000000),