Open furugenict8 opened 2 years ago
Welcome to SO, You are running with Null Safety Enbaled in your project. You have declared your all fields required and non-null in your Data Model Class. あなたのプロジェクトでは、Null Safety Enbaledで実行されています。データモデルクラスで、すべてのフィールドを必須かつ非NULLと宣言しています。
Your API response is having a field absent or having a null value, that's why you are facing this issue. APIレスポンスにフィールドがない、またはNULL値があるため、この問題に直面しています。
Solution: Replacing int with int? (making fields optional will resolve issue).Read 解決方法intをintに置き換える?(に置き換える(フィールドをオプションにすると解決する).Read
このサンプルみると、 int idで定義しているが、読んできているjsonのidのところがnullだからかなーと、 だからint? id みたいに定義しないとダメってことらしい。
自分に置き換えると
flutter: type 'Null' is not a subtype of type 'num'
のnumが何かってことだが、
seekTo()ででているのはcurrentPosition(Duration型)が近いのかなと思う。
ただ、seekバーで動かしている時も出ると考えると、このcurrentPositionではなく、youtubePlayerの中のどこかで起きていることなのかもしれない。自分のコードではなく。
後回しにしようかな? 動いているので後回しにする。
概要
youtube_player_flutterのplayerをseek バー操作してたり、 ListTIleをonTapしていると出てくる。 (出てこないこともある。) seekしたり、該当の箇所へのスキップ操作はできている。
To Reproduce Steps to reproduce the behavior:
Expected behavior 問題なく動く
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context 毎回出るのではなく、出る時と出ない時がある。 androidとか、別の機種で出るかは不明。
関連タスク
99