You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
975 B
26 lines
975 B
import 'package:cached_network_image/cached_network_image.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],
|
|
)),
|
|
),
|
|
);
|
|
}
|
|
|