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
{{ message }}
Repository navigation
[pigeon] "decode" casts fail in sound null-safe mode. #76405
class PositionMessage {
int? textureId;
int? position;
Object encode() {
final Map<Object?, Object?> pigeonMap = <Object?, Object?>{};
pigeonMap['textureId'] = textureId;
pigeonMap['position'] = position;
return pigeonMap;
}
static PositionMessage decode(Object message) {
final Map<Object?, Object?> pigeonMap = message as Map<Object?, Object?>;
return PositionMessage()
..textureId = pigeonMap['textureId'] as int
..position = pigeonMap['position'] as int;
}
}
In sound null-safe mode, the decode method might have null values in textureId and position, so the cast as int fails:
type 'Null' is not a subtype of type 'int' in type cast
package:video_player_platform_interface/messages.dart 121:44 PositionMessage.decode
package:video_player_platform_interface/messages.dart 339:30 VideoPlayerApi.position
Shouldn't the as casts match the type of the attribute they're casting to? if int? textureId, shouldn't the decode cast to: as int?
Steps to Reproduce
Attempt to run the video_player_platform_interface tests in null-safe mode (flutter channel master, for example):
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
ditman commentedon Feb 19, 2021
/cc @blasten @gaaclarke?
ditman commentedon Feb 19, 2021
This seems to be only affecting tests (for now) because of this:
https://github.com/flutter/plugins/blob/master/packages/video_player/video_player_platform_interface/lib/test.dart#L48
The message to decode might be incomplete.
xster commentedon Apr 16, 2021
@gaaclarke this is fixed now right?
gaaclarke commentedon Apr 16, 2021
Yea, i just checked the output. I think it got fixed here: flutter/packages@1313c80#diff-0586de4d30521ddc85ce6b0c29ea52bbb41577fbd7f2cf4eb4d19e48d3f525cfR210
github-actions commentedon Aug 2, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.