제목이 참 길다.
이번에 발생한 문제는
class VideoPreview extends ConsumerStatefulWidget {
final File video;
const VideoPreview({Key? key, required this.video}) : super(key: key);
VideoPreviewState createState() => VideoPreviewState();
}
class VideoPreviewState extends ConsumerState{
Trimmer trimmer = Trimmer();
bool trimmerLoaded = false;
void initState() {
trimmer.loadVideo(videoFile: widget.video); // error
}
}
ConsumerState에서 param으로 받아온 video에 접근할 수 없는 문제였다.
class VideoPreview extends ConsumerStatefulWidget {
final File video;
const VideoPreview({Key? key, required this.video}) : super(key: key);
VideoPreviewState createState() => VideoPreviewState();
}
class VideoPreviewState extends ConsumerState<VideoPreview>{
Trimmer trimmer = Trimmer();
bool trimmerLoaded = false;
void initState() {
trimmer.loadVideo(videoFile: widget.video);
}
}
ConsumerState<T extends ConsumerStatefulWidget>
로 고쳐주면 해결...