PixabayMediaProvider class
Class to access pixabay.com http API
Constructors
- PixabayMediaProvider({required String apiKey, String? language, bool? safeSearch})
Properties
- apiKey → String
-
Store API key
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- language ↔ String
-
language for search terms
getter/setter pair
- progressStreamController ↔ StreamController
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- safeSearch ↔ bool
-
safe search, default is true
getter/setter pair
Methods
-
downloadMedia(
PixabayMedia media, String res, [Function? callback]) → Future< BytesBuilder> - Common function to download media from pixabay cdn remember pixabay.com does not prefer hotlinking
-
getImages(
String url) → dynamic -
get avaiable images for a
url
from pixabay -
getVideos(
String url) → dynamic -
get avaiable videos for a
url
from pixabay -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
requestImages(
{int resultsPerPage = 30, int? page, String? category}) → Future< PixabayResponse?> - request random images by category
-
requestImagesWithKeyword(
{String? keyword, int resultsPerPage = 30, int? page, String? category}) → Future< PixabayResponse?> - request images for a given keyword or search term
-
requestMapByCategory(
{int? photoResultsPerCategory, int? videoResultsPerCategory, List< String> ? categories}) → Stream<Map< String, Map< >MediaType, PixabayResponse?> > - request random media (images and/or videos) for a list of categories
-
requestMediaWithKeyword(
{MediaType? media, String? keyword, int resultsPerPage = 30, int? page, String? category}) → Future< PixabayResponse?> - main request method for all kind of media types
-
requestVideos(
{int resultsPerPage = 30, int? page, String? category}) → Future< PixabayResponse?> - request random videos
-
requestVideosWithKeyword(
{String? keyword, int resultsPerPage = 30, int? page, String? category}) → Future< PixabayResponse?> - request videos for a given keyword or search term
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
bodyToPixabayResponse(
dynamic data, dynamic jsonString) → PixabayResponse?