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

gamepads not working #29

Open
robertmuth opened this issue May 12, 2023 · 1 comment
Open

gamepads not working #29

robertmuth opened this issue May 12, 2023 · 1 comment

Comments

@robertmuth
Copy link

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)
@jodinathan
Copy link
Owner

can you try my new package Typings?

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