Skip to main content

DataCell

Struct DataCell 

Source
pub struct DataCell {
    pub child: WidgetRef,
    pub placeholder: bool,
    pub show_edit_icon: bool,
    pub on_tap: Option<GestureTapCallback>,
    pub on_double_tap: Option<GestureTapCallback>,
    pub on_long_press: Option<GestureLongPressCallback>,
    pub on_tap_down: Option<GestureTapDownCallback>,
    pub on_tap_cancel: Option<GestureTapCancelCallback>,
}
Expand description

The data for a cell of a DataTable.

One list of DataCell objects must be provided for each DataRow in the DataTable, in the new DataRow constructor’s cells argument. This list must have the same length as the DataTable::columns argument to the DataTable.

Fields§

§child: WidgetRef

The data for the row.

Typically a Text widget or a DropdownButton widget.

If the cell has no data, then a Text widget with placeholder text should be provided instead, and then the placeholder argument should be set to true.

§placeholder: bool

Whether the child is actually a placeholder.

If this is true, the default text style for the cell is changed to be appropriate for placeholder text.

§show_edit_icon: bool

Whether to show an edit icon at the end of the cell.

This does not make the cell actually editable; the caller must implement editing behavior if desired (initiated from the on_tap callback).

If this is set, on_tap should also be set, otherwise tapping the icon will have no effect.

§on_tap: Option<GestureTapCallback>

Called if the cell is tapped.

If non-null, tapping the cell will call this callback. If null (including on_double_tap, on_long_press, on_tap_cancel and on_tap_down), tapping the cell will attempt to select the row (if DataRow::on_select_changed is provided).

§on_double_tap: Option<GestureTapCallback>

Called when the cell is double tapped.

If non-null, tapping the cell will call this callback. If null, tapping the cell will attempt to select the row (if DataRow::on_select_changed is provided).

§on_long_press: Option<GestureLongPressCallback>

Called if the cell is long-pressed.

If non-null, long-pressing the cell will call this callback. If null, long-pressing the cell will attempt to select the row (if DataRow::on_select_changed is provided).

§on_tap_down: Option<GestureTapDownCallback>

Called if the cell is tapped down.

If non-null, tapping down the cell will call this callback. If null, tapping down the cell will attempt to select the row (if DataRow::on_select_changed is provided).

§on_tap_cancel: Option<GestureTapCancelCallback>

Called if the user cancels a tap was started on cell.

If non-null, canceling the tap gesture will call this callback. If null, canceling the tap gesture will attempt to select the row (if DataRow::on_select_changed is provided).

Implementations§

Source§

impl DataCell

Source

pub fn new<K>(child: impl IntoWidget<K>) -> DataCell

Creates a data cell for a DataTable; Dart’s optional named arguments are the setters.

Source

pub fn empty() -> DataCell

A data cell that has no content and that has zero width and height.

This cell is used by default for cells in a DataRow where no cell is specified.

Dart’s static const DataCell empty.

Source

pub fn placeholder(self, placeholder: bool) -> DataCell

Dart DataCell(placeholder:).

Source

pub fn show_edit_icon(self, show_edit_icon: bool) -> DataCell

Dart DataCell(showEditIcon:).

Source

pub fn on_tap(self, on_tap: GestureTapCallback) -> DataCell

Dart DataCell(onTap:).

Source

pub fn on_double_tap(self, on_double_tap: GestureTapCallback) -> DataCell

Dart DataCell(onDoubleTap:).

Source

pub fn on_long_press(self, on_long_press: GestureLongPressCallback) -> DataCell

Dart DataCell(onLongPress:).

Source

pub fn on_tap_down(self, on_tap_down: GestureTapDownCallback) -> DataCell

Dart DataCell(onTapDown:).

Source

pub fn on_tap_cancel(self, on_tap_cancel: GestureTapCancelCallback) -> DataCell

Dart DataCell(onTapCancel:).

Trait Implementations§

Source§

impl Clone for DataCell

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 DataCell

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for DataCell

§

impl !Send for DataCell

§

impl !Sync for DataCell

§

impl !UnwindSafe for DataCell

§

impl Forget for DataCell

§

impl Freeze for DataCell
where *const RcInner<dyn Widget> is !null: Freeze, PhantomData<RcInner<dyn Widget>>: Freeze, *const RcInner<dyn Fn(&mut App)> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App)>>: Freeze, NonZero<u32>: Freeze, *const (): Freeze, *const RcInner<dyn Fn(&mut App, TapDownDetails)> is !null: Freeze, PhantomData<RcInner<dyn Fn(&mut App, TapDownDetails)>>: Freeze,

§

impl Move for DataCell

§

impl Unpin for DataCell
where Rc<dyn Widget>: Unpin, Rc<dyn Fn(&mut App)>: Unpin, NonZero<u32>: Unpin, *const (): Unpin, Rc<dyn Fn(&mut App, TapDownDetails)>: Unpin,

§

impl UnsafeUnpin for DataCell
where *const RcInner<dyn Widget> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Widget>>: UnsafeUnpin, *const RcInner<dyn Fn(&mut App)> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App)>>: UnsafeUnpin, NonZeroU32Inner: UnsafeUnpin, *const (): UnsafeUnpin, *const RcInner<dyn Fn(&mut App, TapDownDetails)> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Fn(&mut App, TapDownDetails)>>: UnsafeUnpin,

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, 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>