From a71cff21b50d28d175502ab8091f9480d45c374d Mon Sep 17 00:00:00 2001 From: 24bartixx Date: Wed, 11 Dec 2024 17:34:09 +0100 Subject: [PATCH 1/8] feat: add good amenities section icons --- assets/svg/digital_guide/assistance_dog.svg | 8 ++++++ assets/svg/digital_guide/braille.svg | 18 +++++++++++++ assets/svg/digital_guide/emergency_chairs.svg | 12 +++++++++ assets/svg/digital_guide/induction_loop.svg | 10 +++++++ assets/svg/digital_guide/large_font.svg | 10 +++++++ assets/svg/digital_guide/micronavigation.svg | 11 ++++++++ .../svg/digital_guide/orientation_paths.svg | 27 +++++++++++++++++++ assets/svg/digital_guide/sign_language.svg | 4 +++ assets/svg/digital_guide/storey.svg | 4 ++- .../amenities_expansion_tile_content.dart | 18 ++++++------- .../widgets/science_clubs_section.dart | 2 +- lib/l10n/app_pl.arb | 2 +- pubspec.yaml | 8 ++++++ 13 files changed, 122 insertions(+), 12 deletions(-) create mode 100644 assets/svg/digital_guide/assistance_dog.svg create mode 100644 assets/svg/digital_guide/braille.svg create mode 100644 assets/svg/digital_guide/emergency_chairs.svg create mode 100644 assets/svg/digital_guide/induction_loop.svg create mode 100644 assets/svg/digital_guide/large_font.svg create mode 100644 assets/svg/digital_guide/micronavigation.svg create mode 100644 assets/svg/digital_guide/orientation_paths.svg create mode 100644 assets/svg/digital_guide/sign_language.svg diff --git a/assets/svg/digital_guide/assistance_dog.svg b/assets/svg/digital_guide/assistance_dog.svg new file mode 100644 index 00000000..954b00b2 --- /dev/null +++ b/assets/svg/digital_guide/assistance_dog.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/svg/digital_guide/braille.svg b/assets/svg/digital_guide/braille.svg new file mode 100644 index 00000000..ce26d75a --- /dev/null +++ b/assets/svg/digital_guide/braille.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/assets/svg/digital_guide/emergency_chairs.svg b/assets/svg/digital_guide/emergency_chairs.svg new file mode 100644 index 00000000..d4af9a23 --- /dev/null +++ b/assets/svg/digital_guide/emergency_chairs.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/assets/svg/digital_guide/induction_loop.svg b/assets/svg/digital_guide/induction_loop.svg new file mode 100644 index 00000000..90e1ba51 --- /dev/null +++ b/assets/svg/digital_guide/induction_loop.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/svg/digital_guide/large_font.svg b/assets/svg/digital_guide/large_font.svg new file mode 100644 index 00000000..47b86381 --- /dev/null +++ b/assets/svg/digital_guide/large_font.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/assets/svg/digital_guide/micronavigation.svg b/assets/svg/digital_guide/micronavigation.svg new file mode 100644 index 00000000..d9b0cf0b --- /dev/null +++ b/assets/svg/digital_guide/micronavigation.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/assets/svg/digital_guide/orientation_paths.svg b/assets/svg/digital_guide/orientation_paths.svg new file mode 100644 index 00000000..8d5b24bb --- /dev/null +++ b/assets/svg/digital_guide/orientation_paths.svg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/svg/digital_guide/sign_language.svg b/assets/svg/digital_guide/sign_language.svg new file mode 100644 index 00000000..06afddc5 --- /dev/null +++ b/assets/svg/digital_guide/sign_language.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/assets/svg/digital_guide/storey.svg b/assets/svg/digital_guide/storey.svg index 5d715829..2f23acc9 100644 --- a/assets/svg/digital_guide/storey.svg +++ b/assets/svg/digital_guide/storey.svg @@ -1 +1,3 @@ - \ No newline at end of file + + + diff --git a/lib/features/digital_guide_view/amenities/presentation/amenities_expansion_tile_content.dart b/lib/features/digital_guide_view/amenities/presentation/amenities_expansion_tile_content.dart index e0fc7ede..2ddff9a9 100644 --- a/lib/features/digital_guide_view/amenities/presentation/amenities_expansion_tile_content.dart +++ b/lib/features/digital_guide_view/amenities/presentation/amenities_expansion_tile_content.dart @@ -21,42 +21,42 @@ class AmenitiesExpansionTileContent extends StatelessWidget { if (digitalGuideResponseExtended.canAssistanceDog) ContactIconsModel( text: context.localize.assistance_dog, - icon: Assets.svg.contactIcons.compass, + icon: Assets.svg.digitalGuide.assistanceDog, ), if (digitalGuideResponseExtended.isInductionLoop) ContactIconsModel( text: context.localize.induction_loop, - icon: Assets.svg.contactIcons.compass, + icon: Assets.svg.digitalGuide.inductionLoop, ), if (digitalGuideResponseExtended.isMicroNavigationSystem) ContactIconsModel( text: context.localize.micronavigation_system, - icon: Assets.svg.contactIcons.compass, + icon: Assets.svg.digitalGuide.micronavigation, ), if (digitalGuideResponseExtended.areGuidancePaths) ContactIconsModel( - text: context.localize.guidance_paths, - icon: Assets.svg.contactIcons.compass, + text: context.localize.orientation_paths, + icon: Assets.svg.digitalGuide.orientationPaths, ), if (digitalGuideResponseExtended.areBrailleBoards) ContactIconsModel( text: context.localize.information_boards_with_braille_description, - icon: Assets.svg.contactIcons.compass, + icon: Assets.svg.digitalGuide.braille, ), if (digitalGuideResponseExtended.areLargeFontBoards) ContactIconsModel( text: context.localize.information_boards_with_large_font, - icon: Assets.svg.contactIcons.compass, + icon: Assets.svg.digitalGuide.largeFont, ), if (digitalGuideResponseExtended.isSignLanguageInterpreter) ContactIconsModel( text: context.localize.sign_language_interpreter, - icon: Assets.svg.contactIcons.compass, + icon: Assets.svg.digitalGuide.signLanguage, ), if (digitalGuideResponseExtended.areEmergencyChairs) ContactIconsModel( text: context.localize.emergency_chairs, - icon: Assets.svg.contactIcons.compass, + icon: Assets.svg.digitalGuide.emergencyChairs, ), ].lock, ); diff --git a/lib/features/home_view/widgets/science_clubs_section.dart b/lib/features/home_view/widgets/science_clubs_section.dart index b7b57859..ea30b7da 100644 --- a/lib/features/home_view/widgets/science_clubs_section.dart +++ b/lib/features/home_view/widgets/science_clubs_section.dart @@ -28,7 +28,7 @@ class ScienceClubsSection extends ConsumerWidget { ), FilledButton( onPressed: () { - unawaited(ref.navigateDigitalGuide(101)); + unawaited(ref.navigateDigitalGuide(313)); }, child: const Text("Navigate to digital guide screen!"), ), diff --git a/lib/l10n/app_pl.arb b/lib/l10n/app_pl.arb index 04d424f1..ad1155df 100644 --- a/lib/l10n/app_pl.arb +++ b/lib/l10n/app_pl.arb @@ -180,7 +180,7 @@ "assistance_dog" : "Do budynku i wszystkich jego pomieszczeń można wejść z psem asystującym i psem przewodnikiem", "induction_loop": "W budynku jest/są pętle indukcyjne", "micronavigation_system": "W budynku zostały zainstalowane urządzenia systemu nawigacyjno-informacyjnego", - "guidance_paths": "W budynku zastosowane zostały ścieżki naprowadzające (dotykowe)", + "orientation_paths": "W budynku zastosowane zostały ścieżki naprowadzające (dotykowe)", "information_boards_with_braille_description": "W budynku znajdują się czytelne tablice informacyjne zawierające opisy w alfabecie Braille'a", "information_boards_with_large_font": "W budynku znajdują się czytelne tablice informacyjne zawierające napisy w dużej czcionce", "sign_language_interpreter": "W budynku zapewniona jest możliwość skorzystania z usług tłumacza języka migowego", diff --git a/pubspec.yaml b/pubspec.yaml index 19ddbfea..1215eccb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -147,6 +147,14 @@ flutter: - assets/svg/contact_icons/tiktok.svg - assets/svg/contact_icons/discord.svg - assets/svg/digital_guide/storey.svg + - assets/svg/digital_guide/assistance_dog.svg + - assets/svg/digital_guide/braille.svg + - assets/svg/digital_guide/emergency_chairs.svg + - assets/svg/digital_guide/induction_loop.svg + - assets/svg/digital_guide/large_font.svg + - assets/svg/digital_guide/micronavigation.svg + - assets/svg/digital_guide/orientation_paths.svg + - assets/svg/digital_guide/sign_language.svg - assets/animations/error.json - assets/animations/search.json - assets/animations/offline.json From a38764de90394b1677821a7b4e5beb2b449ebdf0 Mon Sep 17 00:00:00 2001 From: 24bartixx Date: Wed, 11 Dec 2024 17:47:23 +0100 Subject: [PATCH 2/8] fix: do not show empty extended name and empty phone number --- .../presentation/digital_guide_view.dart | 15 ++++++++------- .../presentation/widgets/headlines_section.dart | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart b/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart index eda567fc..bb1d3447 100644 --- a/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart +++ b/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart @@ -73,13 +73,14 @@ class _DigitalGuideView extends ConsumerWidget { .replaceAll("ulica", "ul."), icon: Assets.svg.contactIcons.compass, ), - ContactIconsModel( - text: digitalGuideResponseExtended.telephoneNumber, - icon: Assets.svg.contactIcons.phone, - // TODO(Bartosh): url not working, nothing happens - url: - "tel:+48${digitalGuideResponseExtended.telephoneNumber.replaceAll("

", "").replaceAll("

", "")}", - ), + if(digitalGuideResponseExtended.telephoneNumber.isNotEmpty) + ContactIconsModel( + text: digitalGuideResponseExtended.telephoneNumber, + icon: Assets.svg.contactIcons.phone, + // TODO(Bartosh): url not working, nothing happens + url: + "tel:+48${digitalGuideResponseExtended.telephoneNumber.replaceAll("

", "").replaceAll("

", "")}", + ), ContactIconsModel( text: context.localize .storeys(digitalGuideResponseExtended.numberOfStoreys), diff --git a/lib/features/digital_guide_view/general_info/presentation/widgets/headlines_section.dart b/lib/features/digital_guide_view/general_info/presentation/widgets/headlines_section.dart index 77452d0c..e72df34a 100644 --- a/lib/features/digital_guide_view/general_info/presentation/widgets/headlines_section.dart +++ b/lib/features/digital_guide_view/general_info/presentation/widgets/headlines_section.dart @@ -22,7 +22,7 @@ class HeadlinesSection extends StatelessWidget { name, style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 24), ), - Text(description), + if(description.isNotEmpty) Text(description), ], ), ); From 3cbdbed365cb44b4abe2e1e026fde3a725001c2d Mon Sep 17 00:00:00 2001 From: 24bartixx Date: Wed, 11 Dec 2024 17:54:00 +0100 Subject: [PATCH 3/8] fix: formatting --- .../presentation/amenities_expansion_tile_content.dart | 2 +- .../general_info/presentation/digital_guide_view.dart | 2 +- .../general_info/presentation/widgets/headlines_section.dart | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/features/digital_guide_view/amenities/presentation/amenities_expansion_tile_content.dart b/lib/features/digital_guide_view/amenities/presentation/amenities_expansion_tile_content.dart index 2ddff9a9..dc3ca6ab 100644 --- a/lib/features/digital_guide_view/amenities/presentation/amenities_expansion_tile_content.dart +++ b/lib/features/digital_guide_view/amenities/presentation/amenities_expansion_tile_content.dart @@ -21,7 +21,7 @@ class AmenitiesExpansionTileContent extends StatelessWidget { if (digitalGuideResponseExtended.canAssistanceDog) ContactIconsModel( text: context.localize.assistance_dog, - icon: Assets.svg.digitalGuide.assistanceDog, + icon: Assets.svg.digitalGuide.assistanceDog, ), if (digitalGuideResponseExtended.isInductionLoop) ContactIconsModel( diff --git a/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart b/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart index bb1d3447..c81a7578 100644 --- a/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart +++ b/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart @@ -73,7 +73,7 @@ class _DigitalGuideView extends ConsumerWidget { .replaceAll("ulica", "ul."), icon: Assets.svg.contactIcons.compass, ), - if(digitalGuideResponseExtended.telephoneNumber.isNotEmpty) + if (digitalGuideResponseExtended.telephoneNumber.isNotEmpty) ContactIconsModel( text: digitalGuideResponseExtended.telephoneNumber, icon: Assets.svg.contactIcons.phone, diff --git a/lib/features/digital_guide_view/general_info/presentation/widgets/headlines_section.dart b/lib/features/digital_guide_view/general_info/presentation/widgets/headlines_section.dart index e72df34a..0c60e01c 100644 --- a/lib/features/digital_guide_view/general_info/presentation/widgets/headlines_section.dart +++ b/lib/features/digital_guide_view/general_info/presentation/widgets/headlines_section.dart @@ -22,7 +22,7 @@ class HeadlinesSection extends StatelessWidget { name, style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 24), ), - if(description.isNotEmpty) Text(description), + if (description.isNotEmpty) Text(description), ], ), ); From bbe9f96c562ee44d6802d0002b04db4decb089e2 Mon Sep 17 00:00:00 2001 From: 24bartixx Date: Thu, 12 Dec 2024 00:46:15 +0100 Subject: [PATCH 4/8] fix: improve accessibility button looks --- assets/svg/digital_guide/assistance_dog.svg | 6 +-- assets/svg/digital_guide/braille.svg | 26 ++++++------ assets/svg/digital_guide/emergency_chairs.svg | 14 +++---- assets/svg/digital_guide/induction_loop.svg | 10 ++--- assets/svg/digital_guide/large_font.svg | 10 ++--- assets/svg/digital_guide/micronavigation.svg | 14 +++---- .../svg/digital_guide/orientation_paths.svg | 40 ++++++++++--------- assets/svg/digital_guide/sign_language.svg | 2 +- .../widgets/accessibility_button.dart | 10 ++--- 9 files changed, 67 insertions(+), 65 deletions(-) diff --git a/assets/svg/digital_guide/assistance_dog.svg b/assets/svg/digital_guide/assistance_dog.svg index 954b00b2..c52f6078 100644 --- a/assets/svg/digital_guide/assistance_dog.svg +++ b/assets/svg/digital_guide/assistance_dog.svg @@ -1,8 +1,8 @@ - - - + + + diff --git a/assets/svg/digital_guide/braille.svg b/assets/svg/digital_guide/braille.svg index ce26d75a..3b1505b5 100644 --- a/assets/svg/digital_guide/braille.svg +++ b/assets/svg/digital_guide/braille.svg @@ -1,18 +1,18 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/assets/svg/digital_guide/emergency_chairs.svg b/assets/svg/digital_guide/emergency_chairs.svg index d4af9a23..dff36401 100644 --- a/assets/svg/digital_guide/emergency_chairs.svg +++ b/assets/svg/digital_guide/emergency_chairs.svg @@ -1,12 +1,12 @@ - - - - - - - + + + + + + + diff --git a/assets/svg/digital_guide/induction_loop.svg b/assets/svg/digital_guide/induction_loop.svg index 90e1ba51..5e3c12f9 100644 --- a/assets/svg/digital_guide/induction_loop.svg +++ b/assets/svg/digital_guide/induction_loop.svg @@ -1,10 +1,10 @@ - - - - - + + + + + diff --git a/assets/svg/digital_guide/large_font.svg b/assets/svg/digital_guide/large_font.svg index 47b86381..7a0261e4 100644 --- a/assets/svg/digital_guide/large_font.svg +++ b/assets/svg/digital_guide/large_font.svg @@ -1,10 +1,10 @@ - - - - - + + + + + diff --git a/assets/svg/digital_guide/micronavigation.svg b/assets/svg/digital_guide/micronavigation.svg index d9b0cf0b..a6dc67ad 100644 --- a/assets/svg/digital_guide/micronavigation.svg +++ b/assets/svg/digital_guide/micronavigation.svg @@ -1,11 +1,11 @@ - - - - - - - + + + + + + + diff --git a/assets/svg/digital_guide/orientation_paths.svg b/assets/svg/digital_guide/orientation_paths.svg index 8d5b24bb..18a5bc15 100644 --- a/assets/svg/digital_guide/orientation_paths.svg +++ b/assets/svg/digital_guide/orientation_paths.svg @@ -1,27 +1,29 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + + - - - + + + diff --git a/assets/svg/digital_guide/sign_language.svg b/assets/svg/digital_guide/sign_language.svg index 06afddc5..3ede508f 100644 --- a/assets/svg/digital_guide/sign_language.svg +++ b/assets/svg/digital_guide/sign_language.svg @@ -1,4 +1,4 @@ - + \ No newline at end of file diff --git a/lib/features/digital_guide_view/general_info/presentation/widgets/accessibility_button.dart b/lib/features/digital_guide_view/general_info/presentation/widgets/accessibility_button.dart index 8951fa11..85fbe089 100644 --- a/lib/features/digital_guide_view/general_info/presentation/widgets/accessibility_button.dart +++ b/lib/features/digital_guide_view/general_info/presentation/widgets/accessibility_button.dart @@ -15,16 +15,16 @@ class AccessibilityButton extends StatelessWidget { borderRadius: BorderRadius.circular( DigitalGuideConfig.borderRadiusMedium, ), - side: BorderSide( - color: context.colorTheme.greyPigeon, - ), + ), + side: BorderSide( + color: context.colorTheme.greyPigeon, ), backgroundColor: context.colorTheme.greyLight, minimumSize: const Size(56, 32), ), - child: const Icon( + child: Icon( Icons.accessible, - color: Colors.black, + color: context.colorTheme.blackMirage, ), ), ); From abe6aaae3f148a5d24d07ceaa903aa67c439d9c0 Mon Sep 17 00:00:00 2001 From: 24bartixx Date: Thu, 12 Dec 2024 15:50:47 +0100 Subject: [PATCH 5/8] feat: implement proper phone number handling --- .../general_info/presentation/digital_guide_view.dart | 7 ++++--- lib/features/home_view/widgets/science_clubs_section.dart | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart b/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart index c81a7578..dbb2ece3 100644 --- a/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart +++ b/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart @@ -77,9 +77,10 @@ class _DigitalGuideView extends ConsumerWidget { ContactIconsModel( text: digitalGuideResponseExtended.telephoneNumber, icon: Assets.svg.contactIcons.phone, - // TODO(Bartosh): url not working, nothing happens - url: - "tel:+48${digitalGuideResponseExtended.telephoneNumber.replaceAll("

", "").replaceAll("

", "")}", + url: () { + final match = RegExp(r"\d{9}").firstMatch(digitalGuideResponseExtended.telephoneNumber.replaceAll("+48", "")); + return match != null ? "tel:+48${match.group(0)}" : ""; + }(), ), ContactIconsModel( text: context.localize diff --git a/lib/features/home_view/widgets/science_clubs_section.dart b/lib/features/home_view/widgets/science_clubs_section.dart index ea30b7da..1d00a258 100644 --- a/lib/features/home_view/widgets/science_clubs_section.dart +++ b/lib/features/home_view/widgets/science_clubs_section.dart @@ -28,7 +28,7 @@ class ScienceClubsSection extends ConsumerWidget { ), FilledButton( onPressed: () { - unawaited(ref.navigateDigitalGuide(313)); + unawaited(ref.navigateDigitalGuide(204)); }, child: const Text("Navigate to digital guide screen!"), ), From 71c0ae5a703bc24386bcbacc6fff69ffbe492206 Mon Sep 17 00:00:00 2001 From: 24bartixx Date: Thu, 12 Dec 2024 16:05:49 +0100 Subject: [PATCH 6/8] fix: formatting --- .../general_info/presentation/digital_guide_view.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart b/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart index dbb2ece3..26592b76 100644 --- a/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart +++ b/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart @@ -78,7 +78,10 @@ class _DigitalGuideView extends ConsumerWidget { text: digitalGuideResponseExtended.telephoneNumber, icon: Assets.svg.contactIcons.phone, url: () { - final match = RegExp(r"\d{9}").firstMatch(digitalGuideResponseExtended.telephoneNumber.replaceAll("+48", "")); + final match = RegExp(r"\d{9}").firstMatch( + digitalGuideResponseExtended.telephoneNumber + .replaceAll("+48", ""), + ); return match != null ? "tel:+48${match.group(0)}" : ""; }(), ), From 5bcbe00441ab5b977582edb24bd7db29726b887a Mon Sep 17 00:00:00 2001 From: 24bartixx Date: Sun, 15 Dec 2024 00:06:49 +0100 Subject: [PATCH 7/8] refractor: change repository and view to handle multiple phone numbers --- .../data/models/digital_guide_response.dart | 11 +++++--- .../digital_guide_response_extended.dart | 6 ++--- .../presentation/digital_guide_view.dart | 27 ++++++++++++------- 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/lib/features/digital_guide_view/general_info/data/models/digital_guide_response.dart b/lib/features/digital_guide_view/general_info/data/models/digital_guide_response.dart index 5fc48050..09766d6b 100644 --- a/lib/features/digital_guide_view/general_info/data/models/digital_guide_response.dart +++ b/lib/features/digital_guide_view/general_info/data/models/digital_guide_response.dart @@ -51,8 +51,8 @@ class DigitalGuideResponse with _$DigitalGuideResponse { fromJson: _stringToBool, ) required bool areEmergencyChairs, - @JsonKey(name: "telephone_number", fromJson: _formatTelephoneNumber) - required String telephoneNumber, + @JsonKey(name: "telephone_number", fromJson: _formatPhoneNumbers) + required List phoneNumbers, @JsonKey(name: "surrounding") required int surroundingId, required List images, String? imageUrl, @@ -88,6 +88,9 @@ bool _stringToBool(String value) { return value == "True"; } -String _formatTelephoneNumber(String telephoneNumber) { - return telephoneNumber.replaceAll("

", "").replaceAll("

", ""); +List _formatPhoneNumbers(String phoneNumber) { + final matches = RegExp(r"\d{9}").allMatches( + phoneNumber.replaceAll("+48", "").replaceAll(RegExp(r"\D"), ""), + ); + return matches.map((match) => match.group(0)!).toList(); } diff --git a/lib/features/digital_guide_view/general_info/data/models/digital_guide_response_extended.dart b/lib/features/digital_guide_view/general_info/data/models/digital_guide_response_extended.dart index 7320e0ad..4ede202f 100644 --- a/lib/features/digital_guide_view/general_info/data/models/digital_guide_response_extended.dart +++ b/lib/features/digital_guide_view/general_info/data/models/digital_guide_response_extended.dart @@ -15,7 +15,7 @@ class DigitalGuideResponseExtended { required this.areLargeFontBoards, required this.isSignLanguageInterpreter, required this.areEmergencyChairs, - required this.telephoneNumber, + required this.phoneNumbers, required this.surroundingId, required this.images, required this.imageUrl, @@ -32,7 +32,7 @@ class DigitalGuideResponseExtended { final bool areLargeFontBoards; final bool isSignLanguageInterpreter; final bool areEmergencyChairs; - final String telephoneNumber; + final List phoneNumbers; final int surroundingId; final List images; final String? imageUrl; @@ -53,7 +53,7 @@ class DigitalGuideResponseExtended { areLargeFontBoards: digitalGuideResponse.areLargeFontBoards, isSignLanguageInterpreter: digitalGuideResponse.isSignLanguageInterpreter, areEmergencyChairs: digitalGuideResponse.areEmergencyChairs, - telephoneNumber: digitalGuideResponse.telephoneNumber, + phoneNumbers: digitalGuideResponse.phoneNumbers, surroundingId: digitalGuideResponse.surroundingId, images: digitalGuideResponse.images, imageUrl: imageUrl, diff --git a/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart b/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart index 26592b76..81d732f7 100644 --- a/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart +++ b/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart @@ -73,18 +73,25 @@ class _DigitalGuideView extends ConsumerWidget { .replaceAll("ulica", "ul."), icon: Assets.svg.contactIcons.compass, ), - if (digitalGuideResponseExtended.telephoneNumber.isNotEmpty) - ContactIconsModel( - text: digitalGuideResponseExtended.telephoneNumber, + ...digitalGuideResponseExtended.phoneNumbers.map( + (phoneNumber) => ContactIconsModel( + text: "+48$phoneNumber", icon: Assets.svg.contactIcons.phone, - url: () { - final match = RegExp(r"\d{9}").firstMatch( - digitalGuideResponseExtended.telephoneNumber - .replaceAll("+48", ""), - ); - return match != null ? "tel:+48${match.group(0)}" : ""; - }(), + url: "tel:+48$phoneNumber", ), + ), + // if (digitalGuideResponseExtended.phoneNumber.isNotEmpty) + // ContactIconsModel( + // text: digitalGuideResponseExtended.phoneNumber, + // icon: Assets.svg.contactIcons.phone, + // url: () { + // final match = RegExp(r"\d{9}").firstMatch( + // digitalGuideResponseExtended.phoneNumber + // .replaceAll("+48", ""), + // ); + // return match != null ? "tel:+48${match.group(0)}" : ""; + // }(), + // ), ContactIconsModel( text: context.localize .storeys(digitalGuideResponseExtended.numberOfStoreys), From 403f6cf00105e81f66a4a88499ca7efa34764604 Mon Sep 17 00:00:00 2001 From: 24bartixx Date: Sun, 15 Dec 2024 14:52:42 +0100 Subject: [PATCH 8/8] fix: delete comments --- .../presentation/digital_guide_view.dart | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart b/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart index 81d732f7..38da56b8 100644 --- a/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart +++ b/lib/features/digital_guide_view/general_info/presentation/digital_guide_view.dart @@ -80,18 +80,6 @@ class _DigitalGuideView extends ConsumerWidget { url: "tel:+48$phoneNumber", ), ), - // if (digitalGuideResponseExtended.phoneNumber.isNotEmpty) - // ContactIconsModel( - // text: digitalGuideResponseExtended.phoneNumber, - // icon: Assets.svg.contactIcons.phone, - // url: () { - // final match = RegExp(r"\d{9}").firstMatch( - // digitalGuideResponseExtended.phoneNumber - // .replaceAll("+48", ""), - // ); - // return match != null ? "tel:+48${match.group(0)}" : ""; - // }(), - // ), ContactIconsModel( text: context.localize .storeys(digitalGuideResponseExtended.numberOfStoreys),