Skip to main content

button_with_icon

Function button_with_icon 

Source
pub fn button_with_icon<State: 'static, F: Fn(&mut State) + 'static>(
    icon: impl View<State>,
    label: impl Into<String>,
    on_press: F,
) -> ButtonView<State>
Expand description

Create a filled button laying icon out beside label — the reference’s M3EButton.icon factory (m3e_buttons.dart:64).

The icon is measured at the size’s own icon dimension and separated from the label by the size’s icon gap (the module docs’ Sizes table); ButtonView::icon_alignment moves it to the trailing side. Identical to button(label, on_press).icon(icon) — both spellings exist because the reference has both a factory and an iconAlignment-carrying decoration.