You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I obviously have this code behind a kIsWeb, such that this code is never run on Android or iOS.
However, when I try to build my project for android I get the following error:
`
Error: Method 'close' cannot be called on 'WindowBase?' because it is potentially null.
'WindowBase' is from 'package:universal_html/src/html.dart' ('../../../AppData/Local/Pub/Cache/hosted/pub.dev/universal_html-2.2.4/lib/src/html.dart').
Try calling using ?. instead.
other.close();
^^^^^
`
As the error states, this can be fixed by changing the code to other?.close();, however my VScode complains about this stating that "The receiver can't be null, so the null-aware operator '?.' is unnecessary."
Thus it seems like the return value of .open is not nullable on web, but nullable on other platforms.
The text was updated successfully, but these errors were encountered:
Such tiny interface differences were incorporated when adding null safety. And were not noticed for functions that are not very usable on io side (like window.open)
universal_html interfaces should be consistent with those of dart:html
You can confirm that dart interface for version we support 2.17.0 returns WindowBase (non nullable)
The following code works correctly on web:
I obviously have this code behind a
kIsWeb
, such that this code is never run on Android or iOS.However, when I try to build my project for android I get the following error:
`
Error: Method 'close' cannot be called on 'WindowBase?' because it is potentially null.
Try calling using ?. instead.
other.close();
^^^^^
`
As the error states, this can be fixed by changing the code to
other?.close();
, however my VScode complains about this stating that "The receiver can't be null, so the null-aware operator '?.' is unnecessary."Thus it seems like the return value of .open is not nullable on web, but nullable on other platforms.
The text was updated successfully, but these errors were encountered: