import 'package:flutter/material.dart'; import 'package:teso/Classes/API Clasess/Desire.dart'; import 'package:teso/util/consts.dart'; buildProductDesire(BuildContext context, Desire item, Function addItem) { return Container( width: MediaQuery.of(context).size.width, height: 90, padding: EdgeInsets.symmetric(horizontal: 10), child: SingleChildScrollView( scrollDirection: Axis.horizontal, child: Row( children: [ Container( width: 70, height: 70, decoration: BoxDecoration( border: Border.all( color: Colors.grey, width: 0.5, ), borderRadius: BorderRadius.only( topRight: Radius.circular(30), topLeft: Radius.circular(30), bottomLeft: Radius.circular(30), bottomRight: Radius.circular(30), ), ), child: ClipRRect( borderRadius: BorderRadius.only( topLeft: Radius.circular(30.0), topRight: Radius.circular(30.0), bottomLeft: Radius.circular(30), bottomRight: Radius.circular(30), ), child: Image( width: MediaQuery.of(context).size.width * 0.28, fit: BoxFit.fill, //controller: controller, image: NetworkImage(productURL + item.productImage), ), ), ), Container( width: MediaQuery.of(context).size.width / 1.7, padding: EdgeInsets.symmetric(vertical: 20, horizontal: 5), child: Column( children: [ Container( width: double.infinity, child: Text("Item Name : " + item.productName), ), Container( width: double.infinity, child: Text("Price : GH¢ " + item.price.toString()), ), ], ), ), Container( width: 40, height: 40, decoration: BoxDecoration( shape: BoxShape.circle, color: Colors.green, ), child: Center( child: IconButton( icon: Icon( Icons.add, color: Colors.white, ), onPressed: () => addItem(item), ), ), ), ], ), ), ); }