-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Fix signature errors to account for strong mode errors #380
Conversation
flutter/flutter#14556 (issues encountered when running flutter gallery in strong mode).
@a-siva what SDK version ranges does this need to work with? In particular, does it need to work with pre dev.21 releases, or can it use the new core lib methods? |
I think @mravn-google would have to answer that question as he owns this package. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@@ -173,14 +174,15 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> { | |||
value = value.copyWith(isPlaying: false); | |||
timer?.cancel(); | |||
} else if (map["event"] == "bufferingUpdate") { | |||
final List<List<int>> bufferedValues = map["values"]; | |||
final List<dynamic> bufferedValues = map["values"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could consider using
List<List> bufferedValues = map["values"].cast();
if you wanted to preserve more of the types (and if you are able to use .cast which is available starting in dev.21). This would allow toDurationRange to be typed to take List.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I made the change suggested by you
List bufferedValues = map["values"].cast();
I get the following analyzer errors
info - Specify type annotations at lib/video_player.dart:176:20 - (always_specify_types)
info - Specify type annotations at lib/video_player.dart:176:62 - (always_specify_types)
not sure what to make of it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not too familiar with always_specify_types, but I'd bet it requires you to write List explicitly instead of just List (and similarly List<List> instead of List).
@@ -173,14 +173,16 @@ class VideoPlayerController extends ValueNotifier<VideoPlayerValue> { | |||
value = value.copyWith(isPlaying: false); | |||
timer?.cancel(); | |||
} else if (map["event"] == "bufferingUpdate") { | |||
final List<List<int>> bufferedValues = map["values"]; | |||
final List<List<dynamic>> bufferedValues = | |||
map["values"].cast<List<List<dynamic>>>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be .cast<List>().
What can i do about this program being used on me? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to bump the version in pubspec.yaml and also declare the correct Dart SDK version dependency there.
Fix signature errors to account for strong mode errors in
flutter/flutter#14556
(issues encountered when running flutter gallery in strong mode).