AdaptiveComposer constructor

const AdaptiveComposer({
  1. Key? key,
  2. required Widget editor,
  3. required Widget preview,
  4. required Widget settings,
  5. Widget? header,
  6. String editorTitle = 'Editor',
  7. String? editorDescription,
  8. Widget? editorLeading,
  9. String previewTitle = 'Preview',
  10. String? previewDescription,
  11. Widget? previewLeading,
  12. String settingsTitle = 'Settings',
  13. String? settingsDescription,
  14. Widget? settingsLeading,
  15. String modalSettingsLabel = 'Open settings',
  16. Widget modalSettingsIcon = const Icon(Icons.tune_outlined),
  17. AdaptiveSize splitAt = AdaptiveSize.medium,
  18. AdaptiveSize settingsDockedAt = AdaptiveSize.expanded,
  19. AdaptiveHeight minimumSplitHeight = AdaptiveHeight.compact,
  20. AdaptiveHeight minimumSettingsDockedHeight = AdaptiveHeight.medium,
  21. bool useContainerConstraints = true,
  22. bool considerOrientation = false,
  23. AdaptiveComposerSurface? selectedSurface,
  24. AdaptiveComposerSurface initialSurface = AdaptiveComposerSurface.editor,
  25. ValueChanged<AdaptiveComposerSurface>? onSelectedSurfaceChanged,
  26. double spacing = 16,
  27. double selectorSpacing = 16,
  28. int editorFlex = 3,
  29. int previewFlex = 3,
  30. int settingsFlex = 2,
  31. EdgeInsetsGeometry editorPadding = const EdgeInsets.all(16),
  32. EdgeInsetsGeometry previewPadding = const EdgeInsets.all(16),
  33. EdgeInsetsGeometry settingsPadding = const EdgeInsets.all(16),
  34. double modalHeightFactor = 0.72,
  35. bool showModalDragHandle = true,
  36. bool animateSize = true,
  37. Duration animationDuration = const Duration(milliseconds: 250),
  38. 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.',
      );