DataTableThemeData class

Defines default property values for descendant DataTable widgets.

Descendant widgets obtain the current DataTableThemeData object using DataTableTheme.of. Instances of DataTableThemeData can be customized with DataTableThemeData.copyWith.

Typically a DataTableThemeData is specified as part of the overall Theme with ThemeData.dataTableTheme.

All DataTableThemeData properties are null by default. When null, the DataTable will use the values from ThemeData if they exist, otherwise it will provide its own defaults based on the overall Theme's textTheme and colorScheme. See the individual DataTable properties for details.

See also:

  • ThemeData, which describes the overall theme information for the application.
Mixed-in types
Annotations

Constructors

DataTableThemeData({Decoration? decoration, WidgetStateProperty<Color?>? dataRowColor, @Deprecated('Migrate to use dataRowMinHeight and dataRowMaxHeight instead. ' 'This feature was deprecated after v3.7.0-5.0.pre.') double? dataRowHeight, double? dataRowMinHeight, double? dataRowMaxHeight, TextStyle? dataTextStyle, WidgetStateProperty<Color?>? headingRowColor, double? headingRowHeight, TextStyle? headingTextStyle, double? horizontalMargin, double? columnSpacing, double? dividerThickness, double? checkboxHorizontalMargin, WidgetStateProperty<MouseCursor?>? headingCellCursor, WidgetStateProperty<MouseCursor?>? dataRowCursor, MainAxisAlignment? headingRowAlignment})
Creates a theme that can be used for ThemeData.dataTableTheme.
const

Properties

checkboxHorizontalMargin → double?
Horizontal margin around the checkbox, if it is displayed.
final
columnSpacing → double?
The horizontal margin between the contents of each data column.
final
dataRowColor → WidgetStateProperty<Color?>?
The background color for the data rows.
final
dataRowCursor → WidgetStateProperty<MouseCursor?>?
If specified, overrides the default value of DataRow.mouseCursor.
final
dataRowHeight → double?
The height of each row (excluding the row that contains column headings).
no setter
dataRowMaxHeight → double?
The maximum height of each row (excluding the row that contains column headings).
final
dataRowMinHeight → double?
The minimum height of each row (excluding the row that contains column headings).
final
dataTextStyle → TextStyle?
The text style for data rows.
final
decoration → Decoration?
The background and border decoration for the table.
final
dividerThickness → double?
The width of the divider that appears between TableRows.
final
hashCode → int
The hash code for this object.
no setteroverride
headingCellCursor → WidgetStateProperty<MouseCursor?>?
If specified, overrides the default value of DataColumn.mouseCursor.
final
headingRowAlignment → MainAxisAlignment?
If specified, overrides the default value of DataColumn.headingRowAlignment.
final
headingRowColor → WidgetStateProperty<Color?>?
The background color for the heading row.
final
headingRowHeight → double?
The height of the heading row.
final
headingTextStyle → TextStyle?
The text style for the heading row.
final
horizontalMargin → double?
The horizontal margin between the edges of the table and the content in the first and last cells of each row.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({Decoration? decoration, WidgetStateProperty<Color?>? dataRowColor, double? dataRowHeight, double? dataRowMinHeight, double? dataRowMaxHeight, TextStyle? dataTextStyle, WidgetStateProperty<Color?>? headingRowColor, double? headingRowHeight, TextStyle? headingTextStyle, double? horizontalMargin, double? columnSpacing, double? dividerThickness, double? checkboxHorizontalMargin, WidgetStateProperty<MouseCursor?>? headingCellCursor, WidgetStateProperty<MouseCursor?>? dataRowCursor, MainAxisAlignment? headingRowAlignment}) → DataTableThemeData
Creates a copy of this object but with the given fields replaced with the new values.
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
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
toStringShort() → String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

lerp(DataTableThemeData a, DataTableThemeData b, double t) → DataTableThemeData
Linearly interpolate between two DataTableThemeDatas.