pub struct AnimatedSwitcherTransitionBuilder { /* private fields */ }Expand description
Signature for builders used to generate custom transitions for
AnimatedSwitcher.
The child should be transitioning in when the animation is running in
the forward direction.
The function should return a widget which wraps the given child. It may
also use the animation to inform its transition.
AnimatedSwitcher compares the builder it is given with the one it had, as Dart
compares two function values: new equals only its clones;
function equals any other built from the same function, as two
tear-offs of one static method are identical; handle_method equals
any other built from the same handle and function, as two tear-offs of one method on one
object are (see the porting skill’s callback-identity pattern).
Implementations§
Source§impl AnimatedSwitcherTransitionBuilder
impl AnimatedSwitcherTransitionBuilder
Sourcepub fn new(
builder: impl Fn(&mut App, &WidgetRef, AnimationRef<f64>) -> WidgetRef + 'static,
) -> AnimatedSwitcherTransitionBuilder
pub fn new( builder: impl Fn(&mut App, &WidgetRef, AnimationRef<f64>) -> WidgetRef + 'static, ) -> AnimatedSwitcherTransitionBuilder
Wraps a closure; it equals only its clones.
Sourcepub fn function<F>(builder: F) -> AnimatedSwitcherTransitionBuilder
pub fn function<F>(builder: F) -> AnimatedSwitcherTransitionBuilder
A function, comparable like a Dart tear-off of a static method.
Pass the function by name. A fn pointer or capturing closure is rejected: it has no canonical identity.
Sourcepub fn handle_method<T: 'static, F>(
this: Handle<T>,
f: F,
) -> AnimatedSwitcherTransitionBuilder
pub fn handle_method<T: 'static, F>( this: Handle<T>, f: F, ) -> AnimatedSwitcherTransitionBuilder
A handle’s associated function, comparable like a Dart method tear-off such as a
state’s _buildTransition.
Pass the function by name; see Listener::handle_method
for the identity rule. A fn pointer or capturing closure is rejected: it has no canonical
identity.