mirror of
https://github.com/flutter/samples.git
synced 2025-11-10 14:58:34 +00:00
Analysis options, fixes, and formatting (#110)
This commit is contained in:
@@ -28,40 +28,42 @@ class TwoProductCardColumn extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LayoutBuilder(
|
||||
builder: (BuildContext context, BoxConstraints constraints) {
|
||||
const spacerHeight = 44.0;
|
||||
builder: (context, constraints) {
|
||||
const spacerHeight = 44.0;
|
||||
|
||||
double heightOfCards = (constraints.biggest.height - spacerHeight) / 2.0;
|
||||
double heightOfImages = heightOfCards - ProductCard.kTextBoxHeight;
|
||||
double imageAspectRatio =
|
||||
(heightOfImages >= 0.0 && constraints.biggest.width > heightOfImages)
|
||||
? constraints.biggest.width / heightOfImages
|
||||
: 33 / 49;
|
||||
double heightOfCards =
|
||||
(constraints.biggest.height - spacerHeight) / 2.0;
|
||||
double heightOfImages = heightOfCards - ProductCard.kTextBoxHeight;
|
||||
double imageAspectRatio = (heightOfImages >= 0.0 &&
|
||||
constraints.biggest.width > heightOfImages)
|
||||
? constraints.biggest.width / heightOfImages
|
||||
: 33 / 49;
|
||||
|
||||
return ListView(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.only(start: 28.0),
|
||||
child: top != null
|
||||
? ProductCard(
|
||||
imageAspectRatio: imageAspectRatio,
|
||||
product: top,
|
||||
)
|
||||
: SizedBox(
|
||||
height: heightOfCards > 0 ? heightOfCards : spacerHeight,
|
||||
),
|
||||
),
|
||||
SizedBox(height: spacerHeight),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.only(end: 28.0),
|
||||
child: ProductCard(
|
||||
imageAspectRatio: imageAspectRatio,
|
||||
product: bottom,
|
||||
return ListView(
|
||||
children: <Widget>[
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.only(start: 28.0),
|
||||
child: top != null
|
||||
? ProductCard(
|
||||
imageAspectRatio: imageAspectRatio,
|
||||
product: top,
|
||||
)
|
||||
: SizedBox(
|
||||
height: heightOfCards > 0 ? heightOfCards : spacerHeight,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
});
|
||||
SizedBox(height: spacerHeight),
|
||||
Padding(
|
||||
padding: EdgeInsetsDirectional.only(end: 28.0),
|
||||
child: ProductCard(
|
||||
imageAspectRatio: imageAspectRatio,
|
||||
product: bottom,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user