Skip to content

Conversation

@Aarush-Acharya
Copy link
Contributor

@Aarush-Acharya Aarush-Acharya commented Aug 3, 2023

Took care of all the widgets using ratios via Get.height and Get.width. Made the UI generic and responsive to adapt to almost all the screen sizes

closes #104

Screenshot 2023-08-03 at 2 00 43 AM

@Aarush-Acharya
Copy link
Contributor Author

Aarush-Acharya commented Aug 3, 2023

Hey @chandansgowda I am done with the changes that were to be made by me, please do review the PR and suggest the required changes if any

Copy link
Member

@chandansgowda chandansgowda left a comment

Choose a reason for hiding this comment

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

Great job @Aarush-Acharya

Icons.ac_unit,
color: Colors.amber,
size: 30,
size: 0.01825*Get.height+0.0364*Get.width,
Copy link
Member

Choose a reason for hiding this comment

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

how are we coming with these random ratios ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, the size of the icon needed to be changed not just by the width or the height has to take into account both of them so in order to make the UI accurately responsive I divided sizes for Icons and Texts into two equal parts and converted one part into the ratio to the height (the values are ratio to the height of the screen at which everything looked perfect) while other into ratio to the width of the ideal/original screen.

Example:
30/2 = 15,
15/821.7 (height of the original screen) = 0.01825
15/411.4 (width of the original screen) = 0.0364

Hence the new representation of 30: 0.01825Get.height + 0.0364Get.width

This way both height and width can equally contribute to these sizes did this for all the Text and Icon sizes throughout the UI

Comment on lines 77 to 73
errorStyle: TextStyle(
fontSize:
0.0085 * Get.height + 0.017 * Get.width),
suffixIcon: IconButton(
Copy link
Member

Choose a reason for hiding this comment

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

same with these ratios ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Here I converted the default text size to dynamic to attain a precision of responsiveness default text size in Dart is 14

so 7 goes for the height and 7 for the width
7/411.4 (width of the original screen) = 0.017...
7/821.7 (height of the original screen) = 0.0085....

Text(
widget.room.name,
style: TextStyle(fontSize: 20, color: Colors.amber),
style: TextStyle(fontSize: 0.012*Get.height+0.0243*Get.width, color: Colors.amber),
Copy link
Member

Choose a reason for hiding this comment

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

these as well. Please try not to use such constant values.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did this to make the static size 20 into dynamic with respect to height and width again divided 20 into 10 for height and 10 for width and applied the stated methodology

@jddeep
Copy link
Member

jddeep commented Aug 4, 2023

how can you say height of every screen the app is opened is 821 and width is 411 ? @Aarush-Acharya

@Aarush-Acharya
Copy link
Contributor Author

Aarush-Acharya commented Aug 4, 2023

Hey @jddeep Well the ratios are extracted from the height and width of the original screen and then

Get.height returns the height of the current screen
Get.width returns the width of the current screen

So by extracting the ratios from the original screen and then putting the sizes in accordance to that ratio to the current height and width the UI is turned responsive (the result of this is presented in an image above)

Apologies for not priorly providing the entire context, do let me know if I am going wrong somewhere

@jddeep
Copy link
Member

jddeep commented Aug 5, 2023

@Aarush-Acharya then put those two values in the constants file and use from there everywhere. It will be difficult to understand otherwise.
@chandansgowda have you tested this across different devices (all possible) ?

@chandansgowda
Copy link
Member

@jddeep I have tested it on three of my virtual devices. Can you please suggest ways to test it on all devices ?

@Aarush-Acharya
Copy link
Contributor Author

Aarush-Acharya commented Aug 5, 2023

@jddeep would do so also rather than just the constant values shall I put the whole expression 0.012*Get.height+0.0243*Get.width in constant files
would suggest by the nomenclature and comment what size that expression represents and would just use different sizes from here across the application

OR

Shall I make it like this

Screenshot 2023-08-05 at 11 47 55 AM

@jddeep which every you prefer

Also, I have a prior commitment till the 7th morning would be able to work later that morning

@jddeep
Copy link
Member

jddeep commented Aug 7, 2023

@Aarush-Acharya second way is fine. Just put the values 821 and 411 in a constant file and use from there everywhere.

@chandansgowda
Copy link
Member

@Aarush-Acharya Better if you can create a new file called ui_constants.dart and put everything there.

@jddeep
Copy link
Member

jddeep commented Aug 9, 2023

@Aarush-Acharya @chandansgowda Please resolve conflicts

@chandansgowda
Copy link
Member

chandansgowda commented Aug 9, 2023

@Aarush-Acharya @chandansgowda Please resolve conflicts

@jddeep Sure. He's still working on the PR.

@Aarush-Acharya
Copy link
Contributor Author

@jddeep @chandansgowda apologies for the delay will commit it by EOD

@jddeep
Copy link
Member

jddeep commented Aug 11, 2023

@Aarush-Acharya Please resolve conflicts

@Aarush-Acharya
Copy link
Contributor Author

Alright on it

@Aarush-Acharya
Copy link
Contributor Author

To be cleaned

  • create_room_screen.dart
  • discussions_screen.dart
  • email_verification_screen.dart
  • home_screen.dart
  • login_screen.dart
  • onboarding_screen.dart
  • profile_screen.dart
  • room_screen.dart
  • signup_screen.dart
  • splash_screen.dart
  • tabview_screen.dart

@jddeep jddeep merged commit 38cb2cf into AOSSIE-Org:master Aug 12, 2023
@Aarush-Acharya
Copy link
Contributor Author

Hey @jddeep this PR was still underwork 2 screen have been built and improvements were on the way shall I create a new PR for the rest of the updates

@chandansgowda chandansgowda mentioned this pull request Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

design enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Profile screen crashes on first login

3 participants