body.dart 2.2 KB

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