The previous example could be rewritten using LayoutBuilder:

This widget can now be composed within a side panel,
dialog, or even a full-screen view,
and adapt its layout to whatever space is provided.

Device segmentation

There are times when you want to make layout decisions
based on the actual platform you’re running on,
regardless of size. For example, when building a
custom title bar, you might need to check the operating
system type and tweak the layout of your title bar, so
it doesn’t get covered by the native window buttons.

To determine which combination of platforms you’re on,
you can use the Platform API along with the kIsWeb value:

The Platform API can’t be accessed from web builds without 
throwing an exception, because the dart.io package is not
supported on the web target. As a result, this code checks 
for web first, and because of short-circuiting, Dart will 
never call Platform on web targets.