pub struct FractionalTranslation {
pub key: Option<KeyRef>,
pub translation: Offset,
pub transform_hit_tests: bool,
pub child: Option<WidgetRef>,
}Expand description
Applies a translation transformation before painting its child.
The translation is expressed as an Offset scaled to the child’s size. For
example, an Offset with a dx of 0.25 will result in a horizontal
translation of one quarter the width of the child.
Hit tests will only be detected inside the bounds of the
FractionalTranslation, even if the contents are offset such that
they overflow.
See also:
Transform, which applies an arbitrary transform to its child widget at paint time.Transform::translate, which applies an absolute offset translation transformation instead of an offset scaled to the child.- The catalog of layout widgets.
Fields§
§key: Option<KeyRef>§translation: OffsetThe translation to apply to the child, scaled to the child’s size.
For example, an Offset with a dx of 0.25 will result in a horizontal
translation of one quarter the width of the child.
transform_hit_tests: boolWhether to apply the translation when performing hit tests.
child: Option<WidgetRef>Implementations§
Source§impl FractionalTranslation
impl FractionalTranslation
Sourcepub fn new(translation: Offset) -> FractionalTranslation
pub fn new(translation: Offset) -> FractionalTranslation
Creates a widget that translates its child’s painting; Dart’s optional named arguments are the setters.
Sourcepub fn key(self, key: KeyRef) -> FractionalTranslation
pub fn key(self, key: KeyRef) -> FractionalTranslation
Dart FractionalTranslation(key:).
Sourcepub fn transform_hit_tests(
self,
transform_hit_tests: bool,
) -> FractionalTranslation
pub fn transform_hit_tests( self, transform_hit_tests: bool, ) -> FractionalTranslation
Dart FractionalTranslation(transformHitTests:).
Sourcepub fn child<K>(self, child: impl IntoWidget<K>) -> FractionalTranslation
pub fn child<K>(self, child: impl IntoWidget<K>) -> FractionalTranslation
Dart FractionalTranslation(child:).
Trait Implementations§
Source§impl Debug for FractionalTranslation
impl Debug for FractionalTranslation
Source§impl RenderObjectWidget for FractionalTranslation
impl RenderObjectWidget for FractionalTranslation
Source§type RenderObject = RenderFractionalTranslation
type RenderObject = RenderFractionalTranslation
covariant RenderObject parameter type.Source§fn create_render_object(
&self,
app: &mut App,
_context: BuildContext,
) -> AnyRenderObject
fn create_render_object( &self, app: &mut App, _context: BuildContext, ) -> AnyRenderObject
RenderObject class that this widget represents, using the
configuration described by this widget. Read moreSource§fn update_render_object(
&self,
app: &mut App,
_context: BuildContext,
render_object: RenderHandle<RenderFractionalTranslation>,
)
fn update_render_object( &self, app: &mut App, _context: BuildContext, render_object: RenderHandle<RenderFractionalTranslation>, )
create_render_object. Read moreSource§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 to_string_short(&self) -> String
fn to_string_short(&self) -> String
toStringShort, for a widget that names itself apart from its type, as
SizedBox.expand does; see Widget::to_string_short.Source§fn debug_visit_onstage_children(
&self,
app: &App,
children: &[AnyElement],
visitor: &mut dyn FnMut(AnyElement),
)
fn debug_visit_onstage_children( &self, app: &App, children: &[AnyElement], visitor: &mut dyn FnMut(AnyElement), )
debugVisitOnstageChildren of the element this widget makes, for a widget whose
Dart element subclass overrides it only to hide children (_OffstageElement,
_IndexedStackElement): calls visitor for each of children, in order, that is
onstage. Waft’s generic single- and multi-child elements stand in for those subclasses
and ask their widget here; an element of a widget’s own overrides
Element::debug_visit_onstage_children instead.Source§fn did_unmount_render_object(
&self,
app: &mut App,
render_object: RenderHandle<Self::RenderObject>,
)
fn did_unmount_render_object( &self, app: &mut App, render_object: RenderHandle<Self::RenderObject>, )
RenderObject will be of the same type as returned by this object’s
create_render_object.Auto Trait Implementations§
impl !RefUnwindSafe for FractionalTranslation
impl !Send for FractionalTranslation
impl !Sync for FractionalTranslation
impl !UnwindSafe for FractionalTranslation
impl Forget for FractionalTranslation
impl Freeze for FractionalTranslation
impl Move for FractionalTranslation
impl Unpin for FractionalTranslation
impl UnsafeUnpin for FractionalTranslationwhere
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Widget>>: 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<SingleChildRenderObjectKind> for Wwhere
W: SingleChildRenderObjectWidget,
<W as RenderObjectWidget>::RenderObject: RenderObjectWithChildMixin,
impl<W> IntoWidget<SingleChildRenderObjectKind> for Wwhere
W: SingleChildRenderObjectWidget,
<W as RenderObjectWidget>::RenderObject: RenderObjectWithChildMixin,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.