ShadResizablePanel constructor

const ShadResizablePanel({
  1. Key? key,
  2. required Object id,
  3. required Widget child,
  4. required double defaultSize,
  5. double minSize = 0.0,
  6. double maxSize = 1.0,
})

A widget that represents a single resizable panel within a ShadResizablePanelGroup.

The ShadResizablePanel allows users to define a panel that can be resized dynamically. It requires an ID for uniqueness, a child widget to display, and size constraints to control the resizing behavior. This panel can be part of a larger group of panels that can be resized relative to each other.

Implementation

const ShadResizablePanel({
  super.key,
  required this.id,
  required this.child,
  required this.defaultSize,
  this.minSize = 0.0,
  this.maxSize = 1.0,
}) : assert(
       minSize >= 0,
       'minSize must be greater than or equal to 0',
     ),
     assert(
       maxSize >= 0,
       'maxSize must be greater than or equal to 0',
     ),
     assert(
       minSize <= maxSize,
       'minSize must be less than or equal to maxSize',
     ),
     assert(
       defaultSize >= minSize && defaultSize <= maxSize,
       'defaultSize must be greater than or equal to minSize and less than'
       ' or equal to maxSize',
     );