pub struct PopupMenuItemState<T: Clone + PartialEq + 'static> { /* private fields */ }Expand description
The State for PopupMenuItem subclasses.
By default this implements the basic styling and layout of Material Design popup menu items.
The PopupMenuItemStateLeaf::build_child method can be overridden to adjust exactly
what gets placed in the menu. By default it returns PopupMenuItemData::child.
The PopupMenuItemStateLeaf::handle_tap method can be overridden to adjust exactly what
happens when the item is tapped. By default, it uses Navigator::pop to return the
PopupMenuItemData::value from the menu route.
This struct is the state of PopupMenuItem itself, Dart’s
PopupMenuItemState<T, PopupMenuItem<T>>; its associated functions are the bodies Dart’s
PopupMenuItemState gives its subclasses.
Implementations§
Source§impl<T: Clone + PartialEq + 'static> PopupMenuItemState<T>
impl<T: Clone + PartialEq + 'static> PopupMenuItemState<T>
Sourcepub fn build_child<S: PopupMenuItemStateLeaf<Widget: PopupMenuItemLeaf<Value = T>>>(
this: Handle<S>,
app: &mut App,
_context: BuildContext,
) -> Option<WidgetRef>
pub fn build_child<S: PopupMenuItemStateLeaf<Widget: PopupMenuItemLeaf<Value = T>>>( this: Handle<S>, app: &mut App, _context: BuildContext, ) -> Option<WidgetRef>
Sourcepub fn handle_tap<S: PopupMenuItemStateLeaf<Widget: PopupMenuItemLeaf<Value = T>>>(
this: Handle<S>,
app: &mut App,
)
pub fn handle_tap<S: PopupMenuItemStateLeaf<Widget: PopupMenuItemLeaf<Value = T>>>( this: Handle<S>, app: &mut App, )
Sourcepub fn build<S: PopupMenuItemStateLeaf<Widget: PopupMenuItemLeaf<Value = T>>>(
this: Handle<S>,
app: &mut App,
context: BuildContext,
) -> WidgetRef
pub fn build<S: PopupMenuItemStateLeaf<Widget: PopupMenuItemLeaf<Value = T>>>( this: Handle<S>, app: &mut App, context: BuildContext, ) -> WidgetRef
Dart’s PopupMenuItemState.build, which a leaf’s State::build runs.
Sourcepub fn build_semantics<S: PopupMenuItemStateLeaf<Widget: PopupMenuItemLeaf<Value = T>>>(
this: Handle<S>,
app: &mut App,
child: WidgetRef,
) -> WidgetRef
pub fn build_semantics<S: PopupMenuItemStateLeaf<Widget: PopupMenuItemLeaf<Value = T>>>( this: Handle<S>, app: &mut App, child: WidgetRef, ) -> WidgetRef
Trait Implementations§
Source§impl<T: Clone + PartialEq + 'static> PopupMenuItemStateLeaf for PopupMenuItemState<T>
impl<T: Clone + PartialEq + 'static> PopupMenuItemStateLeaf for PopupMenuItemState<T>
Source§fn build_child(
self: Handle<Self>,
app: &mut App,
context: BuildContext,
) -> Option<WidgetRef>
fn build_child( self: Handle<Self>, app: &mut App, context: BuildContext, ) -> Option<WidgetRef>
Source§impl<T: Clone + PartialEq + 'static> State for PopupMenuItemState<T>
impl<T: Clone + PartialEq + 'static> State for PopupMenuItemState<T>
Source§type Widget = PopupMenuItem<T>
type Widget = PopupMenuItem<T>
State<T> type argument.Source§fn state_data(self: Handle<Self>, app: &App) -> &StateData<Self::Widget>
fn state_data(self: Handle<Self>, app: &App) -> &StateData<Self::Widget>
state
(state_accessors!).Source§fn state_data_mut(
self: Handle<Self>,
app: &mut App,
) -> &mut StateData<Self::Widget>
fn state_data_mut( self: Handle<Self>, app: &mut App, ) -> &mut StateData<Self::Widget>
state_data.Source§fn build(self: Handle<Self>, app: &mut App, context: BuildContext) -> WidgetRef
fn build(self: Handle<Self>, app: &mut App, context: BuildContext) -> WidgetRef
Source§fn widget(self: Handle<Self>, app: &App) -> &Self::Widget
fn widget(self: Handle<Self>, app: &App) -> &Self::Widget
Source§fn context(self: Handle<Self>, app: &App) -> AnyElement
fn context(self: Handle<Self>, app: &App) -> AnyElement
Source§fn init_state(self: Handle<Self>, app: &mut App)
fn init_state(self: Handle<Self>, app: &mut App)
Source§fn did_update_widget(
self: Handle<Self>,
app: &mut App,
old_widget: &Self::Widget,
)
fn did_update_widget( self: Handle<Self>, app: &mut App, old_widget: &Self::Widget, )
Source§fn set_state(self: Handle<Self>, app: &mut App, f: impl FnOnce(&mut Self))
fn set_state(self: Handle<Self>, app: &mut App, f: impl FnOnce(&mut Self))
Source§fn deactivate(self: Handle<Self>, app: &mut App)
fn deactivate(self: Handle<Self>, app: &mut App)
Source§fn activate(self: Handle<Self>, app: &mut App)
fn activate(self: Handle<Self>, app: &mut App)
deactivate. Read moreSource§fn dispose(self: Handle<Self>, app: &mut App)
fn dispose(self: Handle<Self>, app: &mut App)
Source§fn did_change_dependencies(self: Handle<Self>, app: &mut App)
fn did_change_dependencies(self: Handle<Self>, app: &mut App)
Source§fn debug_fill_properties(
self: Handle<Self>,
app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( self: Handle<Self>, app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties this state shows where its element’s dump
names it (state: ScrollableState#1a2b3(offset: 0.0)), after the lifecycle and mounting
properties State’s base adds, which the framework adds first.