1

im showing image from local storage in my flutter app but it takes 1-2 sec to loadup. But there is no callback functionality when image is loaded. So how can i know the image is loaded or not as i have to disable a button untill image is fully loaded.

Align(
      alignment: Alignment.center,
      child: Screenshot(
        controller: _controller,
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: <Widget>[
            Image.file(
              File(path),
              fit: BoxFit.fitWidth,
            ),
            Align(
              alignment: Alignment.bottomRight,
              child: Padding(
                padding: const EdgeInsets.all(8.0),
                child: Text(
                  watermark,
                  style: TextStyle(
                    color: Colors.green,
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
    ),

This is how im loading image. The issue only appears on low end devices. On high end devices the image is loaded in less than a second so i didnt noticed any issue. Is there any way to get a callback when image finish loading?

jitendra purohit
  • 652
  • 5
  • 18

0 Answers0