Split View

Loading preview

Starting the Flutter app

Master-detail layout, collapses to single pane on mobile

Get the source

Add it to your project

Copies the Dart source into your app, so you own it. Flutter SDK only, no extra packages.

First time? Run dart pub global activate fluttertemplates_dev, or read the CLI guide.

How it works

LayoutBuilder switches at 600px. Wide screens get a folder list, email list and detail Card side by side; narrow screens run _buildNarrowLayout, which swaps between list and detail and drops the folders. Tapping an email sets _selectedEmail and _showDetail on both layouts, so a closed detail pane reopens. One gap remains: _selectedIndex highlights a folder but _emails never changes.

Adapting it

  • Filter or fetch _emails by _selectedIndex.
  • Replace the nested AppBar in _buildNarrowLayout with a pushed route so the system back gesture works.
  • Load the message body for _selectedEmail in place of the placeholder text.