This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Container( | |
| decoration: BoxDecoration( | |
| color: Color(0xfff5f8fd), | |
| borderRadius: BorderRadius.circular(30), | |
| ), | |
| margin: EdgeInsets.symmetric(horizontal: 24), | |
| padding: EdgeInsets.symmetric(horizontal: 24), | |
| child: Row( | |
| children: <Widget>[ | |
| Expanded( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Container( | |
| height: 80, | |
| child: ListView.builder( | |
| padding: EdgeInsets.symmetric(horizontal: 24), | |
| itemCount: categories.length, | |
| shrinkWrap: true, | |
| scrollDirection: Axis.horizontal, | |
| itemBuilder: (context, index) { | |
| /// Create List Item tile | |
| return CategoriesTile( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class PhotosModel { | |
| String url; | |
| String photographer; | |
| String photographerUrl; | |
| int photographerId; | |
| SrcModel src; | |
| PhotosModel( | |
| {this.url, | |
| this.photographer, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CategoriesTile extends StatelessWidget { | |
| final String imgUrls, categorie; | |
| CategoriesTile({@required this.imgUrls, @required this.categorie}); | |
| @override | |
| Widget build(BuildContext context) { | |
| return GestureDetector( | |
| onTap: () { | |
| Navigator.push( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| getTrendingWallpaper() async { | |
| await http.get( | |
| "https://api.pexels.com/v1/curated?per_page=$noOfImageToLoad&page=1", | |
| headers: {"Authorization": apiKEY}).then((value) { | |
| //print(value.body); | |
| Map<String, dynamic> jsonData = jsonDecode(value.body); | |
| jsonData["photos"].forEach((element) { | |
| //print(element); | |
| PhotosModel photosModel = new PhotosModel(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'package:wallpaper/models/categorie_model.dart'; | |
| String apiKEY = "[API_KEY]"; | |
| List<CategorieModel> getCategories() { | |
| List<CategorieModel> categories = new List(); | |
| CategorieModel categorieModel = new CategorieModel(); | |
| // | |
| categorieModel.imgUrl = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Widget wallpapersList({List<WallpaperModel> wallpapers, context}){ | |
| return Container( | |
| child: GridView.count( | |
| shrinkWrap: true, | |
| padding: EdgeInsets.symmetric(horizontal: 16), | |
| physics: ClampingScrollPhysics(), | |
| crossAxisCount: 2, | |
| childAspectRatio: 0.6, | |
| mainAxisSpacing: 6.0, | |
| crossAxisSpacing: 6.0, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Widget brandName() { | |
| return Row( | |
| mainAxisAlignment: MainAxisAlignment.center, | |
| mainAxisSize : MainAxisSize.min | |
| children: <Widget>[ | |
| Text( | |
| "Wallpaper", | |
| style: TextStyle(color: Colors.black87, fontFamily: 'Overpass'), | |
| ), | |
| Text( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| getSearchWallpaper(String searchQuery) async { | |
| await http.get( | |
| "https://api.pexels.com/v1/search?query=$searchQuery&per_page=30&page=1", | |
| headers: {"Authorization": apiKEY}).then((value) { | |
| //print(value.body); | |
| Map<String, dynamic> jsonData = jsonDecode(value.body); | |
| jsonData["photos"].forEach((element) { | |
| //print(element); | |
| PhotosModel photosModel = new PhotosModel(); |