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

Require orientation property on device object with proper binding #1700

Open
mehsaandev opened this issue Oct 25, 2024 · 1 comment
Open
Assignees

Comments

@mehsaandev
Copy link
Contributor

mehsaandev commented Oct 25, 2024

Requirements:
My requirement is that the screen below has a chart and details below it. When I rotate my phone, it should only show me the chart on full screen in landscape mode.

Screen:

Suggested Solution:

  • We can add orientation property in device object which has the value of the current orientation mode and that's either portrait or landscape.
  • The use of the property will be like this: device.orientation. and on the basis of orientation value, we can make some conditional rendering to achieve the required view.
  • Please make sure the bindings fire properly when orientation changes. The device info currently does not update after the initial load so we do need to enhance it.
@mehsaandev
Copy link
Contributor Author

I've pushed my code in device_orientation branch.
here's the link to the file in which I've added orientation property:
https://github.com/EnsembleUI/ensemble/blob/1e2279106f46770b872468e0f2eb3cf3086f61ea/modules/ensemble/lib/framework/device.dart
Please test it and you may need to enhance the functionality in order to have proper live binding.

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

No branches or pull requests

2 participants