From 34fe4e7506a165584bc33c2b8a9cb014a267acdd Mon Sep 17 00:00:00 2001 From: Dasun Madushanka <it17150644@my.sliit.lk> Date: Mon, 26 Oct 2020 12:55:30 +0530 Subject: [PATCH] update details --- .../lib/screens/product/components/body.dart | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 MainAppDMT/lib/screens/product/components/body.dart diff --git a/MainAppDMT/lib/screens/product/components/body.dart b/MainAppDMT/lib/screens/product/components/body.dart new file mode 100644 index 0000000..95bbb6a --- /dev/null +++ b/MainAppDMT/lib/screens/product/components/body.dart @@ -0,0 +1,84 @@ +import 'package:DMTI_app/components/search_box.dart'; +import 'package:DMTI_app/constants.dart'; +import 'package:DMTI_app/models/product.dart'; +import 'package:DMTI_app/screens/Painter/painter_view.dart'; +import 'package:DMTI_app/screens/Timercard/timercard.dart'; +import 'package:DMTI_app/screens/details/details_screen.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/painting.dart'; + +import 'category_list.dart'; +import 'product_card.dart'; + +class Body extends StatelessWidget { + @override + Widget build(BuildContext context) { + return SafeArea( + bottom: false, + child: Column( + children: <Widget>[ + SearchBox(onChanged: (value) {}), + CategoryList(), + SizedBox(height: kDefaultPadding / 2), + Expanded( + child: Stack( + children: <Widget>[ + // Our background + Container( + margin: EdgeInsets.only(top: 70), + decoration: BoxDecoration( + color: kBackgroundColor, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(50), + topRight: Radius.circular(50), + ), + ), + ), + ListView.builder( + // here we use our demo procuts list + itemCount: products.length + 1, + itemBuilder: (context, index) { + if (index == products.length) { + return Card( + margin: EdgeInsets.symmetric( + horizontal: 20, vertical: 24), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(24)), + color: Colors.grey, + child: TimerCard(), + ); + } + // if (index == products.length + 1) { + // return Card( + // margin: EdgeInsets.symmetric( + // horizontal: 20, vertical: 24), + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(24)), + // color: Colors.grey, + // child: (), + // ); + // } + return ProductCard( + itemIndex: index, + product: products[index], + press: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => DetailsScreen( + product: products[index], + ), + ), + ); + }, + ); + }) + ], + ), + ), + ], + ), + ); + } +} -- 2.24.1