Skip to main content

compact_numeric_column

Function compact_numeric_column 

Source
pub fn compact_numeric_column<'a, 'b, T, F, Message, Renderer>(
    header: impl IntoFragment<'a>,
    view: impl Fn(T) -> F + 'b,
) -> Column<'a, 'b, T, Message, Theme, Renderer>
where T: 'a, F: IntoFragment<'a> + 'a, Message: 'a, Renderer: Renderer + Renderer + 'a,
Examples found in repository?
examples/showcase/pages/surfaces.rs (lines 41-43)
34fn data_table() -> material::Element<'static, Message> {
35    material::widget::data_table::standard(
36        [
37            material::widget::data_table::weighted_column(2, "Component", |row: InventoryRow| {
38                row.component
39            }),
40            material::widget::data_table::column("State", |row: InventoryRow| row.status),
41            material::widget::data_table::compact_numeric_column("Count", |row: InventoryRow| {
42                row.count.to_string()
43            }),
44        ],
45        INVENTORY_ROWS,
46    )
47    .into()
48}