Skip to main content

View

Trait View 

Source
pub trait View: 'static {
    // Required methods
    fn id(&self) -> ViewId;
    fn metrics(&self) -> ViewMetrics;
    fn present(&self, picture: Arc<Picture>);

    // Provided methods
    fn gesture_settings(&self) -> GestureSettings { ... }
    fn start_text_input(&self, configuration: &TextInputConfiguration) { ... }
    fn stop_text_input(&self) { ... }
    fn set_text_input_editing_state(&self, value: &TextEditingValue) { ... }
    fn set_text_input_composing_rect(&self, rect: Rect) { ... }
    fn set_text_input_caret_rect(&self, rect: Rect) { ... }
    fn set_text_input_client_geometry(&self, size: Size, transform: &Matrix4) { ... }
}
Expand description

A stable handle to one host-provided view.

present is Flutter FlutterView.render. The host owns the surface; the framework records a crate::Picture and hands it over.

Required Methods§

Source

fn id(&self) -> ViewId

Source

fn metrics(&self) -> ViewMetrics

Source

fn present(&self, picture: Arc<Picture>)

Renders and presents one picture, shared so the host may keep it: to present it again when the window is seen again, and to tell a picture equal to the last from one worth drawing. Physical pixels; the presenter applies no extra scaling.

Provided Methods§

Source

fn gesture_settings(&self) -> GestureSettings

Flutter FlutterView.gestureSettings.

Source

fn start_text_input(&self, configuration: &TextInputConfiguration)

Flutter TextInput.attach / TextInputConnection.show: start an IME session for this view. The default drops it.

Source

fn stop_text_input(&self)

Flutter TextInputConnection.close: end the IME session. The default drops it.

Source

fn set_text_input_editing_state(&self, value: &TextEditingValue)

Flutter TextInputConnection.setEditingState. The default drops it.

Source

fn set_text_input_composing_rect(&self, rect: Rect)

Flutter TextInput.setComposingRect. The default drops it.

Source

fn set_text_input_caret_rect(&self, rect: Rect)

Flutter TextInput.setCaretRect. The default drops it.

Source

fn set_text_input_client_geometry(&self, size: Size, transform: &Matrix4)

Flutter TextInput.setEditableSizeAndTransform. The default drops it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§