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.

182 lines
6.3 KiB

3 years ago
import 'package:cached_network_image/cached_network_image.dart';
import 'package:numeral/numeral.dart';
import 'package:teso/util/consts.dart';
import 'package:flutter/material.dart';
import 'package:teso/Classes/TesoShop.dart';
buildHead(
{BuildContext context,
TesoShop shopSelected,
int products,
int subscribers,
int coupons}) {
return Container(
// height: MediaQuery.of(context).size.width -
// (MediaQuery.of(context).size.width * 0.40),
width: MediaQuery.of(context).size.width,
child: Material(
elevation: 2.0,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(5),
bottomRight: Radius.circular(5),
),
// shadowColor: Theme.of(context).backgroundColor,
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Container(
margin: EdgeInsets.only(
top: 10,
),
width: 80,
height: 80,
decoration: BoxDecoration(
shape: BoxShape.circle,
),
child: ClipRRect(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(50.0),
topRight: Radius.circular(50.0),
bottomLeft: Radius.circular(50),
bottomRight: Radius.circular(50),
),
child: shopSelected.logo != "null"
? CachedNetworkImage(
imageUrl: businessLogoURL + shopSelected.logo,
imageBuilder: (context, imageProvider) =>
FadeInImage(
height: 90,
width: 90,
fit: BoxFit.fill,
image: imageProvider,
placeholder:
AssetImage("assets/images/store.png"),
),
)
: Image(
height: 90,
width: 90,
fit: BoxFit.fill,
image: AssetImage("assets/images/store.png"),
),
),
),
new Wrap(
direction: Axis.vertical,
children: [
Container(
child: Center(
child: Text(
Numeral(products).numeral.toString(),
3 years ago
style: TextStyle(fontWeight: FontWeight.bold),
),
),
),
Container(
child: Text(
"Products",
style: TextStyle(fontWeight: FontWeight.w400),
),
),
],
),
new Wrap(
direction: Axis.vertical,
children: [
Container(
child: Center(
child: Text(
Numeral(subscribers).numeral.toString(),
3 years ago
textAlign: TextAlign.center,
style: TextStyle(fontWeight: FontWeight.bold),
),
),
),
Container(
child: Text(
"Subscribers",
style: TextStyle(fontWeight: FontWeight.w400),
),
),
],
),
new Wrap(
direction: Axis.vertical,
children: [
Container(
child: Center(
child: Text(
Numeral(coupons).numeral.toString(),
3 years ago
textAlign: TextAlign.center,
style: TextStyle(fontWeight: FontWeight.bold),
),
),
),
Container(
child: Text(
"Coupons",
style: TextStyle(fontWeight: FontWeight.w400),
),
),
],
),
],
),
Container(
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.only(
top: MediaQuery.of(context).size.width * 0.025,
left: MediaQuery.of(context).size.width * 0.09,
),
child: Text(
shopSelected.shopAddress,
style: TextStyle(
fontWeight: FontWeight.w400,
//color: Colors.grey,
),
),
),
Container(
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.only(
top: MediaQuery.of(context).size.width * 0.01,
left: MediaQuery.of(context).size.width * 0.09,
),
child: Text(
shopSelected.categoryShop,
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w400,
color: Colors.grey,
),
),
),
Container(
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.only(
top: MediaQuery.of(context).size.width * 0.025,
left: MediaQuery.of(context).size.width * 0.09,
),
child: Text(
shopSelected.shopDescription.toLowerCase() != "null"
? shopSelected.shopDescription
: "",
style: TextStyle(
fontSize: 13,
fontWeight: FontWeight.w400,
//color: Colors.grey,
),
),
),
],
),
),
),
);
}