Skip to content
On this page

Drawer

A slide-in panel for navigation or supplementary content.

Drawer in FluttyUIDrawer in FluttyUI dark theme

Import

import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart' as ui;

API Reference

The declarations below match the current FluttyUI source. Types are shown without the optional ui. import prefix.

Drawer

const Drawer({
  super.key,
  required this.child,
  this.header,
  this.footer,
  this.placement = DrawerPlacement.start,
  this.width = 320,
  this.padding,
  this.backgroundColor,
  this.borderRadius,
  this.onClose,
  this.showCloseButton = true,
  this.semanticLabel = 'Navigation',
});
ParameterTypeRequiredDefault
keyKey?Nonull
childWidgetYes—
headerWidget?Nonull
footerWidget?Nonull
placementDrawerPlacementNoDrawerPlacement.start
widthdoubleNo320
paddingEdgeInsetsGeometry?Nonull
backgroundColorColor?Nonull
borderRadiusdouble?Nonull
onCloseVoidCallback?Nonull
showCloseButtonboolNotrue
semanticLabelStringNo'Navigation'

Future<T?> show<T>

static Future<T?> show<T>({
  required BuildContext context,
  required Widget child,
  Widget? header,
  Widget? footer,
  DrawerPlacement placement = DrawerPlacement.start,
  double width = 320,
  EdgeInsetsGeometry? padding,
  Color? backgroundColor,
  double? borderRadius,
  bool showCloseButton = true,
  bool barrierDismissible = true,
  bool swipeToDismiss = true,
  String semanticLabel = 'Navigation',
  String barrierLabel = 'Dismiss navigation',
  ComponentMotion? motion,
});

Application Setup

Place components under FluttyApp to provide theme, navigation, localization, and overlay defaults. Use theme tokens for shared appearance settings.

Source

lib/src/widgets/navigation/drawer/drawer.dart

This reference is generated from the Drawer declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

DartFlutter

Get started with FluttyUI