body.dart 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import 'package:flutter/material.dart';
  2. import 'package:fooddeliveryapp/model/constants.dart';
  3. import 'package:fooddeliveryapp/model/product.dart';
  4. import 'counter_with_fav_btn.dart';
  5. import 'description.dart';
  6. import 'product_title_with_image.dart';
  7. class DetailsBody extends StatelessWidget {
  8. final Product? product;
  9. const DetailsBody({Key? key, this.product}) : super(key: key);
  10. @override
  11. Widget build(BuildContext context) {
  12. // It provide us total height and width
  13. Size size = MediaQuery.of(context).size;
  14. return SingleChildScrollView(
  15. child: Column(
  16. children: [
  17. SizedBox(
  18. height: size.height * 1.2,
  19. child: Stack(
  20. children: [
  21. Container(
  22. margin: EdgeInsets.only(top: size.height * 0.4),
  23. padding: EdgeInsets.only(
  24. top: size.height * 0.12,
  25. left: kDefaultPaddin,
  26. right: kDefaultPaddin,
  27. ),
  28. // height: 500,
  29. decoration: BoxDecoration(
  30. color: Colors.white,
  31. borderRadius: BorderRadius.only(
  32. topLeft: Radius.circular(24),
  33. topRight: Radius.circular(24),
  34. ),
  35. ),
  36. child: Column(
  37. children: [
  38. // ColorAndSize(product: product),
  39. // SizedBox(height: kDefaultPaddin / 2),
  40. Description(product: product),
  41. SizedBox(height: kDefaultPaddin / 2),
  42. CounterWithFavBtn(
  43. product: product,
  44. ),
  45. SizedBox(height: kDefaultPaddin / 2),
  46. // AddToCart(product: product)
  47. ],
  48. ),
  49. ),
  50. ProductTitleWithImage(product: product)
  51. ],
  52. ),
  53. )
  54. ],
  55. ),
  56. );
  57. }
  58. }