Flutter Listview freezes while it is loading thumbnail images from video url and my app crashed

141
October 13, 2019, at 01:20 AM

i am try to get image from video url when my list scroll but when i use of video thumbnail library and call it in my app list freezed and my app crashed this is my code

  Future _loadMore(context) async {
final diractory=Provider.of<DiractoryPath>(context,listen: false);
Provider.of<LoadState>(context).setLoadState(true);
final index= Provider.of<IndexLazyloading>(context);

if(moves.length!=index.oldmove){
  resetlist(context);
}
// Add in an artificial delay

for (var i = index.currentindex; i <= index.currentindex + increment && i<moves.length; i++) {
  File f=new File( "${diractory.diractory}/${moves[i].videourl.split("/").last.replaceAll("mp4", "png")}");
 if(!f.existsSync())
await getimage("${strings.baseurl}/videos/${moves[i].videourl}",context);
  index.setdata(i);
}
await new Future.delayed(const Duration(seconds: 2));
Provider.of<LoadState>(context).setLoadState(false);
index.setcurrentIndex(index.data.length)  ;
index.setoldMove(moves.length);
}

and this is my plugin that used

Future<Null> getimage(videourl,context)async{
 final uint8list = await VideoThumbnail.thumbnailFile(
 video: videourl,
thumbnailPath: Provider.of<DiractoryPath>(context).diractory,
imageFormat: ImageFormat.WEBP,
maxHeightOrWidth: 0, // the original resolution of the video
quality: 75,
 );
}

i try with png but dont work this is my list that call this function what is problem in this code please help me

 LazyLoadScrollView(
    isLoading: loadstate.isload,
    onEndOfPage: () => _loadMore(context),
child: ListView.builder(
itemCount: indexlayze.data.length,
itemBuilder: (context, position) {
return _buildProductItem(context,position);
},
));

my list get 10 image thumbnail when reach to end of list but is very slow how to handle it

Rent Charter Buses Company
READ ALSO
Sent/Received messages gets repeated and order gets spoiled in peer-to-peer chat app in android using socket

Sent/Received messages gets repeated and order gets spoiled in peer-to-peer chat app in android using socket

I am developing a peer-to-peer chat app using socket programming in androidThe port number of self and IP address and port number of the other peer is given as input and connection is established through socket

183
How do i show images of all installed apps in android?

How do i show images of all installed apps in android?

How do i show images of all installed apps in a recyclerView in android with an animation like it is being scanned?

127
Error while migrating to latest Google Drive API in Android - Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup

Error while migrating to latest Google Drive API in Android - Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup

An application is published on Play Store and it is using 'application data folder' for the backup-restore purpose using Drive APIEverything works fine

201
Why WebRTC video recording produces video of ridiculous size?

Why WebRTC video recording produces video of ridiculous size?

In Android, how can I record the local video in a WebRTC video call?

174