Created
November 9, 2022 17:36
-
-
Save aniekan12/6dcdee8ae0b47146b57466f960231f74 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:shopping_cart_with_bloc/core/models/shopping_home.dart'; | |
import 'package:shopping_cart_with_bloc/presentation/widgets/image_widget.dart'; | |
class ShoppingHomeTile extends StatelessWidget { | |
final ShoppingHomeModel shoppingHomeModel; | |
const ShoppingHomeTile({Key? key, required this.shoppingHomeModel}) | |
: super(key: key); | |
@override | |
Widget build(BuildContext context) { | |
Size size = MediaQuery.of(context).size; | |
return Container( | |
decoration: | |
BoxDecoration(border: Border.all(color: Colors.grey, width: 0.02)), | |
height: size.height, | |
width: size.width, | |
child: ListView( | |
physics: const NeverScrollableScrollPhysics(), | |
children: [ | |
ImageWidget(imageUrl: shoppingHomeModel.image!), | |
const SizedBox(height: 20), | |
Padding( | |
padding: const EdgeInsets.only(left: 20), | |
child: Text('\$ ${shoppingHomeModel.price!.toString()}', | |
style: | |
const TextStyle(fontSize: 15, fontWeight: FontWeight.w800)), | |
), | |
Padding( | |
padding: const EdgeInsets.only(left: 20), | |
child: Text(shoppingHomeModel.title!, | |
style: const TextStyle( | |
fontSize: 12, | |
color: Colors.grey, | |
fontWeight: FontWeight.w600)), | |
), | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment