pexels_photos_videos 0.0.16 pexels_photos_videos: ^0.0.16 copied to clipboard
This package will help you to get data from pexels.com. It's easy to use and get all details related to media which is requested.
import 'package:flutter/foundation.dart';
import 'package:pexels_photos_videos/curated.dart';
import 'package:pexels_photos_videos/pexels_media.dart';
import 'package:pexels_photos_videos/photo.dart';
import 'package:pexels_photos_videos/search_photo.dart';
import 'package:pexels_photos_videos/video.dart';
void main() async {
/// Call [PexelsMedia] and get [PexelsResult]
var pexelsMedia =
await PexelsMedia(authorizationKey: 'place your auth key here');
Photo photo = await pexelsMedia.getPhoto('image Id');
Video video = await pexelsMedia.getVideo('video Id');
Curated curated = await pexelsMedia.getCuratedPhotos(1, 1);
SearchPhoto searchResult = await pexelsMedia.searchPhotos("search text");
if (kDebugMode) {
print(photo.photographer);
print(video.user);
print(curated.totalResult);
print(searchResult.totalResults);
}
}