Skip to content

Commit

Permalink
Merge pull request himanshusharma89#136 from believeInJha/issue-101
Browse files Browse the repository at this point in the history
Fix : Issue 101
  • Loading branch information
himanshusharma89 authored Mar 16, 2021
2 parents 9d2d853 1a2c0f1 commit 9003d34
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 54 deletions.
73 changes: 41 additions & 32 deletions lib/helpers/constants.dart
Original file line number Diff line number Diff line change
@@ -1,4 1,5 @@
import 'package:flutter/material.dart';
import 'package:retro_shopping/model/product.dart';
import 'package:retro_shopping/widgets/product/product_card.dart';

// Route Names
Expand Down Expand Up @@ -27,46 28,54 @@ class RelicColors {
}

List<ProductCard> productsList = <ProductCard>[
const ProductCard(
ProductCard(
product: Product(
text: 'ANTIQUE VASE',
owner: 'by Lloyd Duran',
amount: '₹ 4035',
image: 'assets/items/3.png',
seller: 'Monzart',
height: 51),
const ProductCard(
text: 'EDISON TURNTABLE',
owner: 'by Tony Stark',
amount: '₹ 5035',
image: 'assets/items/4.png',
seller: 'SciPedia',
height: 43),
const ProductCard(
text: 'TATUNG EINSTEIN',
owner: 'by Lloyd Duran',
amount: '₹ 4035',
image: 'assets/items/1.png',
seller: 'Diz Arts',
height: 48),
const ProductCard(
text: 'MYRON DISC THROWER',
owner: 'by Lloyd Duran',
amount: '₹ 4035',
image: 'assets/items/2.png',
seller: 'AB Retial',
height: 32),
const ProductCard(
height: 51,
),
),
ProductCard(
product: Product(
text: 'EDISON TURNTABLE',
owner: 'by Tony Stark',
amount: '₹ 5035',
image: 'assets/items/4.png',
seller: 'SciPedia',
height: 43),),
ProductCard(
product: Product(
text: 'TATUNG EINSTEIN',
owner: 'by Lloyd Duran',
amount: '₹ 4035',
image: 'assets/items/1.png',
seller: 'Diz Arts',
height: 48),),
ProductCard(
product: Product(
text: 'MYRON DISC THROWER',
owner: 'by Lloyd Duran',
amount: '₹ 4035',
image: 'assets/items/2.png',
seller: 'AB Retial',
height: 32),),
ProductCard(
product: Product(
text: 'GUARDIAN CLOCK',
owner: 'by Claudia Davies',
amount: '₹ 4035',
image: 'assets/items/5.png',
seller: 'Electrica',
height: 19),
const ProductCard(
text: 'ROTATORY DIALER',
owner: 'by Lloyd Duran',
amount: '₹ 4035',
image: 'assets/items/6.png',
seller: 'RS Telecom',
height: 29),
height: 19),),
ProductCard(
product: Product(
text: 'ROTATORY DIALER',
owner: 'by Lloyd Duran',
amount: '₹ 4035',
image: 'assets/items/6.png',
seller: 'RS Telecom',
height: 29),),
];
35 changes: 13 additions & 22 deletions lib/widgets/product/product_card.dart
Original file line number Diff line number Diff line change
@@ -1,24 1,15 @@
import 'package:flutter/material.dart';
import 'package:retro_shopping/helpers/constants.dart';
import 'package:retro_shopping/helpers/slide_route.dart';
import 'package:retro_shopping/model/product.dart';
import 'package:retro_shopping/widgets/product/product_page.dart';

class ProductCard extends StatelessWidget {
const ProductCard(
{Key key,
this.text,
this.owner,
this.amount,
this.image,
this.seller,
this.height})
this.product})
: super(key: key);
final String text;
final String owner;
final String amount;
final String image;
final String seller;
final int height;
final Product product;

@override
Widget build(BuildContext context) {
Expand All @@ -28,12 19,12 @@ class ProductCard extends StatelessWidget {
context,
SlideBottomRoute(
page: ProductPage(
text: text,
owner: owner,
image: image,
prodHeight: height,
seller: seller,
amount: amount,
text: product.text,
owner: product.owner,
image: product.image,
prodHeight: product.height,
seller: product.seller,
amount: product.amount,
)));
},
child: Container(
Expand All @@ -57,7 48,7 @@ class ProductCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
text,
product.text,
style: const TextStyle(
fontSize: 18,
color: Colors.white,
Expand All @@ -67,7 58,7 @@ class ProductCard extends StatelessWidget {
textAlign: TextAlign.left,
),
Text(
owner,
product.owner,
style: const TextStyle(
fontSize: 11,
color: Colors.white,
Expand All @@ -80,7 71,7 @@ class ProductCard extends StatelessWidget {
height: 20,
),
Text(
amount,
product.amount,
style: const TextStyle(
fontSize: 18,
color: Colors.white,
Expand All @@ -92,7 83,7 @@ class ProductCard extends StatelessWidget {
Transform.translate(
offset: const Offset(16, 10),
child: Image.asset(
image,
product.image,
height: 148,
width: 154,
),
Expand Down

0 comments on commit 9003d34

Please sign in to comment.