FTypography class final

The typographical tokens grouped by their semantic roles.

CJK Text Alignment

When using CJK (Chinese, Japanese, Korean) scripts, text may appear vertically misaligned. This is a known Flutter issue.

As a temporary workaround, wrap the affected widget in a DefaultTextStyle with the appropriate TextHeightBehavior:

DefaultTextStyle.merge(
  textHeightBehavior: const TextHeightBehavior(
    applyHeightToFirstAscent: false,
    applyHeightToLastDescent: false,
  ),
  child: FButton(
    onPressed: () {},
    child: const Text('按钮'),
  ),
)
Mixed-in types

Constructors

FTypography({required FTypeface display, required FTypeface body, Iterable<FScalableExtension> extensions = const []})
Creates a FTypography.
FTypography.inherit({required FColors colors, required bool touch, Iterable<FScalableExtension> extensions = const []})
Creates a FTypography that inherits its properties.
factory
FTypography.lerp(FTypography a, FTypography b, double t)
Creates a linear interpolation between two FTypographys using the given factor t.
factory

Properties

body FTypeface
The typographical tokens for content and UI text.
final
display FTypeface
The typographical tokens used for prominent text such as headings.
final
extensions Set<ThemeExtension>
All FScalableExtensions defined in this typography.
no setter
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({FTypeface? display, FTypeface? body, Iterable<FScalableExtension>? extensions}) FTypography
Returns a copy of this FTypography with the given properties replaced.
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
extension<T extends Object>() → T
Obtains a particular FScalableExtension, such as an app's additional text styles.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
scale({double sizeScalar = 1}) FTypography
Scales this FTypography by sizeScalar.
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override