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

window.orientation missing from Dart #15230

Closed
DartBot opened this issue Nov 21, 2013 · 7 comments
Closed

window.orientation missing from Dart #15230

DartBot opened this issue Nov 21, 2013 · 7 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-obsolete Closed as the reported issue is no longer relevant library-html

Comments

@DartBot
Copy link

DartBot commented Nov 21, 2013

This issue was originally filed by tommytech199...@gmail.com


While writing a switch in dart calling the window.orientation as the switch's argument,the Dart Editor gives the warning 'there is no such getter 'orientation' in 'Window'' and gives the breaking exception, 'Class 'Window' has no instance getter 'orientation'' Because of this, switches that depend on getting the orientation of window for example this basic one:

switch(window.orientation) {
     case 0:
          //code here
          break;
     case -90:
          //device is in right orientation code
          break;
     case 90:
          //code for a device that is flipped left
          break;
     case 180:
          //code for a device with orientation flipped
          break;
}

will result in the Dart Editor giving the warning even though window.orientation is at this time supported by Blink.

@sethladd
Copy link
Contributor

Confirming that the code works in JavaScript ?


Added Area-HTML, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Nov 21, 2013

This comment was originally written by tommytech...@gmail.com


Going to: http://fiddle.jshell.net/rq95F/show/
on a mobile device uses window.orientation to show the orientation of the screen.

@sethladd
Copy link
Contributor

So this API exists in Chrome for Mobile but not Chrome for Desktop?

@blois
Copy link
Contributor

blois commented Nov 22, 2013

In the meantime, should be able to access this on mobile via JS interop.

@kevmoo
Copy link
Member

kevmoo commented Apr 7, 2014

Removed Area-HTML label.
Added Area-Library, Library-Html labels.

@alan-knight
Copy link
Contributor

This is present in 1.8. It returns null on Firefox and Safari, but they don't support it.


Added AssumedStale label.

@DartBot DartBot added Type-Defect area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-html closed-obsolete Closed as the reported issue is no longer relevant labels Jan 20, 2015
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. closed-obsolete Closed as the reported issue is no longer relevant library-html
Projects
None yet
Development

No branches or pull requests

5 participants