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.

140 lines
4.8 KiB

3 years ago
import 'package:cached_network_image/cached_network_image.dart';
import 'package:teso/Classes/API%20Clasess/Product.dart';
import 'package:teso/util/SizeConfig.dart';
import 'package:teso/util/consts.dart';
import 'package:flutter/material.dart';
buildTrend(BuildContext context, Product product) {
return Container(
margin: EdgeInsets.all(10),
width: MediaQuery.of(context).size.width * 0.525,
height: MediaQuery.of(context).size.width * 0.65,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30.0),
),
child: ClipRRect(
borderRadius: BorderRadius.circular(30.0),
child: Container(
width: double.infinity,
height: double.infinity,
child: Stack(
children: [
CachedNetworkImage(
imageUrl: tesoProductThumbnail(
productLogo: product.productImage,
width: 640,
height: 640,
),
imageBuilder: (context, imageProvider) => FadeInImage(
width: double.infinity,
fit: BoxFit.contain,
image: imageProvider,
placeholder: AssetImage("assets/images/loading.png"),
),
),
Container(
height: double.infinity,
width: double.infinity,
decoration: BoxDecoration(
color: Color.fromRGBO(0, 0, 0, 0.4),
),
child: Align(
alignment: Alignment.bottomCenter,
child: Container(
width: double.infinity,
margin: EdgeInsets.only(bottom: 40),
child: Text(
product.productName.toUpperCase(),
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: SizeConfig.blockSizeHorizontal * 3.5,
fontWeight: FontWeight.bold,
),
),
),
),
),
Container(
height: double.infinity,
width: double.infinity,
padding: EdgeInsets.symmetric(horizontal: 10.0),
child: Align(
alignment: Alignment.bottomCenter,
child: Container(
width: double.infinity,
margin: EdgeInsets.only(
bottom: 15,
),
child: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: [
Icon(
Icons.location_on,
color: Colors.white,
size: 14,
),
Text(
" " + product.categoryID.toString(),
textAlign: TextAlign.left,
style: TextStyle(
color: Colors.white,
fontSize: SizeConfig.blockSizeHorizontal * 3.5,
),
),
],
),
),
),
),
),
// Align(
// alignment: Alignment.bottomRight,
// child: GestureDetector(
// onTap: () => print("Hello"),
// child: Container(
// margin: EdgeInsets.all(10),
// padding: EdgeInsets.all(5),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.all(
// Radius.circular(20),
// ),
// color: Colors.white,
// ),
// child: Icon(
// Feather.heart,
// color: Theme.of(context).accentColor,
// ),
// ),
// ),
// ),
// Align(
// alignment: Alignment.topLeft,
// child: Container(
// margin: EdgeInsets.all(10),
// padding: EdgeInsets.symmetric(
// horizontal: 8,
// vertical: 5,
// ),
// decoration: BoxDecoration(
// borderRadius: BorderRadius.all(
// Radius.circular(20),
// ),
// color: Colors.white,
// ),
// child: Text(
// product.duration,
// style: TextStyle(
// color: Colors.black,
// ),
// ),
// ),
// ),
],
),
),
),
);
}