ModDataTableActionBarConfig class

Configuration class for the DataTable action bar.

The action bar supports dynamic composition through the actions list, allowing developers to add any widget (buttons, inputs, icons, etc.). The settings button (when enabled) is always positioned at the rightmost position.

Alternatively, you can use actionsModColumn to render actions within a responsive grid system using ModContainer > ModRow > columns structure.

Example usage:

ModDataTableActionBarConfig(
  actions: [
    IconButton(
      icon: Icon(Icons.picture_as_pdf, color: Colors.red),
      onPressed: () => exportToPdf(),
    ),
    IconButton(
      icon: Icon(Icons.table_chart, color: Colors.green),
      onPressed: () => exportToExcel(),
    ),
    SizedBox(
      width: 200,
      child: TextField(
        decoration: InputDecoration(hintText: 'Search...'),
      ),
    ),
  ],
  enableSettings: true,
  settingsOnChange: (columns) => updateVisibleColumns(columns),
)

Constructors

ModDataTableActionBarConfig({List<Widget> actions = const [], List<ModColumn>? actionsModColumn, bool enableSettings = false, dynamic settingsOnChange(List<String>)?, Widget? settingsIcon, String? settingsTooltip, String settingsModalTitle = 'Column Settings', String settingsModalConfirmText = 'Confirm', String settingsModalCancelText = 'Cancel', Color? background, BorderRadius? borderRadius})
const

Properties

actions List<Widget>
List of custom action widgets to display in the action bar. These widgets are rendered in order, from left to right. The settings button (if enabled) is always rendered after all actions. This is optional - if not provided, an empty list is used.
final
actionsModColumn List<ModColumn>?
List of ModColumn widgets to display in the action bar using a responsive grid. When provided, these are rendered inside a ModContainer > ModRow structure. This takes precedence over actions if both are provided.
final
background Color?
Background color for the action bar
final
borderRadius BorderRadius?
Border radius for the action bar
final
enableSettings bool
Enable settings/column configuration button. This button is always positioned at the rightmost position of the action bar.
final
hasAnyAction bool
Returns true if there are any actions, actionsModColumn, or if settings is enabled
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
settingsIcon Widget?
Icon widget for the settings button. Defaults to Icon(Icons.settings) if not provided.
final
settingsModalCancelText String
Cancel button text for the settings modal
final
settingsModalConfirmText String
Confirm button text for the settings modal
final
settingsModalTitle String
Title for the settings modal
final
settingsOnChange → dynamic Function(List<String>)?
Callback when column selection is confirmed in settings modal
final
settingsTooltip String?
Tooltip for the settings button
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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