DrawerMultiSelectField<T> class

Drawer variant implementation of MultiSelectField.

Behaves differently depending on whether scaffoldKey is provided:

With scaffoldKey — Renders the selection content directly. Place it inside your Scaffold's endDrawer or drawer:

Scaffold(
  key: scaffoldKey,
  endDrawer: Drawer(
    child: MultiSelectField<String>.drawer(
      label: 'Filter',
      keyDrawer: 'myFilter',
      scaffoldKey: scaffoldKey,
      data: () => choices,
      onSelect: (selected, _) => print(selected),
    ),
  ),
)

Without scaffoldKey — Renders a trigger widget that opens a standalone overlay drawer on tap:

MultiSelectField<String>.drawer(
  label: 'Filter',
  data: () => choices,
  onSelect: (selected, _) => print(selected),
)
Inheritance

Constructors

DrawerMultiSelectField({Key? key, required String label, List<Choice<T>> data()?, void onSelect(List<Choice<T>> choiceList, bool isFromDefaultData)?, void onChanged(List<Choice<T>> selectedItems)?, List<Choice<T>>? defaultData, Widget? menuContent, Widget? menuHeader, Widget? menuFooter, DrawerStyle? drawerStyle, String? keyDrawer, GlobalKey<ScaffoldState>? scaffoldKey, VoidCallback? onOpened, VoidCallback? onClosed, bool enabled = true, Widget? child, bool singleSelection = false, bool selectAllOption = false, bool useTextFilter = false, bool closeOnSelect = false, TextStyle? titleMenuStyle, TextStyle? itemMenuStyle, EdgeInsetsGeometry? titleMenuPadding})
const

Properties

child Widget?
final
closeOnSelect bool
final
data List<Choice<T>> Function()?
final
defaultData List<Choice<T>>?
final
drawerStyle DrawerStyle?
final
enabled bool
final
hashCode int
The hash code for this object.
no setterinherited
itemMenuStyle TextStyle?
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
keyDrawer String?
final
label String
final
final
final
final
onChanged → void Function(List<Choice<T>> selectedItems)?
final
onClosed VoidCallback?
final
onOpened VoidCallback?
final
onSelect → void Function(List<Choice<T>> choiceList, bool isFromDefaultData)?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scaffoldKey GlobalKey<ScaffoldState>?
final
selectAllOption bool
final
singleSelection bool
final
titleMenuPadding EdgeInsetsGeometry?
final
titleMenuStyle TextStyle?
final
useTextFilter bool
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<DrawerMultiSelectField<T>>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited