Closed Pawankant87 closed 3 months ago
@Pawankant87 Try, registering the context in your FlickManager
using the registerContext
method when initializing. This error occurs when you're not registering the context and then use the handleChangeVideo method. Feel free to let us know if you get any issues.
@rohitprajapatii I tried that but still getting same null check operator error.
void initFlickManager() { flickManager = FlickManager( videoPlayerController: _videoPlayerController, onVideoEnd: () async { if (!widget.video.done) { widget.video.done = true; await widget.addVideoRewardsAndActivity(); } }); flickManager.registerContext(context); }
this line couse the error.
if (autoPlay && ModalRoute.of(_flickManager._context!)!.isCurrent)
because has initialized before the contractor of FlickManager
Added a fix in this PR: https://github.com/GeekyAnts/flick-video-player/pull/284/files.
Added a fix in this PR: https://github.com/GeekyAnts/flick-video-player/pull/284/files.
Yes it fixed but we have to update package code, do you have another solution for now?
I'll merge release this soon.
Released 0.9.0.
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Null check operator used on a null value
0 FlickVideoManager._changeVideo (package:flick_video_player/src/manager/video_manager.dart:144:57)