TextKit class

A customizable text widget with pre-configured typography styles.

Inheritance

Constructors

TextKit({Key? key, required String title, required double size, required Color color, required FontWeight weight, TextAlign? align, double? height, double? letterSpacing, int? maxLines, TextOverflow? overflow})
Creates a TextKit widget.
const
TextKit.bodyLarge(String title, {Key? key, Color? color, TextAlign? align, int? maxLines, TextOverflow? overflow, double? height})
Creates a Body Large text style (16sp, Regular).
factory
TextKit.bodyMedium(String title, {Key? key, Color? color, TextAlign? align, int? maxLines, TextOverflow? overflow, double? height})
Creates a Body Medium text style (14sp, Regular).
factory
TextKit.bodySmall(String title, {Key? key, Color? color, TextAlign? align, int? maxLines, TextOverflow? overflow, double? height})
Creates a Body Small text style (12sp, Regular).
factory
TextKit.displayLarge(String title, {Key? key, Color? color, TextAlign? align, int? maxLines, TextOverflow? overflow})
Creates a Display Large text style (57sp, Light).
factory
TextKit.displayMedium(String title, {Key? key, Color? color, TextAlign? align, int? maxLines, TextOverflow? overflow})
Creates a Display Medium text style (45sp, Regular).
factory
TextKit.displaySmall(String title, {Key? key, Color? color, TextAlign? align, int? maxLines, TextOverflow? overflow})
Creates a Display Small text style (36sp, Regular).
factory
TextKit.headlineLarge(String title, {Key? key, Color? color, TextAlign? align, int? maxLines, TextOverflow? overflow})
Creates a Headline Large text style (32sp, SemiBold).
factory
TextKit.headlineMedium(String title, {Key? key, Color? color, TextAlign? align, int? maxLines, TextOverflow? overflow})
Creates a Headline Medium text style (28sp, SemiBold).
factory
TextKit.headlineSmall(String title, {Key? key, Color? color, TextAlign? align, int? maxLines, TextOverflow? overflow})
Creates a Headline Small text style (24sp, SemiBold).
factory
TextKit.labelLarge(String title, {Key? key, Color? color, TextAlign? align, int? maxLines, TextOverflow? overflow})
Creates a Label Large text style (14sp, Medium).
factory
TextKit.labelMedium(String title, {Key? key, Color? color, TextAlign? align, int? maxLines, TextOverflow? overflow})
Creates a Label Medium text style (12sp, Medium).
factory
TextKit.labelSmall(String title, {Key? key, Color? color, TextAlign? align, int? maxLines, TextOverflow? overflow})
Creates a Label Small text style (11sp, Regular).
factory
TextKit.titleLarge(String title, {Key? key, Color? color, TextAlign? align, int? maxLines, TextOverflow? overflow})
Creates a Title Large text style (22sp, SemiBold).
factory
TextKit.titleMedium(String title, {Key? key, Color? color, TextAlign? align, int? maxLines, TextOverflow? overflow})
Creates a Title Medium text style (16sp, Medium).
factory
TextKit.titleSmall(String title, {Key? key, Color? color, TextAlign? align, int? maxLines, TextOverflow? overflow})
Creates a Title Small text style (14sp, Medium).
factory

Properties

align TextAlign?
How the text should be aligned horizontally.
final
color Color
The color to use when painting the text.
final
hashCode int
The hash code for this object.
no setterinherited
height double?
The height multiplier for line spacing (e.g., 1.5 for 150% line height).
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
letterSpacing double?
Additional spacing between characters in logical pixels.
final
maxLines int?
Maximum number of lines to display.
final
overflow TextOverflow?
How visual overflow should be handled.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size double
The size of the text in logical pixels.
final
title String
The text content to display.
final
weight FontWeight
The typeface thickness
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
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
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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