Skip to main content

DataTableThemeData

Struct DataTableThemeData 

Source
pub struct DataTableThemeData {
Show 16 fields pub decoration: Option<DecorationRef>, pub data_row_color: Option<WidgetStatePropertyRef<Option<Color>>>, pub data_row_min_height: Option<f64>, pub data_row_max_height: Option<f64>, pub data_text_style: Option<TextStyle>, pub heading_row_color: Option<WidgetStatePropertyRef<Option<Color>>>, pub heading_row_height: Option<f64>, pub heading_text_style: Option<TextStyle>, pub horizontal_margin: Option<f64>, pub column_spacing: Option<f64>, pub divider_thickness: Option<f64>, pub checkbox_horizontal_margin: Option<f64>, pub heading_cell_cursor: Option<WidgetStatePropertyRef<Option<MouseCursorRef>>>, pub data_row_cursor: Option<WidgetStatePropertyRef<Option<MouseCursorRef>>>, pub heading_row_alignment: Option<MainAxisAlignment>, pub sort_icon_builder: Option<DataTableSortIconBuilder>,
}
Expand description

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::copy_with.

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

All DataTableThemeData properties are None by default. When null, the DataTable provides its own defaults.

See also:

  • DataTable, which uses this to style itself.
  • ThemeData, which describes the overall theme information for the application.

Fields§

§decoration: Option<DecorationRef>

The background and borders of the table used by a DataTable widget.

The DataTable stacks this decoration with the Material it is rendered in.

§data_row_color: Option<WidgetStatePropertyRef<Option<Color>>>

The background color of the table’s rows.

If None, DataTable uses ThemeData::data_table_theme’s default instead.

§data_row_min_height: Option<f64>

The height of each row (excluding the row that contains column headings).

Dart’s dataRowMinHeight; None lets DataTable default it.

§data_row_max_height: Option<f64>

The maximum height of each row (excluding the row that contains column headings).

§data_text_style: Option<TextStyle>

The text style for data rows.

§heading_row_color: Option<WidgetStatePropertyRef<Option<Color>>>

The background color of the heading row.

§heading_row_height: Option<f64>

The height of the heading row.

§heading_text_style: Option<TextStyle>

The text style for the heading row.

§horizontal_margin: Option<f64>

The horizontal margin between the edges of the table and the content in the first and last cells of each row.

§column_spacing: Option<f64>

The horizontal margin between the contents of each data column.

§divider_thickness: Option<f64>

The thickness of the divider between rows.

§checkbox_horizontal_margin: Option<f64>

Horizontal margin around the checkbox, if it is displayed.

§heading_cell_cursor: Option<WidgetStatePropertyRef<Option<MouseCursorRef>>>

If specified, overrides the default value of DataColumn::mouse_cursor.

§data_row_cursor: Option<WidgetStatePropertyRef<Option<MouseCursorRef>>>

If specified, overrides the default value of DataRow::mouse_cursor.

§heading_row_alignment: Option<MainAxisAlignment>

If specified, overrides the default value of DataTable::heading_row_alignment.

§sort_icon_builder: Option<DataTableSortIconBuilder>

If specified, overrides the default value of DataTable::sort_icon_builder.

Implementations§

Source§

impl DataTableThemeData

Source

pub fn new() -> DataTableThemeData

Creates a theme that can be used for ThemeData::data_table_theme and DataTableTheme; Dart’s optional named arguments are the fluent setters.

Source

pub fn decoration( self, decoration: impl Into<DecorationRef>, ) -> DataTableThemeData

Dart DataTableThemeData(decoration:).

Source

pub fn data_row_color( self, data_row_color: WidgetStatePropertyRef<Option<Color>>, ) -> DataTableThemeData

Dart DataTableThemeData(dataRowColor:).

Source

pub fn data_row_height(self, data_row_height: f64) -> DataTableThemeData

👎Deprecated:

Migrate to use data_row_min_height and data_row_max_height instead. This feature was deprecated after v3.7.0-5.0.pre.

Dart’s deprecated DataTableThemeData(dataRowHeight:): it sets data_row_min_height and data_row_max_height to one value.

Dart asserts that the argument is not given with either of them in one call; a fluent chain has no call to compare, so a later setter replaces what an earlier one wrote.

Source

pub fn data_row_min_height(self, data_row_min_height: f64) -> DataTableThemeData

Dart DataTableThemeData(dataRowMinHeight:).

Source

pub fn data_row_max_height(self, data_row_max_height: f64) -> DataTableThemeData

Dart DataTableThemeData(dataRowMaxHeight:).

Source

pub fn data_text_style(self, data_text_style: TextStyle) -> DataTableThemeData

Dart DataTableThemeData(dataTextStyle:).

Source

pub fn heading_row_color( self, heading_row_color: WidgetStatePropertyRef<Option<Color>>, ) -> DataTableThemeData

Dart DataTableThemeData(headingRowColor:).

Source

pub fn heading_row_height(self, heading_row_height: f64) -> DataTableThemeData

Dart DataTableThemeData(headingRowHeight:).

Source

pub fn heading_text_style( self, heading_text_style: TextStyle, ) -> DataTableThemeData

Dart DataTableThemeData(headingTextStyle:).

Source

pub fn horizontal_margin(self, horizontal_margin: f64) -> DataTableThemeData

Dart DataTableThemeData(horizontalMargin:).

Source

pub fn column_spacing(self, column_spacing: f64) -> DataTableThemeData

Dart DataTableThemeData(columnSpacing:).

Source

pub fn divider_thickness(self, divider_thickness: f64) -> DataTableThemeData

Dart DataTableThemeData(dividerThickness:).

Source

pub fn checkbox_horizontal_margin( self, checkbox_horizontal_margin: f64, ) -> DataTableThemeData

Dart DataTableThemeData(checkboxHorizontalMargin:).

Source

pub fn heading_cell_cursor( self, heading_cell_cursor: WidgetStatePropertyRef<Option<MouseCursorRef>>, ) -> DataTableThemeData

Dart DataTableThemeData(headingCellCursor:).

Source

pub fn data_row_cursor( self, data_row_cursor: WidgetStatePropertyRef<Option<MouseCursorRef>>, ) -> DataTableThemeData

Dart DataTableThemeData(dataRowCursor:).

Source

pub fn heading_row_alignment( self, heading_row_alignment: MainAxisAlignment, ) -> DataTableThemeData

Dart DataTableThemeData(headingRowAlignment:).

Source

pub fn sort_icon_builder( self, sort_icon_builder: impl Fn(&mut App, BuildContext, bool, bool) -> WidgetRef + 'static, ) -> DataTableThemeData

Dart DataTableThemeData(sortIconBuilder:).

Source

pub fn data_row_height_value(&self) -> Option<f64>

👎Deprecated:

Migrate to use data_row_min_height and data_row_max_height instead. This feature was deprecated after v3.7.0-5.0.pre.

Dart’s deprecated dataRowHeight getter: the row height, if the minimum and the maximum are the same.

Source

pub fn copy_with(&self) -> DataTableThemeData

Creates a copy of this object but with the given fields replaced with the new values.

Dart’s named arguments are the fluent setters on the copy (data.copy_with().divider_thickness(2.0)); the deprecated dataRowHeight argument is data_row_height, which replaces both heights.

Source

pub fn lerp( a: &DataTableThemeData, b: &DataTableThemeData, t: f64, ) -> DataTableThemeData

Linearly interpolates between two DataTableThemeData.

{@macro dart.ui.shadow.lerp}

Trait Implementations§

Source§

impl Clone for DataTableThemeData

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DataTableThemeData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DataTableThemeData

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Diagnosticable for DataTableThemeData

Source§

fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)

Add additional properties associated with the node.
Source§

fn type_name(&self) -> &'static str

Dart’s Object.runtimeType as diagnostics print it: the last segment of the Rust type path, without generic arguments.
Source§

fn identity_hash(&self) -> u64

Dart’s Object.hashCode as diagnostics print it: the object’s address.
Source§

fn to_string_short(&self) -> String

A brief description of this object, usually just the type and the hash.
Source§

fn to_diagnostics_node(&self) -> DiagnosticableNode

Returns a debug representation of the object used by debugging tools and by DiagnosticsNode::to_string_deep.
Source§

fn to_diagnostics_node_with( &self, name: Option<String>, style: Option<DiagnosticsTreeStyle>, ) -> DiagnosticableNode

Dart toDiagnosticsNode(name:, style:).
Source§

fn to_string(&self) -> String

Dart’s toString: a single-line description with properties and no children. Read more
Source§

fn to_string_at(&self, min_level: DiagnosticLevel) -> String

Dart’s toString(minLevel:).
Source§

impl Display for DataTableThemeData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for DataTableThemeData

Source§

fn eq(&self, other: &DataTableThemeData) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for DataTableThemeData

§

impl !Send for DataTableThemeData

§

impl !Sync for DataTableThemeData

§

impl !UnwindSafe for DataTableThemeData

§

impl Forget for DataTableThemeData

§

impl Freeze for DataTableThemeData
where *const RcInner<dyn Decoration> is !null: Freeze, PhantomData<RcInner<dyn Decoration>>: Freeze, *const RcInner<dyn WidgetStateProperty<Option<Color>>> is !null: Freeze, PhantomData<RcInner<dyn WidgetStateProperty<Option<Color>>>>: Freeze, &'static dyn ColorExtension: Freeze, *const RcInner<dyn ColorExtension> is !null: Freeze, PhantomData<RcInner<dyn ColorExtension>>: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze, PhantomData<String>: Freeze, *const RcInner<Paint> is !null: Freeze, PhantomData<RcInner<Paint>>: Freeze, PhantomData<Shadow>: Freeze, PhantomData<FontFeature>: Freeze, PhantomData<FontVariation>: Freeze, *const RcInner<dyn WidgetStateProperty<Option<Rc<dyn MouseCursor>>>> is !null: Freeze, PhantomData<RcInner<dyn WidgetStateProperty<Option<Rc<dyn MouseCursor>>>>>: Freeze, *const RcInner<dyn Fn(&mut App, AnyElement, bool, bool) -> Rc<dyn Widget>> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, AnyElement, bool, bool) -> Rc<dyn Widget>>>: Freeze,

§

impl Move for DataTableThemeData

§

impl Unpin for DataTableThemeData

§

impl UnsafeUnpin for DataTableThemeData

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>