API ReferenceEnvironment
Directionality
Ambient Ltr and Rtl text-direction scope.
Directionality { text_direction: TextDirection, child: Widget } sets the
ambient reading direction that AlignmentDirectional,
EdgeInsetsDirectional, and RTL-aware placement
resolve against.
use incular::prelude::*;
fn main() {
let scope = Directionality::new(TextDirection::Rtl, Text::new("مرحبا"));
println!("dir: {:?}", scope.text_direction());
let app = Application::new(|_cx| {
Directionality::new(
TextDirection::Rtl,
Text::new("مرحبا"),
).into()
})
.expect("valid application");
incular::run(app).expect("run application");
}TextDirection: Ltr (default) / Rtl. Widget text_direction fields default
to None and inherit from the nearest Directionality (else Ltr).
Related: TextDirection,
Localization.