pub struct AnimatedPhysicalModel {
pub child: WidgetRef,
pub shape: BoxShape,
pub clip_behavior: Clip,
pub border_radius: Option<BorderRadius>,
pub elevation: f64,
pub color: AnyColor,
pub animate_color: bool,
pub shadow_color: AnyColor,
pub animate_shadow_color: bool,
/* private fields */
}Expand description
Animated version of PhysicalModel.
The border_radius and elevation are
animated.
The color is animated if the animate_color
property is set; otherwise, the color changes immediately at the start of the animation
for the other two properties. This allows the color to be animated independently (e.g.
using an AnimatedContainer as the child).
The shape is not animated.
Here’s an illustration of what using this widget looks like, using a
curve of Curves::fast_out_slow_in.
Fields§
§child: WidgetRefThe widget below this widget in the tree.
shape: BoxShapeThe type of shape.
This property is not animated.
clip_behavior: ClipThe content will be clipped (or not) according to this option.
Defaults to Clip::None.
border_radius: Option<BorderRadius>The target border radius of the rounded corners for a rectangle shape.
elevation: f64The target z-coordinate relative to the parent at which to place this physical object.
The value will always be non-negative.
color: AnyColorThe target background color.
animate_color: boolWhether the color should be animated.
shadow_color: AnyColorThe target shadow color.
animate_shadow_color: boolWhether the shadow color should be animated.
Implementations§
Source§impl AnimatedPhysicalModel
impl AnimatedPhysicalModel
Sourcepub fn new<K>(
child: impl IntoWidget<K>,
color: impl Into<AnyColor>,
shadow_color: impl Into<AnyColor>,
duration: Duration,
) -> AnimatedPhysicalModel
pub fn new<K>( child: impl IntoWidget<K>, color: impl Into<AnyColor>, shadow_color: impl Into<AnyColor>, duration: Duration, ) -> AnimatedPhysicalModel
Creates a widget that animates the properties of a PhysicalModel; Dart’s optional
named arguments are the setters.
Dart’s defaults: shape BoxShape::Rectangle, clip_behavior Clip::None,
elevation 0, animate_color and animate_shadow_color true.
Sourcepub fn shape(self, shape: BoxShape) -> AnimatedPhysicalModel
pub fn shape(self, shape: BoxShape) -> AnimatedPhysicalModel
Dart AnimatedPhysicalModel(shape:).
Sourcepub fn clip_behavior(self, clip_behavior: Clip) -> AnimatedPhysicalModel
pub fn clip_behavior(self, clip_behavior: Clip) -> AnimatedPhysicalModel
Dart AnimatedPhysicalModel(clipBehavior:).
Sourcepub fn border_radius(self, border_radius: BorderRadius) -> AnimatedPhysicalModel
pub fn border_radius(self, border_radius: BorderRadius) -> AnimatedPhysicalModel
Dart AnimatedPhysicalModel(borderRadius:).
Sourcepub fn elevation(self, elevation: f64) -> AnimatedPhysicalModel
pub fn elevation(self, elevation: f64) -> AnimatedPhysicalModel
Dart AnimatedPhysicalModel(elevation:).
Sourcepub fn animate_color(self, animate_color: bool) -> AnimatedPhysicalModel
pub fn animate_color(self, animate_color: bool) -> AnimatedPhysicalModel
Dart AnimatedPhysicalModel(animateColor:).
Sourcepub fn animate_shadow_color(
self,
animate_shadow_color: bool,
) -> AnimatedPhysicalModel
pub fn animate_shadow_color( self, animate_shadow_color: bool, ) -> AnimatedPhysicalModel
Dart AnimatedPhysicalModel(animateShadowColor:).
Sourcepub fn key(self, key: KeyRef) -> AnimatedPhysicalModel
pub fn key(self, key: KeyRef) -> AnimatedPhysicalModel
Dart key:.
Sourcepub fn curve(self, curve: Rc<dyn Curve>) -> AnimatedPhysicalModel
pub fn curve(self, curve: Rc<dyn Curve>) -> AnimatedPhysicalModel
Dart curve:.
Sourcepub fn on_end(self, on_end: Listener) -> AnimatedPhysicalModel
pub fn on_end(self, on_end: Listener) -> AnimatedPhysicalModel
Dart onEnd:.
Trait Implementations§
Source§impl Debug for AnimatedPhysicalModel
impl Debug for AnimatedPhysicalModel
Source§impl ImplicitlyAnimatedWidget for AnimatedPhysicalModel
impl ImplicitlyAnimatedWidget for AnimatedPhysicalModel
Source§fn implicitly_animated_widget_data_mut(
&mut self,
) -> &mut ImplicitlyAnimatedWidgetData
fn implicitly_animated_widget_data_mut( &mut self, ) -> &mut ImplicitlyAnimatedWidgetData
ImplicitlyAnimatedWidgetData bag, mutably.Source§impl StatefulWidget for AnimatedPhysicalModel
impl StatefulWidget for AnimatedPhysicalModel
Source§type State = AnimatedPhysicalModelState
type State = AnimatedPhysicalModelState
Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties a dump shows for this widget, in Dart’s
order. Dart’s Widget base only sets the dense tree style, which the framework does.Source§fn create_state(&self) -> AnimatedPhysicalModelState
fn create_state(&self) -> AnimatedPhysicalModelState
Source§fn as_preferred_size_widget(&self) -> Option<&dyn PreferredSizeWidget>
fn as_preferred_size_widget(&self) -> Option<&dyn PreferredSizeWidget>
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Widget::type_name. A stateful form another widget kind becomes (an animated or
status transition widget) names the widget it wraps.Auto Trait Implementations§
impl !RefUnwindSafe for AnimatedPhysicalModel
impl !Send for AnimatedPhysicalModel
impl !Sync for AnimatedPhysicalModel
impl !UnwindSafe for AnimatedPhysicalModel
impl Forget for AnimatedPhysicalModel
impl Freeze for AnimatedPhysicalModelwhere
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
*const RcInner<dyn Curve> is !null: Freeze,
PhantomData<RcInner<dyn Curve>>: Freeze,
*const RcInner<dyn Fn(&mut App)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App)>>: Freeze,
NonZero<u32>: Freeze,
*const (): Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
&'static dyn ColorExtension: Freeze,
*const RcInner<dyn ColorExtension> is !null: Freeze,
PhantomData<RcInner<dyn ColorExtension>>: Freeze,
impl Move for AnimatedPhysicalModel
impl Unpin for AnimatedPhysicalModel
impl UnsafeUnpin for AnimatedPhysicalModelwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn Curve> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Curve>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App)>>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
*const (): UnsafeUnpin,
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Widget>>: UnsafeUnpin,
&'static dyn ColorExtension: UnsafeUnpin,
*const RcInner<dyn ColorExtension> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn ColorExtension>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.