pub struct DoNothingAction { /* private fields */ }Expand description
An Action that doesn’t perform any action when invoked.
Attaching a DoNothingAction to an Actions::actions mapping is a way to disable an
action defined by a widget higher in the widget hierarchy.
If Action::consumes_key returns false, then not only will this action do nothing, but it
will stop the propagation of the key event used to trigger it to other widgets in the focus
chain and tell the embedding that the key wasn’t handled, allowing text input fields or
other non-Flutter elements to receive that key event. The return value of
Action::consumes_key can be set via the consumes_key argument to the constructor.
This action can be bound to any Intent.
See also:
DoNothingIntent, which is an intent that can be bound to a key set in aShortcutswidget to do nothing.DoNothingAndStopPropagationIntent, which is an intent that can be bound to a key set in aShortcutswidget to do nothing and also stop key event propagation to other key handlers in the focus chain.
Implementations§
Source§impl DoNothingAction
impl DoNothingAction
Sourcepub fn new(app: &mut App) -> Ref<DoNothingAction>
pub fn new(app: &mut App) -> Ref<DoNothingAction>
Creates a DoNothingAction.
Dart’s optional consumesKey argument defaults to true.
Sourcepub fn set_consumes_key(self: Handle<Self>, app: &mut App, consumes_key: bool)
pub fn set_consumes_key(self: Handle<Self>, app: &mut App, consumes_key: bool)
Dart DoNothingAction(consumesKey:).
Trait Implementations§
Source§impl Action for DoNothingAction
impl Action for DoNothingAction
Source§fn action_data(self: Handle<Self>, app: &App) -> &ActionData
fn action_data(self: Handle<Self>, app: &App) -> &ActionData
Source§fn action_data_mut(self: Handle<Self>, app: &mut App) -> &mut ActionData
fn action_data_mut(self: Handle<Self>, app: &mut App) -> &mut ActionData
action_data.Source§fn consumes_key(self: Handle<Self>, app: &mut App, _intent: &dyn Intent) -> bool
fn consumes_key(self: Handle<Self>, app: &mut App, _intent: &dyn Intent) -> bool
Source§fn invoke(
self: Handle<Self>,
_app: &mut App,
_intent: &dyn Intent,
) -> Option<Rc<dyn Any>>
fn invoke( self: Handle<Self>, _app: &mut App, _intent: &dyn Intent, ) -> Option<Rc<dyn Any>>
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, )
Action.debugFillProperties, from Diagnosticable: an action adds its own
fields.Source§fn intent_type() -> TypeId
fn intent_type() -> TypeId
Source§fn update_calling_action(
self: Handle<Self>,
app: &mut App,
value: Option<ActionRef>,
)
fn update_calling_action( self: Handle<Self>, app: &mut App, value: Option<ActionRef>, )
calling_action; overridden by the overridable actions so
that the default action sees it too.Source§fn is_enabled(self: Handle<Self>, app: &mut App, intent: &Self::Intent) -> bool
fn is_enabled(self: Handle<Self>, app: &mut App, intent: &Self::Intent) -> bool
Source§fn to_key_event_result(
self: Handle<Self>,
app: &mut App,
intent: &Self::Intent,
invoke_result: Option<&Rc<dyn Any>>,
) -> KeyEventResult
fn to_key_event_result( self: Handle<Self>, app: &mut App, intent: &Self::Intent, invoke_result: Option<&Rc<dyn Any>>, ) -> KeyEventResult
Source§fn add_action_listener(
self: Handle<Self>,
app: &mut App,
listener: ActionListenerCallback,
)
fn add_action_listener( self: Handle<Self>, app: &mut App, listener: ActionListenerCallback, )
Source§fn remove_action_listener(
self: Handle<Self>,
app: &mut App,
listener: &ActionListenerCallback,
)
fn remove_action_listener( self: Handle<Self>, app: &mut App, listener: &ActionListenerCallback, )
Source§fn notify_action_listeners(self: Handle<Self>, app: &mut App)
fn notify_action_listeners(self: Handle<Self>, app: &mut App)
Source§fn make_overridable_action(
self: Handle<Self>,
app: &mut App,
context: BuildContext,
) -> ActionRef
fn make_overridable_action( self: Handle<Self>, app: &mut App, context: BuildContext, ) -> ActionRef
Action._makeOverridableAction: the overridable form of this action, which
AnyAction::overridable hands back.