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

Fixes #1381 Forcing App in portrait mode. #1382

Conversation

Ayush0Chaudhary
Copy link
Contributor

What kind of change does this PR introduce?

Issue Number:

Fixes #1381

Did you add tests for your changes?
no

Snapshots/Videos:

overflow.mp4

If relevant, did you update the documentation?

Summary

fixed the overflow of the qr in landscape mode. I used LayoutBuilder to manage the constraints

Does this PR introduce a breaking change?
NO

Other information
NO

Have you read the contributing guide?
yes

@palisadoes
Copy link
Contributor

@Ayush0Chaudhary Please update the test cases for this file based on your updates. We need to keep increasing our test code coverage.

SiddheshKukade
SiddheshKukade previously approved these changes Jan 6, 2023
Copy link
Member

@SiddheshKukade SiddheshKukade left a comment

Choose a reason for hiding this comment

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

Changes are looking fine to be merged. We also need to update the tests for this file.

Copy link
Contributor

@palisadoes palisadoes left a comment

Choose a reason for hiding this comment

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

@Ayush0Chaudhary Please update the test cases for this file based on your updates. We need to keep increasing our test code coverage.

@Ayush0Chaudhary
Copy link
Contributor Author

Adding the changes asap!

@Ayush0Chaudhary
Copy link
Contributor Author

Screenshot from 2023-01-07 15-18-30

I am not able to add test for portrait mode, can you help or direct me to some resource I can refer to

Couldn't find proper method on google too.
@palisadoes @SiddheshKukade

@SiddheshKukade
Copy link
Member

SiddheshKukade commented Jan 7, 2023

Screenshot from 2023-01-07 15-18-30

I am not able to add test for portrait mode, can you help or direct me to some resource I can refer to

Couldn't find proper method on google too.
@palisadoes @SiddheshKukade

Hi, you can refer to exisiting test files. Also keep an on coverage if it's 100 percent then no need to add further tests

@Ayush0Chaudhary
Copy link
Contributor Author

orientation setter is only used by me in whole app
Screenshot from 2023-01-08 16-42-12

I read 8-9 tests
But couldn't find orientation setter, the default size of screen in unittest is
Size(2400.0, 1800.0)
thus it is testing for landscape but not portrait

@palisadoes @SiddheshKukade can you help with this??

@palisadoes
Copy link
Contributor

@Ayush0Chaudhary We have decided that it will be best to disable landscape completely as it will make the app more difficult to use.

However we should think of ways to have a standard error when overflows like this occur. Please also work with @TheHazeEffect as he says he knows of a potential solution. This will be a good addition to the code base.

There is another PR #1380 where we are working on a widget to create standardized error messages. Coordinating with that PR would be good too so that you don't duplicate work.

@Ayush0Chaudhary
Copy link
Contributor Author

There won't be duplicate work, as I am also the author of #1380 @palisadoes. I will disable the landscape in my next Commit ASAP!
@TheHazeEffect Can you suggest how can we go after this issue??

@Ayush0Chaudhary
Copy link
Contributor Author

@palisadoes can you merge the PR now??

@palisadoes
Copy link
Contributor

@TheHazeEffect @SiddheshKukade please review

Copy link
Member

@SiddheshKukade SiddheshKukade 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 not sure why you've deleted the set_url_view_model_test.dart file. I think It was just a test file to check if the QR works.

Also, I will suggest renaming the PR to something like "Forcing Portrait Mode on the app"

Comment on lines +144 to +149
fs.SystemChrome.setPreferredOrientations(
[
fs.DeviceOrientation.portraitUp,
fs.DeviceOrientation.portraitDown,
],
);
Copy link
Member

Choose a reason for hiding this comment

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

This looks OK to lock the app in portrait mode. 👍🏻

@Ayush0Chaudhary Ayush0Chaudhary changed the title Fixes #1381 QR landscape overflow Fixes #1381 Forcing App in portrait mode. Jan 10, 2023
@Ayush0Chaudhary Ayush0Chaudhary force-pushed the Ayush0Chaudhary/fix-landscape-overflow branch from 01046e2 to 1a57bfc Compare January 10, 2023 06:31
@codecov-commenter
Copy link

codecov-commenter commented Jan 10, 2023

Codecov Report

Merging #1382 (b46d44a) into develop (0c9dbc2) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@             Coverage Diff             @@
##           develop    #1382      +/-   ##
===========================================
- Coverage    70.82%   70.80%   -0.02%     
===========================================
  Files          146      146              
  Lines         7207     7209       +2     
===========================================
  Hits          5104     5104              
- Misses        2103     2105       +2     
Impacted Files Coverage Δ
lib/main.dart 6.66% <0.00%> (-0.12%) ⬇️

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

@Ayush0Chaudhary
Copy link
Contributor Author

Ayush0Chaudhary commented Jan 10, 2023

I'm not sure why you've deleted the set_url_view_model_test.dart file. I think It was just a test file to check if the QR works.

Also, I will suggest renaming the PR to something like "Forcing Portrait Mode on the app"

I made the changes, @SiddheshKukade , I am new to GitHub, apologies.

@palisadoes
Copy link
Contributor

@Ayush0Chaudhary Our code coverage levels have decreased with this PR. Please add tests that cover the changes you made.

image

Copy link
Contributor

@palisadoes palisadoes left a comment

Choose a reason for hiding this comment

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

@Ayush0Chaudhary Please update the test cases for this file based on your updates. We need to keep increasing our test code coverage.

image

@Ayush0Chaudhary
Copy link
Contributor Author

Ayush0Chaudhary commented Jan 19, 2023

@palisadoes @SiddheshKukade All test are passed!!

Screenshot from 2023-01-20 02-46-55

@SiddheshKukade
Copy link
Member

Please update the code as the tests here are failing.

@Ayush0Chaudhary
Copy link
Contributor Author

Screenshot from 2023-01-26 17-07-11

@Ayush0Chaudhary
Copy link
Contributor Author

@SiddheshKukade please check, code coverage is 68.3% now.

@noman2002
Copy link
Member

@Ayush0Chaudhary the code coverage for main.dart is currently at 6.66%. Please try to get it to 100%.

@Ayush0Chaudhary
Copy link
Contributor Author

Ok got it

@Ayush0Chaudhary
Copy link
Contributor Author

@noman2002 Can we make this file unit-test as different issue?? I am facing difficulties, I cannot examples for main.dart test anywhere??

@noman2002
Copy link
Member

@noman2002 Can we make this file unit-test as different issue?? I am facing difficulties, I cannot examples for main.dart test anywhere??

@palisadoes what you say ?

@palisadoes
Copy link
Contributor

Yes, please create a separate issue for the tests

@Ayush0Chaudhary
Copy link
Contributor Author

So can we merge this PR ??@noman2002

@Ayush0Chaudhary
Copy link
Contributor Author

@noman2002 made the changes you asked for

@noman2002 noman2002 self-requested a review January 28, 2023 15:24
Copy link
Member

@noman2002 noman2002 left a comment

Choose a reason for hiding this comment

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

Please resolve the conflicts.

@Ayush0Chaudhary
Copy link
Contributor Author

@noman2002 please review.
@palisadoes

@Ayush0Chaudhary
Copy link
Contributor Author

@palisadoes @SiddheshKukade @TheHazeEffect please approve the changes!!

@Ayush0Chaudhary
Copy link
Contributor Author

@palisadoes is there a problem you see with PR, I can change it if you want

@noman2002
Copy link
Member

@palisadoes is there a problem you see with PR, I can change it if you want

There is a huge time difference between India and Jamaica. Wait for him to review the changes.

@Ayush0Chaudhary
Copy link
Contributor Author

@palisadoes is there a problem you see with PR, I can change it if you want

There is a huge time difference between India and Jamaica. Wait for him to review the changes.

ok @noman2002, thank you

@palisadoes palisadoes merged commit a8ca909 into PalisadoesFoundation:develop Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Overflow on set_url page in landscape mode
5 participants