AdaptiveComposer constructor
const
AdaptiveComposer({
- Key? key,
- required Widget editor,
- required Widget preview,
- required Widget settings,
- Widget? header,
- String editorTitle = 'Editor',
- String? editorDescription,
- Widget? editorLeading,
- String previewTitle = 'Preview',
- String? previewDescription,
- Widget? previewLeading,
- String settingsTitle = 'Settings',
- String? settingsDescription,
- Widget? settingsLeading,
- String modalSettingsLabel = 'Open settings',
- Widget modalSettingsIcon = const Icon(Icons.tune_outlined),
- AdaptiveSize splitAt = AdaptiveSize.medium,
- AdaptiveSize settingsDockedAt = AdaptiveSize.expanded,
- AdaptiveHeight minimumSplitHeight = AdaptiveHeight.compact,
- AdaptiveHeight minimumSettingsDockedHeight = AdaptiveHeight.medium,
- bool useContainerConstraints = true,
- bool considerOrientation = false,
- AdaptiveComposerSurface? selectedSurface,
- AdaptiveComposerSurface initialSurface = AdaptiveComposerSurface.editor,
- ValueChanged<
AdaptiveComposerSurface> ? onSelectedSurfaceChanged, - double spacing = 16,
- double selectorSpacing = 16,
- int editorFlex = 3,
- int previewFlex = 3,
- int settingsFlex = 2,
- EdgeInsetsGeometry editorPadding = const EdgeInsets.all(16),
- EdgeInsetsGeometry previewPadding = const EdgeInsets.all(16),
- EdgeInsetsGeometry settingsPadding = const EdgeInsets.all(16),
- double modalHeightFactor = 0.72,
- bool showModalDragHandle = true,
- bool animateSize = true,
- Duration animationDuration = const Duration(milliseconds: 250),
- Curve animationCurve = Curves.easeInOutCubic,
Creates an adaptive composer.
Implementation
const AdaptiveComposer({
super.key,
required this.editor,
required this.preview,
required this.settings,
this.header,
this.editorTitle = 'Editor',
this.editorDescription,
this.editorLeading,
this.previewTitle = 'Preview',
this.previewDescription,
this.previewLeading,
this.settingsTitle = 'Settings',
this.settingsDescription,
this.settingsLeading,
this.modalSettingsLabel = 'Open settings',
this.modalSettingsIcon = const Icon(Icons.tune_outlined),
this.splitAt = AdaptiveSize.medium,
this.settingsDockedAt = AdaptiveSize.expanded,
this.minimumSplitHeight = AdaptiveHeight.compact,
this.minimumSettingsDockedHeight = AdaptiveHeight.medium,
this.useContainerConstraints = true,
this.considerOrientation = false,
this.selectedSurface,
this.initialSurface = AdaptiveComposerSurface.editor,
this.onSelectedSurfaceChanged,
this.spacing = 16,
this.selectorSpacing = 16,
this.editorFlex = 3,
this.previewFlex = 3,
this.settingsFlex = 2,
this.editorPadding = const EdgeInsets.all(16),
this.previewPadding = const EdgeInsets.all(16),
this.settingsPadding = const EdgeInsets.all(16),
this.modalHeightFactor = 0.72,
this.showModalDragHandle = true,
this.animateSize = true,
this.animationDuration = const Duration(milliseconds: 250),
this.animationCurve = Curves.easeInOutCubic,
}) : assert(spacing >= 0, 'spacing must be zero or greater.'),
assert(
selectorSpacing >= 0,
'selectorSpacing must be zero or greater.',
),
assert(editorFlex > 0, 'editorFlex must be greater than zero.'),
assert(previewFlex > 0, 'previewFlex must be greater than zero.'),
assert(settingsFlex > 0, 'settingsFlex must be greater than zero.'),
assert(
modalHeightFactor > 0 && modalHeightFactor <= 1,
'modalHeightFactor must be between 0 and 1.',
);