0

How to show loader before loading complete image from file? Before loading image in Imageview it takes some time before image is visible to user.

Image.file(
  File(selectedImagePath),
  width: double.infinity,
  height: double.infinity,
 ),
Aditya Patil
  • 1,287
  • 12
  • 19

1 Answers1

1

As suggested by @pskink You can use Image constructor

Image(
      image: FileImage(
      File(selectedImagePath)),
         width: double.infinity,
         height: double.infinity,
         loadingBuilder:
             (context, child, loadingProgress) {
             if (loadingProgress == null) {
                 debugPrint('image loading null');
                 return child;
             }
             debugPrint('image loading...');
             return const Center(
             child: CircularProgressIndicator());
          },
       ),
Aditya Patil
  • 1,287
  • 12
  • 19