Heads up... You're reading this book for free, with parts of this chapter shown beyond this point astext.
You can unlock the rest of this book, and our entire catalogue of books and videos, with a raywenderlich.com Professional subscription.
In recipes_grid_view.dart, replace the
gridDelegate parameter with the following:
const SliverGridDelegateWithMaxCrossAxisExtent(maxCrossAxisExtent: 500.0),
Recall that the
GridView is set to scroll in the vertical direction. That means the cross axis is horizontal. According to Flutter’s documentation,
maxCrossAxisExtent sets the maximum extent of tiles in the cross axis. So making
maxCrossAxisExtent greater than the device’s width would allow for only one column!