Resizable panels
A split view lets a reader trade space between two related panes. Keep a useful minimum width for each pane when the divider moves.
Resize the panes
#Drag the divider between Files and Notes, or focus it and use the horizontal arrow keys. Watch the two panes exchange space.
components/resizable-panels/appliance/resize_panes.dart
import 'package:flutter/widgets.dart';
import 'package:appliance_ui/appliance_ui.dart';
class ResizePanes extends StatelessWidget {
const ResizePanes({super.key});
@override
Widget build(BuildContext context) => ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 640),
child: const SizedBox(
height: 140,
child: ApplianceSplitView(
minFirst: 88,
minSecond: 88,
first: Center(child: Text('Files')),
second: Center(child: Text('Notes')),
),
),
);
}
Parameters
ApplianceSplitView API ↗first- The first pane.
second- The second pane.
axis- Side by side (Axis.horizontal) or stacked.
fraction- The first pane's share, when you hold it.
initialFraction- The first pane's share to start with.
onChanged- Called with the first pane's new share.
minFirst- The minimum extent of the first pane.
minSecond- The minimum extent of the second pane.
semanticLabel- The grip's name for a screen reader.
Shared behaviour
- Keyboard and focus. Tab to the divider and use Left or Right to adjust it. Enter collapses the first pane and restores it on a second press.
- Screen readers. Inspect the divider’s adjustable value. Move it and read the new position, then read the labels in both panes.
- Direction and type. In RTL the first pane begins on the right. At phone width and larger type, try the minimum width on each side.