single_item.dart 7.01 KiB
import 'package:flutter/material.dart';
import 'package:food_app/config/colors.dart';
class SingleItem extends StatelessWidget {
bool isBool = false;
String productImage;
String productName;
int productPrice;
String productId;
int productQuantity;
SingleItem(
{this.productQuantity,this.productId,this.isBool, this.productImage, this.productName, this.productPrice});
@override
Widget build(BuildContext context) {
return Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
child: Row(
children: [
Expanded(
child: Container(
height: 100,
child: Center(
child: Image.network(productImage),
),
),
),
Expanded(
child: Container(
height: 100,
child: Column(
mainAxisAlignment: isBool == false
? MainAxisAlignment.spaceAround
: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
children: [
Text(
productName,
style: TextStyle(
color: textColor, fontWeight: FontWeight.bold),
),
Text(
"$productPrice\$",
style: TextStyle(
color: textColor,
fontWeight: FontWeight.bold,
),
),
],
),
isBool == false
? Container(
margin: EdgeInsets.only(right: 5),
padding: EdgeInsets.symmetric(horizontal: 10),
height: 35,
decoration: BoxDecoration(
border: Border.all(color: Colors.grey),
borderRadius: BorderRadius.circular(30),
),
child: Row(
children: [
Expanded(
child: Text(
"50 Gram",
style: TextStyle(
color: Colors.grey,
fontSize: 12,