Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
a12c5618
Unverified
Commit
a12c5618
authored
Apr 08, 2019
by
rami-a
Committed by
GitHub
Apr 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent vertical scroll in shrine by ensuring card size fits the screen (#30455)
parent
0b8403b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
product_columns.dart
...gallery/lib/demo/shrine/supplemental/product_columns.dart
+6
-4
No files found.
examples/flutter_gallery/lib/demo/shrine/supplemental/product_columns.dart
View file @
a12c5618
...
@@ -31,10 +31,12 @@ class TwoProductCardColumn extends StatelessWidget {
...
@@ -31,10 +31,12 @@ class TwoProductCardColumn extends StatelessWidget {
const
double
spacerHeight
=
44.0
;
const
double
spacerHeight
=
44.0
;
final
double
heightOfCards
=
(
constraints
.
biggest
.
height
-
spacerHeight
)
/
2.0
;
final
double
heightOfCards
=
(
constraints
.
biggest
.
height
-
spacerHeight
)
/
2.0
;
final
double
heightOfImages
=
heightOfCards
-
ProductCard
.
kTextBoxHeight
;
final
double
availableHeightForImages
=
heightOfCards
-
ProductCard
.
kTextBoxHeight
;
final
double
imageAspectRatio
=
(
heightOfImages
>=
0.0
&&
constraints
.
biggest
.
width
>
heightOfImages
)
// Ensure the cards take up the available space as long as the screen is
?
constraints
.
biggest
.
width
/
heightOfImages
// sufficiently tall, otherwise fallback on a constant aspect ratio.
:
33
/
49
;
final
double
imageAspectRatio
=
availableHeightForImages
>=
0.0
?
constraints
.
biggest
.
width
/
availableHeightForImages
:
49.0
/
33.0
;
return
ListView
(
return
ListView
(
physics:
const
ClampingScrollPhysics
(),
physics:
const
ClampingScrollPhysics
(),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment