pub struct IconData {
pub code_point: u32,
pub font_family: Option<String>,
pub font_package: Option<String>,
pub match_text_direction: bool,
pub font_family_fallback: Option<Vec<String>>,
}Expand description
A description of an icon fulfilled by a font glyph.
See Icons for a number of predefined icons available for material design applications.
In release builds, the Flutter tool only includes the glyphs used by an app’s IconDatas
in the font; here the font is installed whole.
Fields§
§code_point: u32The Unicode code point at which this icon is stored in the icon font.
font_family: Option<String>The font family from which the glyph for the code_point will be
selected.
font_package: Option<String>The name of the package from which the font family is included.
The name is used by the Icon widget when configuring the TextStyle so that the
given font_family is obtained from the appropriate asset.
See also:
TextStyle, which describes how to use fonts from other packages.
match_text_direction: boolWhether this icon should be automatically mirrored in right-to-left environments.
The Icon widget respects this value by mirroring the icon when the Directionality
is TextDirection.rtl.
font_family_fallback: Option<Vec<String>>The ordered list of font families to fall back on when a glyph cannot be found in a higher priority font family.
For more details, refer to the documentation of TextStyle.
Implementations§
Source§impl IconData
impl IconData
Sourcepub const fn new(code_point: u32) -> IconData
pub const fn new(code_point: u32) -> IconData
Creates icon data.
Rarely used directly. Instead, consider using one of the predefined icons like the
Icons collection.
The font_package argument must be non-null when using a font
family that is included in a package. This is used when selecting the font.
Sourcepub fn font_family(self, font_family: impl Into<String>) -> IconData
pub fn font_family(self, font_family: impl Into<String>) -> IconData
Dart IconData(fontFamily:).
Sourcepub fn font_package(self, font_package: impl Into<String>) -> IconData
pub fn font_package(self, font_package: impl Into<String>) -> IconData
Dart IconData(fontPackage:).
Sourcepub const fn match_text_direction(self, match_text_direction: bool) -> IconData
pub const fn match_text_direction(self, match_text_direction: bool) -> IconData
Dart IconData(matchTextDirection:).
Sourcepub fn font_family_fallback(self, font_family_fallback: Vec<String>) -> IconData
pub fn font_family_fallback(self, font_family_fallback: Vec<String>) -> IconData
Dart IconData(fontFamilyFallback:).
Trait Implementations§
impl Eq for IconData
impl StructuralPartialEq for IconData
Auto Trait Implementations§
impl Forget for IconData
impl Freeze for IconData
impl Move for IconData
impl RefUnwindSafe for IconData
impl Send for IconDatawhere
RawVecInner: Send,
impl Sync for IconDatawhere
RawVecInner: Sync,
impl Unpin for IconData
impl UnsafeUnpin for IconDatawhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for IconDatawhere
RawVecInner: UnwindSafe,
Blanket Implementations§
Source§impl<T> AnyEq for T
impl<T> AnyEq for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.