Flutter: using library universal_io/io.dart when others libs based on dart:io

Viewed 328

I want port my app to webapp, but I can't run my app as webapp. Why? Because another libs based on dart:io, not universal_io.

Terminal output:

lib/services/my_local_storage.dart:134:36: Error: The argument type 'File/*1*/' can't be assigned to
the parameter type 'File/*2*/'.
 - 'File/*1*/' is from 'package:universal_io/src/io/file.dart'
 ('/C:/Users/username/AppData/Local/Pub/Cache/hosted/pub.dartlang.org/universal_io-2.0.4/lib/src/io/fi
 le.dart').
 - 'File/*2*/' is from 'dart:io'.
        VideoPlayerController.file(File(myCacheDir!.path + "/" + path));

For example:

VideoPlayerController _controller =
        VideoPlayerController.file(File(myCacheDir!.path + "/" + path));

class VideoPlayerController need File as parameter, but inside video_player I see import dart:io. Moreover I have some others libs based on dart:io. How to solve it?

0 Answers
Related