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

Refactoring: smaller dart files #1712

Open
1 task
monsieurtanuki opened this issue Apr 29, 2022 · 2 comments
Open
1 task

Refactoring: smaller dart files #1712

monsieurtanuki opened this issue Apr 29, 2022 · 2 comments
Milestone

Comments

@monsieurtanuki
Copy link
Contributor

monsieurtanuki commented Apr 29, 2022

Just a suggestion: once in a while, if we find "too big" dart files, we should split them in several dart files.
Could be helpful for focus and maintenance reasons.

Counting the lines in shell:

find . -name "*.dart" -exec wc -l {} \; | sort -nr

First results:

     667 ./generic_lib/dialogs/smooth_category_picker.dart
     617 ./pages/product/summary_card.dart
     478 ./pages/product/common/product_query_page.dart
     469 ./pages/product/nutrition_page_loaded.dart
     433 ./pages/question_page.dart
     356 ./pages/user_preferences_dev_mode.dart
     356 ./pages/product/new_product_page.dart
     356 ./cards/product_cards/knowledge_panels/knowledge_panel_table_card.dart
     350 ./pages/product/common/product_list_page.dart
     335 ./pages/user_management/sign_up_page.dart
     334 ./pages/product/edit_ingredients_page.dart
     317 ./pages/product/nutrition_container.dart
...

Subtasks:

@adilwahla
Copy link

sir can i do this?

@monsieurtanuki
Copy link
Contributor Author

@adilwahla I'm not a big fan of refactoring for refactoring, especially as there's plenty to do in "real" code.
This issue is more like a "warning" to developers: "hey, when you code, don't write files that are too long, and if you can, split them, for clarity".
That said, what about first refreshing the top 10 list of longer dart files in the app, with their number of lines?

@github-actions github-actions bot added ⭐ top issue Top issue. and removed ⭐ top issue Top issue. labels Jan 30, 2023
@github-actions github-actions bot removed the ⭐ top issue Top issue. label Feb 8, 2023
@github-actions github-actions bot added the ⭐ top issue Top issue. label Mar 23, 2023
@github-actions github-actions bot removed the ⭐ top issue Top issue. label Jun 2, 2024
@github-actions github-actions bot added ⭐ top issue Top issue. and removed ⭐ top issue Top issue. labels Jun 15, 2024
@github-actions github-actions bot removed the ⭐ top issue Top issue. label Jul 20, 2024
@github-actions github-actions bot added the ⭐ top issue Top issue. label Nov 12, 2024
@github-actions github-actions bot added ⭐ top issue Top issue. and removed ⭐ top issue Top issue. labels Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 💬 To discuss and validate
Development

No branches or pull requests

3 participants