-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add report button functionality - open email app #484
Merged
Merged
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
4c7de14
feat: add report button functionality - open email app
24bartixx de3a969
fix: add horizontal padding
24bartixx f794ec3
fix: padding
24bartixx 4068d6b
fix: toast
24bartixx ea03eba
fix: adjsut toast color and gravity
24bartixx 2ca2955
fix: lint rules
24bartixx d0e1fe5
refractor: utilize existing extension
24bartixx 518738d
refractor: move function that opens email app to a lambda expression
24bartixx b68d72d
feat: handle digital guide source info tap
24bartixx d206c1b
refractor: move emailUrl string from a direct declaration to a final …
24bartixx 688b30f
fix: formatting
24bartixx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 32 additions & 18 deletions
50
.../digital_guide_view/general_info/presentation/widgets/digital_guide_data_source_link.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,46 @@ | ||
import "package:flutter/gestures.dart"; | ||
import "package:flutter/widgets.dart"; | ||
import "package:flutter_riverpod/flutter_riverpod.dart"; | ||
|
||
import "../../../../../config/ui_config.dart"; | ||
import "../../../../../theme/app_theme.dart"; | ||
import "../../../../../utils/context_extensions.dart"; | ||
import "../../../../../utils/launch_url_util.dart"; | ||
|
||
class DigitalGuideDataSourceLink extends ConsumerWidget { | ||
@override | ||
Widget build(BuildContext context, WidgetRef ref) { | ||
return Text.rich( | ||
TextSpan( | ||
text: "${context.localize.data_come_from_website}: ", | ||
style: const TextStyle( | ||
fontWeight: FontWeight.bold, | ||
), | ||
children: [ | ||
TextSpan( | ||
text: context.localize.digital_guide_website, | ||
style: context.textTheme.bodyOrange.copyWith( | ||
decoration: TextDecoration.underline, | ||
decorationColor: context.colorTheme.orangePomegranade, | ||
fontWeight: FontWeight.bold, | ||
), | ||
// TODO(Bartosh): on tap url handling -> webbrowser launch | ||
return Padding( | ||
padding: const EdgeInsets.symmetric( | ||
horizontal: DigitalGuideConfig.paddingMedium, | ||
), | ||
child: Text.rich( | ||
TextSpan( | ||
text: "${context.localize.data_come_from_website}: ", | ||
style: const TextStyle( | ||
fontWeight: FontWeight.bold, | ||
), | ||
], | ||
children: [ | ||
TextSpan( | ||
text: context.localize.digital_guide_website, | ||
style: context.textTheme.bodyOrange.copyWith( | ||
decoration: TextDecoration.underline, | ||
decorationColor: context.colorTheme.orangePomegranade, | ||
fontWeight: FontWeight.bold, | ||
), | ||
recognizer: TapGestureRecognizer() | ||
..onTap = () async { | ||
await ref.launch( | ||
context.localize.digital_guide_website | ||
.replaceAll("www.", "https://"), | ||
); | ||
}, | ||
), | ||
], | ||
), | ||
textAlign: TextAlign.center, | ||
style: context.textTheme.body, | ||
), | ||
textAlign: TextAlign.center, | ||
style: context.textTheme.body, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -151,8 +151,11 @@ | |
"about_the_app": "O aplikacji", | ||
"other_view" : "Inne", | ||
"map" : "Mapa", | ||
"change_report_title" : "Coś się zmieniło?", | ||
"change_report_button" : "Zgłoś zmianę", | ||
"report_change_title" : "Coś się zmieniło?", | ||
"report_change_button" : "Zgłoś zmianę", | ||
"report_change_email" : "[email protected]", | ||
"report_change_subject" : "Sugestia zmiany - ToPWR", | ||
"report_change_error_toast_message" : "Nie można otworzyć aplikacji mailowej", | ||
"localization" : "Lokalizacja", | ||
"amenities" : "Udogodnienia", | ||
"surroundings": "Otoczenie", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be stored inside variable but i leave it up to you if u want to change it.