Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Fix signature errors to account for strong mode errors #380

Merged
merged 7 commits into from
Feb 10, 2018

Conversation

a-siva
Copy link
Contributor

@a-siva a-siva commented Feb 9, 2018

Fix signature errors to account for strong mode errors in
flutter/flutter#14556
(issues encountered when running flutter gallery in strong mode).

flutter/flutter#14556
(issues encountered when running flutter gallery in strong mode).
@leafpetersen
Copy link

@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?

@a-siva
Copy link
Contributor Author

a-siva commented Feb 9, 2018

I think @mravn-google would have to answer that question as he owns this package.
We have updated flutter to use 2.0.dev.22 and I would assume it does not have to work with a pre 2.0.dev.22 version.

Copy link

@leafpetersen leafpetersen left a 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"];

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.

Copy link
Contributor Author

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.

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>>>();

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>().

@jeckal1171
Copy link

What can i do about this program being used on me?

@a-siva a-siva merged commit f871961 into flutter:master Feb 10, 2018
Copy link
Contributor

@mravn-google mravn-google left a 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.

@a-siva a-siva deleted the fix-strong-mode branch February 12, 2018 04:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants