This is using dart 2.19.0 in debug mode (does not work in release mode either)
Code is roughly:
import 'package:js_bindings/js_bindings.dart' as JS;
....
dynamic pads = JS.window.navigator.getGamepads();
print("Found pads ${pads}");
...
The print statement is not reached. The JS console says:
terable<self.Gamepad>?', but got one of type 'List<dynamic>'
at Object.throw_ [as throw] (errors.dart:263:21)
at Object.castError (errors.dart:99:3)
at Object.cast [as as] (operations.dart:485:10)
at dart.NullableType.new.as (types.dart:399:9)
at Object._callMethodUnchecked0 (js_util_patch.dart:93:3)
at Object.PropsNavigator$124getGamepads [as PropsNavigator|getGamepads] (html.dart:8921:15)
This is using dart 2.19.0 in debug mode (does not work in release mode either)
Code is roughly:
The print statement is not reached. The JS console says: