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: Allow to change the camera mode without restarting #3008

Merged

Conversation

g123k
Copy link
Collaborator

@g123k g123k commented Sep 13, 2022

What

  • Currently, we have to restart the app for the alternative camera mode to be taken into account
  • This PR now allows us to do it immediately

An improvement for #2741

@g123k g123k added the camera label Sep 13, 2022
@g123k g123k self-assigned this Sep 13, 2022
@g123k g123k requested a review from a team as a code owner September 13, 2022 07:25
@codecov-commenter
Copy link

Codecov Report

Merging #3008 (9e9549c) into develop (d61596e) will increase coverage by 0.00%.
The diff coverage is 7.14%.

@@           Coverage Diff           @@
##           develop   #3008   +/-   ##
=======================================
  Coverage     6.51%   6.51%           
=======================================
  Files          244     244           
  Lines        12026   12025    -1     
=======================================
  Hits           784     784           
+ Misses       11242   11241    -1     
Impacted Files Coverage Δ
...ckages/smooth_app/lib/helpers/provider_helper.dart 0.00% <0.00%> (ø)
...b/pages/preferences/user_preferences_settings.dart 11.18% <ø> (+0.77%) ⬆️
...s/smooth_app/lib/pages/scan/camera_controller.dart 0.75% <0.00%> (-0.05%) ⬇️
...es/smooth_app/lib/pages/scan/ml_kit_scan_page.dart 0.45% <0.00%> (-0.01%) ⬇️
...s/smooth_app/lib/data_models/user_preferences.dart 8.91% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@M123-dev M123-dev left a comment

Choose a reason for hiding this comment

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

The code as such looks good @g123k but why is one of the light goldens now dark

@g123k
Copy link
Collaborator Author

g123k commented Sep 13, 2022

The code as such looks good @g123k but why is one of the light goldens now dark

Mmm you're right.
I've tried to regenerate the goldens and still have the same issue.

The command is flutter test --update-goldens, isn't-it?

@M123-dev
Copy link
Member

Yes the command is right, I just had a look at test/pages/user_preferences_page_test,dart there we have:

userPreferences = await UserPreferences.getUserPreferences(); in a for loop for light/dark so this makes sense. I guess the solution would be to create the instance before the loop and then change the value on the fly.

Copy link
Member

@M123-dev M123-dev left a comment

Choose a reason for hiding this comment

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

I'm approving as this isn't problem with the code just a thing we have to change in the tests, please fix that besides that everything looks good 👍🏼

@teolemon teolemon merged commit acb5fac into openfoodfacts:develop Sep 14, 2022
@g123k g123k deleted the change_camera_mode_without_restart branch December 30, 2024 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants