pub struct Baseline {
pub key: Option<KeyRef>,
pub baseline: f64,
pub baseline_type: TextBaseline,
pub child: Option<WidgetRef>,
}Expand description
A widget that positions its child according to the child’s baseline.
This widget shifts the child down such that the child’s baseline (or the
bottom of the child, if the child has no baseline) is
baseline logical pixels below the top of this box, then sizes this box
to contain the child. If baseline is less than the distance from the
top of the child to the baseline of the child, then the child is top-aligned instead.
See also:
Align, a widget that aligns its child within itself and optionally sizes itself based on the child’s size.Center, a widget that centers its child within itself.- The catalog of layout widgets.
Fields§
§key: Option<KeyRef>§baseline: f64The number of logical pixels from the top of this box at which to position the child’s baseline.
baseline_type: TextBaselineThe type of baseline to use for positioning the child.
child: Option<WidgetRef>Implementations§
Source§impl Baseline
impl Baseline
Sourcepub fn new(baseline: f64, baseline_type: TextBaseline) -> Baseline
pub fn new(baseline: f64, baseline_type: TextBaseline) -> Baseline
Creates a widget that positions its child according to the child’s baseline; Dart’s optional named arguments are the setters.
Sourcepub fn child<K>(self, child: impl IntoWidget<K>) -> Baseline
pub fn child<K>(self, child: impl IntoWidget<K>) -> Baseline
Dart Baseline(child:).
Trait Implementations§
Source§impl RenderObjectWidget for Baseline
impl RenderObjectWidget for Baseline
Source§type RenderObject = RenderBaseline
type RenderObject = RenderBaseline
The render object this widget creates; Dart’s
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
Creates an instance of the
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<RenderBaseline>,
)
fn update_render_object( &self, app: &mut App, _context: BuildContext, render_object: RenderHandle<RenderBaseline>, )
Copies the configuration described by this widget to the given render object, which
will be of the same type as returned by this object’s
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, )
Dart’s
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
Dart’s
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), )
Dart’s
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>, )
A render object previously associated with this widget has been removed from the tree.
The given
RenderObject will be of the same type as returned by this object’s
create_render_object.Auto Trait Implementations§
impl !RefUnwindSafe for Baseline
impl !Send for Baseline
impl !Sync for Baseline
impl !UnwindSafe for Baseline
impl Forget for Baseline
impl Freeze for Baseline
impl Move for Baseline
impl Unpin for Baseline
impl UnsafeUnpin for Baselinewhere
*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
Mutably borrows from an owned value. Read more
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>
The widget as a tree node, made where this is called: its
creation_location.