Skip to content
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: 5817 Product page: tab Data #5953

Open
wants to merge 18 commits into
base: develop
Choose a base branch
from

Conversation

AdrienMDevMobile
Copy link

@AdrienMDevMobile AdrienMDevMobile commented Nov 27, 2024

What

  • feat 5814 : Product page: tab data
  • TODOs left :
  • getting nutritions Metrics
  • Edit element on click action

Screenshot

Screenshot 2024-12-09 at 15 58 00

Fixes bug(s)

  • Fixes:

Part of

@AdrienMDevMobile AdrienMDevMobile changed the title Feat: 5817 Product page: tab Data feat: 5817 Product page: tab Data Nov 27, 2024
@AdrienMDevMobile
Copy link
Author

@g123k could you tell me please, if squash on merge is allowed on this project ?

@g123k
Copy link
Collaborator

g123k commented Nov 27, 2024

@g123k could you tell me please, if squash on merge is allowed on this project ?

Yes, that's what we do:
Screenshot 2024-11-27 at 17 32 13

@teolemon
Copy link
Member

info • To-do comment doesn't follow the Flutter style • packages/smooth_app/lib/pages/product/product_page/raw_data/product_raw_data_category_item.dart:98:26 • flutter_style_todos
   info • Unnecessary use of double quotes • packages/smooth_app/lib/pages/product/product_page/raw_data/product_raw_data_element_item.dart:19:29 • prefer_single_quotes
   info • To-do comment doesn't follow the Flutter style • packages/smooth_app/lib/pages/product/product_page/raw_data/product_raw_data_element_item.dart:19:44 • flutter_style_todos
   info • Use 'const' with the constructor to improve performance • packages/smooth_app/lib/pages/product/product_page/raw_data/product_raw_data_page.dart:22:31 • prefer_const_constructors
   info • Unnecessary use of double quotes • packages/smooth_app/lib/pages/product/product_page/raw_data/product_raw_data_page.dart:22:36 • prefer_single_quotes
   info • Use 'const' with the constructor to improve performance • packages/smooth_app/lib/pages/product/product_page/raw_data/product_raw_data_page.dart:24:26 • prefer_const_constructors
   info • To-do comment doesn't follow the Flutter style • packages/smooth_app/lib/pages/product/product_page/raw_data/product_raw_data_page.dart:24:63 • flutter_style_todos
   info • A value for optional parameter 'controller' isn't ever given • packages/smooth_app/lib/pages/product/product_page/raw_data/product_raw_data_page.dart:29:49 • unused_element
   info • Use 'const' with the constructor to improve performance • packages/smooth_app/lib/pages/product/product_page/raw_data/product_raw_data_page.dart:40:[11](https://github.com/openfoodfacts/smooth-app/actions/runs/12053739973/job/33610932110?pr=5953#step:8:12) • prefer_const_constructors

@AdrienMDevMobile AdrienMDevMobile marked this pull request as ready for review December 9, 2024 14:59
@alexgarel
Copy link
Member

@AdrienMDevMobile don't hesitate to ping people in #mobile-app when a PR is ready, as most of us are a bit overwhelmed by github notifications !

@teolemon teolemon requested a review from g123k December 10, 2024 18:05
@g123k
Copy link
Collaborator

g123k commented Dec 11, 2024

Copy link
Collaborator

@g123k g123k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi!
Here are some suggestions about the syntax/conventions with our codebase

appLocalizations.edit_product_form_item_stores_title,
};

AppIcon toAppIcon() => switch (this) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case, return the more generic Widget here

? const Color.fromRGBO(228, 228, 228, 1.0)
: Colors.white;

return Container(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you use just 1 element from a Container, please use the correct Widget directly.
Here it's a Padding.

: Colors.white;

return Container(
margin: const EdgeInsets.only(left: 90.0),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid EdgeInsets and prefer the more generic EdgeInsetsDirectional

controller: widget.controller,
physics: const ClampingScrollPhysics(),
shrinkWrap: true,
padding: const EdgeInsets.symmetric(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here + when you have semi-values like, please switch to a predefined constant (eg: MEDIUM_SPACE)

child: ListView.separated(
controller: widget.controller,
physics: const ClampingScrollPhysics(),
shrinkWrap: true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ShrinkWrap is your enemy. Why do you use it?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is wrong with ShrinkWrap ?

In my case, it is needed to not have a crash due to ListView inside the other list view.

],
),
),
Divider(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need a Divider of 0?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the divider default value is not 0 but 16


class ProductRawDataElementItem extends StatelessWidget {
const ProductRawDataElementItem(this.element, this.onSeeMoreTap,
{this.controller});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing trailing comma

children: [
Text((element as ProductRawDataElementDoubleText).text2),
const SizedBox(
width: 29,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By convention, when we have double, we use 29.0

{
final AppLocalizations appLocalizations =
AppLocalizations.of(context);
return GestureDetector(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're not fans of GestureDetector. Could you use an InkWell instead?

return Scaffold(
body: ListView.separated(
itemCount: productRawDatas.length,
separatorBuilder: (BuildContext context, _) => Divider(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, why a Divider of 0?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//remove default margin between elements

@teolemon teolemon requested a review from g123k January 3, 2025 15:11
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 6.50%. Comparing base (4d9c7fc) to head (fab901a).
Report is 602 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff             @@
##           develop   #5953      +/-   ##
==========================================
- Coverage     9.54%   6.50%   -3.05%     
==========================================
  Files          325     441     +116     
  Lines        16411   24982    +8571     
==========================================
+ Hits          1567    1624      +57     
- Misses       14844   23358    +8514     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

5 participants