Skip to content

Instantly share code, notes, and snippets.

@TechieBlossom
Created November 15, 2019 15:04
Show Gist options
  • Save TechieBlossom/e8df2f72d6d9b3909987456e3cb5f46f to your computer and use it in GitHub Desktop.
Save TechieBlossom/e8df2f72d6d9b3909987456e3cb5f46f to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
import '../../models/product.dart';
import 'blue_button.dart';
class LeftImageProductItemWidget extends StatelessWidget {
const LeftImageProductItemWidget({Key key, @required this.screenHeight, @required this.product}) : super(key: key);
final double screenHeight;
final Product product;
@override
Widget build(BuildContext context) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 16),
height: screenHeight * 0.25,
color: Color(0xFFFBE9EB),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Expanded(
flex: 5,
child: Stack(
children: <Widget>[
Align(
alignment: Alignment.center,
child: Image.asset(
product.imagePath,
height: 100,
),
),
],
),
),
Expanded(
flex: 4,
child: Padding(
padding: const EdgeInsets.only(left: 16),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
product.name,
style: TextStyle(fontWeight: FontWeight.w900, fontSize: 17.0),
),
Text(
product.description,
style: TextStyle(color: Color(0xFF909090), fontSize: 8.0),
),
SizedBox(
height: 5,
),
BlueButton(
product: product,
),
],
),
),
),
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment