I tried to add color using ColorFiltered widget to half of image (50% size of image) but I couldn't give value in flutter when I give value then show me error.How I give size or value?
code
ColorFiltered(
colorFilter: const ColorFilter.matrix([
0.0, 0.0, 0.0, 0.0, 0.0, //
2.0, 0.0, 0.0, 0.0, 0.0, //
0.0, 0.0, 3.0, 0.0, 0.0, //
0.0, 0.0, 0.0, 1.0, 0.0, //
]),
child: Image.asset(
"assets/bar.png",
),
),
What if you used a
Stackand position aContainerwith the background Color you want, behind your image. Then You could just move theContainerto the right or left, giving the illusion of loading. (Assuming your image is transparent.)I think this should be easier and much more convenient than using a matrix.