Created
November 15, 2019 14:43
-
-
Save TechieBlossom/86419ad573420f3dc11b398412b26553 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 '../../models/product.dart'; | |
import 'blue_button.dart'; | |
class RightImageProductImageWidget extends StatelessWidget { | |
const RightImageProductImageWidget({ | |
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.only(left: 32), | |
height: screenHeight * 0.3, | |
color: product.backgroundColor, | |
child: Row( | |
mainAxisAlignment: MainAxisAlignment.spaceBetween, | |
children: <Widget>[ | |
Expanded( | |
flex: 4, | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
crossAxisAlignment: CrossAxisAlignment.start, | |
children: <Widget>[ | |
Text( | |
product.description, | |
style: TextStyle(fontWeight: FontWeight.w900, fontSize: 17.0), | |
), | |
SizedBox( | |
height: 10, | |
), | |
BlueButton(product: product), | |
], | |
), | |
), | |
Expanded( | |
flex: 5, | |
child: Stack( | |
children: <Widget>[ | |
Positioned( | |
top: 50, | |
bottom: -50, | |
child: Transform.rotate( | |
angle: -0.2, | |
child: Image.asset(product.imagePath), | |
), | |
), | |
], | |
), | |
), | |
], | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment