import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:teso/Classes/API%20Clasess/Post.dart'; import 'package:teso/util/consts.dart'; buildTile(BuildContext context, Post advert, double height, Function push) { return Container( margin: EdgeInsets.all(0.5), width: MediaQuery.of(context).size.width * 0.525, height: MediaQuery.of(context).size.width * height, child: InkWell( onTap: () => push(advert), child: CachedNetworkImage( imageUrl: tesoPostThumb(advert.playbackID), imageBuilder: (context, imageProvider) => FadeInImage( width: double.infinity, fit: BoxFit.fill, image: imageProvider, placeholder: AssetImage("assets/images/blank.jpg"), ), errorWidget: (context, url, error) => Container( color: Colors.grey[800], )), ), ); }