How to apply ColorFilter matrix to the direct file or image and save it in flutter?

353 Views Asked by At

This is such like a stupid question, but after struggled a few hours than come over here, I have ColorFilter matrix array and file which is image. So how to apply it, not for showing ,it is only for saving in local storage purpose.

File file=_sampleFile; // file contained image
ColorFilter cf= ColorFilter.matrix(filter[2]);

below code shows the color filtered image only in app

 ColorFiltered(
            colorFilter: ColorFilter.matrix(filter[2]),
            child: Image.File(_sampleFile),
          ),

but i want it like

File colorFilterFile= _sampleFile.addColorFilter(ColorFilter.matrix(filter[2]));

or

Image image=Image.file(_sampleFile);
 Image colorFilterImage= image.addColorFilter(ColorFilter.matrix(filter[2]));

don't suggest screenshot from widget, it is not recommendation from my side thank you

0

There are 0 best solutions below