Firelands128 / photo_gallery

A Flutter plugin that retrieves images and videos from mobile native gallery.
BSD 3-Clause "New" or "Revised" License
68 stars 62 forks source link

TimeoutException after migrating from 0.3.0 to 0.4.0 #14

Closed wildsurfer closed 3 years ago

wildsurfer commented 3 years ago

I'm trying to upgrade photo_galley dependency in fully functional app from 0.3.0 to 0.4.0.

After upgrading I'm getting this exception:

E/flutter (12792): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: TimeoutException: Timeout occurred trying to load from AlbumThumbnailProvider("__ALL__")
E/flutter (12792): 

Related code from the app:

  Future _listAlbums() async {
    if (!_loading) {
      setState(() {
        _loading = true;
      });
    }

    List<Album> collections =
        await PhotoGallery.listAlbums(mediumType: MediumType.video);

    for (var i = 0; i < collections.length; i++) {
      ImageProvider image = AlbumThumbnailProvider(
        height: 512,
        width: 512,
        albumId: collections[i].id,
        highQuality: true,
      );
    }

    setState(() {
      _collections = collections;
      _loading = false;
    });
  }
wildsurfer commented 3 years ago

Looks like this issue isn't related to photo_gallery. Sorry. Closing