pub trait RelayoutWhenSystemFontsChangeMixin: RenderObject {
// Required methods
fn relayout_when_system_fonts_change_data(
self: RenderHandle<Self>,
app: &App,
) -> &RelayoutWhenSystemFontsChangeData;
fn relayout_when_system_fonts_change_data_mut(
self: RenderHandle<Self>,
app: &mut App,
) -> &mut RelayoutWhenSystemFontsChangeData;
// Provided methods
fn system_fonts_did_change(self: RenderHandle<Self>, app: &mut App) { ... }
fn attach_system_fonts(self: RenderHandle<Self>, app: &mut App) { ... }
fn detach_system_fonts(self: RenderHandle<Self>, app: &mut App) { ... }
fn system_fonts_listener(self: RenderHandle<Self>) -> Listener { ... }
fn schedule_system_fonts_update(self: RenderHandle<Self>, app: &mut App) { ... }
}Expand description
Mixin for a RenderObject that relayouts when system fonts change.
System fonts can change when the OS installs or removes a font. Use this mixin if the
render object uses TextPainter or Paragraph to correctly update the text when it
happens.
Required Methods§
Sourcefn relayout_when_system_fonts_change_data(
self: RenderHandle<Self>,
app: &App,
) -> &RelayoutWhenSystemFontsChangeData
fn relayout_when_system_fonts_change_data( self: RenderHandle<Self>, app: &App, ) -> &RelayoutWhenSystemFontsChangeData
Mixin field access.
Sourcefn relayout_when_system_fonts_change_data_mut(
self: RenderHandle<Self>,
app: &mut App,
) -> &mut RelayoutWhenSystemFontsChangeData
fn relayout_when_system_fonts_change_data_mut( self: RenderHandle<Self>, app: &mut App, ) -> &mut RelayoutWhenSystemFontsChangeData
Provided Methods§
Sourcefn system_fonts_did_change(self: RenderHandle<Self>, app: &mut App)
fn system_fonts_did_change(self: RenderHandle<Self>, app: &mut App)
A callback that is called when system fonts have changed.
The framework defers the invocation of the callback to the
SchedulerPhase::TransientCallbacks phase to ensure that the render object’s text
layout is still valid when user interactions are in progress (which usually take
place during the idle phase).
By default, markNeedsLayout is called on the render object implementing this mixin.
Subclass should override this method to clear any extra cache that depend on font-related metrics.
Sourcefn attach_system_fonts(self: RenderHandle<Self>, app: &mut App)
fn attach_system_fonts(self: RenderHandle<Self>, app: &mut App)
Flutter’s attach override body after super.attach.
Sourcefn detach_system_fonts(self: RenderHandle<Self>, app: &mut App)
fn detach_system_fonts(self: RenderHandle<Self>, app: &mut App)
Flutter’s detach override body before super.detach.
fn system_fonts_listener(self: RenderHandle<Self>) -> Listener
fn schedule_system_fonts_update(self: RenderHandle<Self>, app: &mut App)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".