Skip to main content

MaterialInkController

Trait MaterialInkController 

Source
pub trait MaterialInkController: Sized + 'static {
    // Required methods
    fn color(self: Handle<Self>, app: &App) -> Option<Color>;
    fn vsync(self: Handle<Self>, app: &App) -> Rc<dyn TickerProvider>;
    fn add_ink_feature(
        self: Handle<Self>,
        app: &mut App,
        feature: InkFeatureRef,
    );
    fn mark_needs_paint(self: Handle<Self>, app: &mut App);

    // Provided method
    fn as_material_ink_controller(
        self: Handle<Self>,
    ) -> AnyMaterialInkController { ... }
}
Expand description

An interface for creating InkSplashs and InkHighlights on a Material.

Typically obtained via Material::of, as the erased AnyMaterialInkController.

Required Methods§

Source

fn color(self: Handle<Self>, app: &App) -> Option<Color>

The color of the material.

Source

fn vsync(self: Handle<Self>, app: &App) -> Rc<dyn TickerProvider>

The ticker provider used by the controller.

Ink features that are added to this controller with add_ink_feature should use this vsync to drive their animations.

Source

fn add_ink_feature(self: Handle<Self>, app: &mut App, feature: InkFeatureRef)

Add an InkFeature, such as an InkSplash or an InkHighlight.

The ink feature will paint as part of this controller.

Source

fn mark_needs_paint(self: Handle<Self>, app: &mut App)

Notifies the controller that one of its ink features needs to repaint.

Provided Methods§

Source

fn as_material_ink_controller(self: Handle<Self>) -> AnyMaterialInkController

This controller as the erased AnyMaterialInkController — what to pass where a Dart API takes a MaterialInkController.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§