initializeAlbums method

Future<void> initializeAlbums({
  1. Locale? locale,
})

Implementation

Future<void> initializeAlbums({Locale? locale}) async {
  _media = await PhoneGalleryController.collectGallery(locale: locale);
  if (_media != null) {
    if (_extraRecentMedia != null) {
      GalleryAlbum? recentTmp = recent;
      if (recentTmp != null) {
        _extraRecentMedia!.removeWhere((element) =>
            recentTmp.files.any((file) => element.id == file.id));
      }
    }
    permissionGranted = true;
    _isInitialized = true;
  } else {
    permissionGranted = false;
    permissionListener(locale: locale);
  }
  update();
}