Skip to main content

RawImage

Struct RawImage 

Source
pub struct RawImage {
    pub key: Option<KeyRef>,
    pub image: Option<ImageInfo>,
    pub width: Option<f64>,
    pub height: Option<f64>,
    pub opacity: f64,
    pub fit: Option<BoxFit>,
    pub alignment: Alignment,
    pub repeat: ImageRepeat,
    pub match_text_direction: bool,
}
Expand description

Draws an image that is already decoded. Flutter RawImage.

Most callers want Image, which finds the image first. This is the widget underneath it, and what to use when the image is already in hand.

Fields§

§key: Option<KeyRef>§image: Option<ImageInfo>

The image to draw, or nothing while it is still on its way.

§width: Option<f64>

The width to take, or None to follow the image.

§height: Option<f64>

The height to take, or None to follow the image.

§opacity: f64

How opaque to draw it, from zero to one.

§fit: Option<BoxFit>

How to fit it into the space it is given.

§alignment: Alignment

Where it sits when it does not fill that space.

§repeat: ImageRepeat

What fills the space it does not cover.

§match_text_direction: bool

Whether to mirror it in a right-to-left layout.

Implementations§

Source§

impl RawImage

Source

pub fn new(image: Option<ImageInfo>) -> RawImage

Creates a RawImage showing image, or nothing when it is None.

Source

pub fn key(self, key: KeyRef) -> RawImage

Dart RawImage(key:).

Source

pub fn width(self, width: f64) -> RawImage

Dart RawImage(width:).

Source

pub fn height(self, height: f64) -> RawImage

Dart RawImage(height:).

Source

pub fn opacity(self, opacity: f64) -> RawImage

Dart RawImage(opacity:).

Source

pub fn fit(self, fit: BoxFit) -> RawImage

Dart RawImage(fit:).

Source

pub fn alignment(self, alignment: Alignment) -> RawImage

Dart RawImage(alignment:).

Source

pub fn repeat(self, repeat: ImageRepeat) -> RawImage

Dart RawImage(repeat:).

Source

pub fn match_text_direction(self, match_text_direction: bool) -> RawImage

Dart RawImage(matchTextDirection:).

Trait Implementations§

Source§

impl Clone for RawImage

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RawImage

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl LeafRenderObjectWidget for RawImage

Source§

impl RenderObjectWidget for RawImage

Source§

type RenderObject = RenderImage

The render object this widget creates; Dart’s covariant RenderObject parameter type.
Source§

fn key(&self) -> Option<&KeyRef>

Source§

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 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 more
Source§

fn update_render_object( &self, app: &mut App, context: BuildContext, render_object: RenderHandle<RenderImage>, )

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 more
Source§

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_check_constructor(&self)

Source§

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>, )

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 RawImage

§

impl !Send for RawImage

§

impl !Sync for RawImage

§

impl !UnwindSafe for RawImage

§

impl Forget for RawImage

§

impl Freeze for RawImage
where *const RcInner<dyn Key> is !null: Freeze, PhantomData<RcInner<dyn Key>>: Freeze, *const ArcInner<ImageInner> is !null: Freeze, PhantomData<ArcInner<ImageInner>>: Freeze, *const u8 is !null: Freeze, PhantomData<u8>: Freeze,

§

impl Move for RawImage

§

impl Unpin for RawImage
where Rc<dyn Key>: Unpin, Arc<ImageInner>: Unpin, *const u8 is !null: Unpin,

§

impl UnsafeUnpin for RawImage
where *const RcInner<dyn Key> is !null: UnsafeUnpin, PhantomData<RcInner<dyn Key>>: UnsafeUnpin, *const ArcInner<ImageInner> is !null: UnsafeUnpin, PhantomData<ArcInner<ImageInner>>: UnsafeUnpin, *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<W> IntoWidget<LeafRenderObjectKind> for W

Source§

fn into_widget(self) -> Rc<dyn Widget>

The widget as a tree node, made where this is called: its creation_location.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>