Closed karmalove closed 1 year ago
My original image is rectangle, I want to show circle image。 eg: Assets.lib.res.lottie.love.data.lottie( imageProviderFactory: (image) { if (image.fileName == 'img_0.png') { // return CachedNetworkImageProvider( // 'https://img2.baidu.com/it/u=3684117954,695988885&fm=253&fmt=auto&app=138&f=JPEG?w=400&h=400', // ); } else { return null; } }, delegates: LottieDelegates( image: (composition, image) { if(image.id=='image_0') { loadImage( const NetworkImage( 'https://img2.baidu.com/it/u=3684117954,695988885&fm=253&fmt=auto&app=138&f=JPEG?w=400&h=400', ), ).then((value) { return composition.images['image_0']?.loadedImage = value; }); } //Use the default method: // composition.images[image.id].loadedImage; return null; }, ), ),
My original image is rectangle, I want to show circle image。 eg: Assets.lib.res.lottie.love.data.lottie( imageProviderFactory: (image) { if (image.fileName == 'img_0.png') { // return CachedNetworkImageProvider( // 'https://img2.baidu.com/it/u=3684117954,695988885&fm=253&fmt=auto&app=138&f=JPEG?w=400&h=400', // ); } else { return null; } }, delegates: LottieDelegates( image: (composition, image) { if(image.id=='image_0') { loadImage( const NetworkImage( 'https://img2.baidu.com/it/u=3684117954,695988885&fm=253&fmt=auto&app=138&f=JPEG?w=400&h=400', ), ).then((value) { return composition.images['image_0']?.loadedImage = value; }); } //Use the default method: // composition.images[image.id].loadedImage; return null; }, ), ),