You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can fine-tune the behavior and appearance of your drawers using various parameters available for both `DrawerScaffold` and `SideDrawer`.
382
+
383
+
### `DrawerScaffold` Parameters:
384
+
385
+
***`drawers`**: A list of `SideDrawer` widgets, allowing you to define multiple drawers (e.g., left and right).
386
+
***`appBar`**: Provides a custom `AppBar` for your main content.
387
+
***`body` / `builder`**: Defines the main content area of your application. You should use either `body` for static content or `builder` if your content needs to react to drawer states (e.g., selected menu item).
388
+
***`contentShadow`**: Controls the shadow cast by the main content panel when a drawer is open.
389
+
***`cornerRadius`**: Sets the corner radius for the main content panel, giving it rounded edges.
390
+
***`controller`**: An optional `DrawerScaffoldController` for programmatic control over opening, closing, and toggling drawers.
391
+
***`enableGestures`**: A boolean flag to enable or disable horizontal drag gestures for opening/closing drawers.
392
+
***`defaultDirection`**: Specifies the initial drawer direction (e.g., `Direction.left`) that will be primarily controlled by `toggle()`.
393
+
***`onSlide`, `onOpened`, `onClosed`**: Callbacks that fire when the drawer slides, fully opens, or fully closes, respectively.
394
+
***`backgroundColor`**: The background color of the scaffold that sits behind your main content and drawers.
395
+
396
+
### `SideDrawer` Parameters:
397
+
398
+
***`menu`**: If you're building a menu-driven drawer, pass a `Menu` object containing your `MenuItem`s.
399
+
***`child`**: Alternatively, you can provide a single, fully custom `Widget` to be the content of the drawer.
400
+
***`itemBuilder`**: For highly customized or dynamically generated lists of items within the drawer, you can provide a `SideDrawerItemBuilder`.
401
+
***`direction`**: Determines whether the drawer slides from `Direction.left` or `Direction.right`.
402
+
***`drawerWidth`**: Sets the fixed width of the drawer in pixels.
403
+
***`peekSize`**: When `peekMenu` is enabled, this defines the visible width of the drawer when it's in its "peek" state.
404
+
***`percentage`**: If `slide` is true, this controls how much the main content scales down (e.g., `0.8` for 80% size) when the drawer opens.
405
+
***`degree`**: If a rotation animation is desired, this sets the degree of 3D rotation for the main content (clamped between 15 and 45 degrees).
406
+
***`slide`**: A boolean that, when true, makes the main content slide horizontally along with the drawer.
407
+
***`animation`**: Enables or disables subtle animation effects on individual menu items as the drawer opens.
408
+
***`peekMenu`**: If true, the drawer will remain partially visible (at `peekSize`) even when "closed."
409
+
***`hideOnItemPressed`**: When true, the drawer automatically closes after a menu item is tapped.
410
+
***`headerView`, `footerView`**: Custom widgets that can be placed at the top and bottom of the drawer content, respectively.
411
+
***`color`, `background`**: Control the background `Color` or `DecorationImage` of the drawer itself.
412
+
***`selectorColor`**: Sets the color of the visual indicator that highlights the currently selected menu item.
413
+
***`duration`, `curve`**: Define the `Duration` and `Curve` for the drawer's opening and closing animations.
0 commit comments