Commit 34fe4e75 authored by Dasun Madushanka's avatar Dasun Madushanka

update details

parent 5fc2f9ec
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],
),
),
);
},
);
})
],
),
),
],
),
);
}
}
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