aloisdeniel / media_gallery

A Flutter plugin that lists native gallery items.
MIT License
87 stars 33 forks source link

[REQUEST] Create the constructor Media.fromId(id) #7

Open rignaneseleo opened 4 years ago

rignaneseleo commented 4 years ago

Hi, thanks for this library. It works well. I'd like to put media's IDs into my db and show the pictures using queries.

Now the only way is to load the whole list and then get the value with a .where() function.

Can you either give us a Map<int,Media> where the key is the ID or a constructor method called Media.fromId(id) that basically builds the Media from the id?

Thanks

aloisdeniel commented 4 years ago

Yep that would be useful!

Thanks for the suggestion.

rignaneseleo commented 4 years ago

A workaround I found is to create the Media using the .fromJson() function and passing an ID and type to that. It works but it would be better a dedicated method.