Typography class
The typography applied to a FluentThemeData. It implements Windows' Type Ramp
Do | Don't |
---|---|
Pick one font for your UI. | Don't mix multiple fonts. |
Use body for most text | Use "Caption" for primary action or any long strings. |
Use "Base" for titles when space is constrained. | Use "Header" or "Subheader" if text needs to wrap. |
Keep to 50–60 letters per line for ease of reading. | Less than 20 characters or more than 60 characters per line is difficult to read. |
Clip text, and wrap if multiple lines are enabled. | Use ellipses to avoid visual clutter. |
For more info, read Typography
- Mixed in types
Constructors
- Typography.fromBrightness({Brightness? brightness, Color? color})
-
The default typography according to a brightness or color.
factory
- Typography.raw({TextStyle? display, TextStyle? titleLarge, TextStyle? title, TextStyle? subtitle, TextStyle? bodyLarge, TextStyle? bodyStrong, TextStyle? body, })
-
Creates a new Typography. To create the default typography, use
Typography.defaultTypography
const
Properties
- body → TextStyle?
-
The body style. Use body for most of the text.
final
- bodyLarge → TextStyle?
-
final
- bodyStrong → TextStyle?
-
The base style. Use
base
for titles when space is constrained.final -
The caption style.
final
- display → TextStyle?
-
The header style. Use this as the top of the hierarchy
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- subtitle → TextStyle?
-
The subtitle style.
final
- title → TextStyle?
-
The title style.
final
- titleLarge → TextStyle?
-
final
Methods
-
apply(
{String? fontFamily, double fontSizeFactor = 1.0, double fontSizeDelta = 0.0, Color? displayColor, TextDecoration? decoration, Color? decorationColor, TextDecorationStyle? decorationStyle}) → Typography -
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
override
-
merge(
Typography? typography) → Typography -
Copy this with a new
typography
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
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.
inherited
Static Methods
-
lerp(
Typography? a, Typography? b, double t) → Typography