82 lines
2.6 KiB
Dart
82 lines
2.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:mymuseum_visitapp/Screens/Visit/product.dart';
|
|
import 'package:mymuseum_visitapp/constants.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, required 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}',
|
|
style: TextStyle(
|
|
fontSize: 18,
|
|
fontWeight: FontWeight.w600,
|
|
color: kSecondRed,
|
|
),
|
|
),
|
|
Padding(
|
|
padding:
|
|
EdgeInsets.symmetric(vertical: kDefaultPadding / 2),
|
|
child: Text(
|
|
product.description!,
|
|
style: TextStyle(color: kTextRed),
|
|
),
|
|
),
|
|
SizedBox(height: kDefaultPadding),
|
|
],
|
|
),
|
|
),
|
|
ChatAndAddToCart(),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|