Chapters

Hide chapters

Flutter Apprentice

Second Edition · Flutter 2.5.1 · Dart 2.14.2 · Android Studio 2020.3.1

Section IV: Networking, Persistence and State

Section 4: 7 chapters
Show chapters Hide chapters

Appendices

Section 7: 2 chapters
Show chapters Hide chapters

B. Appendix B: Chapter 5 Solution 2
Written by Vincent Ngo

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

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!

Have a technical question? Want to report a bug? You can ask questions and report bugs to the book authors in our official book forum here.
© 2024 Kodeco Inc.

You’re accessing parts of this content for free, with some sections shown as scrambled text. Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now