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.
90 lines
3.1 KiB
90 lines
3.1 KiB
import 'package:cached_network_image/cached_network_image.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:teso/Classes/TesoShop.dart';
|
|
import 'package:teso/util/consts.dart';
|
|
import 'package:teso/providers/pageAnimations.dart';
|
|
import 'package:teso/Pages/Sub_Pages/Business/BusinessProfile.dart';
|
|
|
|
buildBusiness(BuildContext context, TesoShop shop) {
|
|
return Container(
|
|
margin: EdgeInsets.all(2.5),
|
|
width: MediaQuery.of(context).size.width * 0.525,
|
|
height: MediaQuery.of(context).size.width * 0.60,
|
|
child: InkWell(
|
|
onTap: () => Navigator.push(
|
|
context,
|
|
PageTransition(
|
|
child: BusinessProfile(
|
|
shop: shop,
|
|
),
|
|
type: PageTransitionType.fade,
|
|
),
|
|
),
|
|
child: Material(
|
|
elevation: 5,
|
|
child: Container(
|
|
width: MediaQuery.of(context).size.width * 0.525,
|
|
height: MediaQuery.of(context).size.width * 0.60,
|
|
child: Wrap(
|
|
children: [
|
|
shop.logo!.toLowerCase() == "null" || shop.logo == null
|
|
? Image(
|
|
width: double.infinity,
|
|
height: MediaQuery.of(context).size.width * 0.45,
|
|
fit: BoxFit.fill,
|
|
image: AssetImage("assets/images/store.png"),
|
|
)
|
|
: CachedNetworkImage(
|
|
imageUrl: businessLogoURL + shop.logo!,
|
|
imageBuilder: (context, imageProvider) => FadeInImage(
|
|
width: double.infinity,
|
|
height: MediaQuery.of(context).size.width * 0.45,
|
|
fit: BoxFit.fill,
|
|
image: imageProvider,
|
|
placeholder: AssetImage("assets/images/store.png"),
|
|
),
|
|
),
|
|
Container(
|
|
width: MediaQuery.of(context).size.width,
|
|
decoration: BoxDecoration(
|
|
color: Colors.white10,
|
|
),
|
|
child: Text(
|
|
shop.shopName!.toUpperCase(),
|
|
textAlign: TextAlign.center,
|
|
style: TextStyle(
|
|
// color: Colors.black45,
|
|
fontSize: 15,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: MediaQuery.of(context).size.width,
|
|
color: Colors.white10,
|
|
child: Text(
|
|
shop.categoryShop!,
|
|
textAlign: TextAlign.center,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.normal,
|
|
),
|
|
),
|
|
),
|
|
Container(
|
|
width: MediaQuery.of(context).size.width,
|
|
color: Colors.white10,
|
|
child: Text(
|
|
shop.shopAddress!,
|
|
textAlign: TextAlign.center,
|
|
style: TextStyle(
|
|
fontWeight: FontWeight.normal,
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|