-
-
Notifications
You must be signed in to change notification settings - Fork 288
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: Contribute to your country link #5874
base: develop
Are you sure you want to change the base?
feat: Contribute to your country link #5874
Conversation
…jnnabugwu/smooth-app into contribute-to-your-country-link
…tribute.dart Co-authored-by: monsieurtanuki <[email protected]>
…jnnabugwu/smooth-app into contribute-to-your-country-link
…jnnabugwu/smooth-app into contribute-to-your-country-link
…our-country-link' of https://github.com/jnnabugwu/smooth-app into contribute-to-your-country-link
…jnnabugwu/smooth-app into contribute-to-your-country-link
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5874 +/- ##
==========================================
- Coverage 9.54% 6.85% -2.70%
==========================================
Files 325 428 +103
Lines 16411 23598 +7187
==========================================
+ Hits 1567 1617 +50
- Misses 14844 21981 +7137 ☔ View full report in Codecov by Sentry. |
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.
Hi @jnnabugwu!
Please have a look at my comments!
@@ -319,6 +335,19 @@ class UserPreferencesContribute extends AbstractUserPreferences { | |||
builder: (_) => tile, | |||
); | |||
} | |||
|
|||
Future<String> returnCountry(BuildContext context) async { |
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.
Please remove that method, we don't need it.
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.
Whoops yeah thats my bad
@@ -0,0 +1,25 @@ | |||
// TODO(monsieurtanuki): the code is to be moved to openfoodfacts-dart | |||
class TmpCountryWikiLinks { | |||
final Map<String, String> wikiLinks = <String, String>{ |
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.
final Map<String, String> wikiLinks = <String, String>{ | |
static final Map<OpenFoodFactsCountry, String> wikiLinks = <OpenFoodFactsCountry, String>{ |
@@ -94,6 +96,20 @@ class UserPreferencesContribute extends AbstractUserPreferences { | |||
() async => _share(appLocalizations.contribute_share_content), | |||
Icons.adaptive.share, | |||
), | |||
_getListTile( |
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.
We display nothing if the country has no wiki links.
_getListTile( | ||
appLocalizations.help_improve_country, | ||
() async { | ||
final String country = await returnCountry(context); |
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.
Please use ProductQuery.getCountry() instead.
What
feat: Added a method and map to get the correct country locale for the corresponding wiki page.
Screenshot
Fixes bug(s)
Part of