Commit c207515f authored by Dasun Madushanka's avatar Dasun Madushanka

update components-body of the DM test

parent 0e43368c
import 'package:DMTI_app/constants.dart';
import 'package:DMTI_app/models/product.dart';
import 'package:flutter/material.dart';
import 'chat_and_add_to_cart.dart';
import 'list_of_colors.dart';
import 'product_image.dart';
class Body extends StatelessWidget {
final Product product;
const Body({Key key, this.product}) : super(key: key);
@override
Widget build(BuildContext context) {
// it provide us total height and width
Size size = MediaQuery.of(context).size;
// it enable scrolling on small devices
return SafeArea(
bottom: false,
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
width: double.infinity,
padding: EdgeInsets.symmetric(horizontal: kDefaultPadding),
decoration: BoxDecoration(
color: kBackgroundColor,
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(50),
bottomRight: Radius.circular(50),
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Center(
child: Hero(
tag: '${product.id}',
child: ProductPoster(
size: size,
image: product.image,
),
),
),
ListOfColors(),
Padding(
padding: const EdgeInsets.symmetric(
vertical: kDefaultPadding / 2),
child: Text(
product.title,
style: Theme.of(context).textTheme.headline6,
),
),
Text(
'${product.price} \M\I\N',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w600,
color: kSecondaryColor,
),
),
Padding(
padding:
EdgeInsets.symmetric(vertical: kDefaultPadding / 2),
child: Text(
product.description,
style: TextStyle(color: kTextLightColor),
),
),
SizedBox(height: kDefaultPadding),
],
),
),
ChatAndAddToCart(),
],
),
),
);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment