import 'package:flutter/material.dart'; import 'package:teso/Classes/API%20Clasess/Post.dart'; import 'package:teso/Classes/TesoUser.dart'; import 'package:teso/util/consts.dart'; import 'package:time_elapsed/time_elapsed.dart'; buildPostTile3P(BuildContext context, TesoUser user, Post postedAd) { return ListTile( leading: Container( width: 40, height: 40, decoration: BoxDecoration( shape: BoxShape.circle, border: Border.all( color: Colors.black, width: 1, )), child: ClipRRect( borderRadius: BorderRadius.only( topLeft: Radius.circular(90.0), topRight: Radius.circular(90.0), bottomLeft: Radius.circular(90), bottomRight: Radius.circular(90), ), child: FadeInImage( height: 90, width: 90, fit: BoxFit.fill, image: NetworkImage( serverLocation + "api/pulldp/" + postedAd.publisherID, ), placeholder: AssetImage("assets/images/tesoDP/dp1.png"), ), ), ), title: new RichText( text: new TextSpan( style: new TextStyle( fontSize: 14.0, color: Theme.of(context).primaryColorLight, ), children: [ new TextSpan( text: user.username + " ", style: new TextStyle(fontWeight: FontWeight.bold)), new TextSpan( text: postedAd.title, ), ], ), ), subtitle: Text( TimeElapsed.fromDateTime(postedAd.timestamp), ), ); }