GSHeading class

A widget designed to display headings with customizable styles within the Gluestack UI framework. GSHeading supports various typographic customizations, making it suitable for titles, headings, and other prominent text elements in your application.

Inheritance

Constructors

GSHeading.new({Key? key, required String text, GSHeadingSizes? size, GSStyle? style, Locale? locale, int? maxLines, TextOverflow? overflow, Color? selectionColor, String? semanticsLabel, bool? softWrap, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, TextHeightBehavior? textHeightBehavior, TextScaler? textScaler, TextWidthBasis? textWidthBasis, bool sub = false, bool bold = false, bool highlight = false, bool isTruncated = false, bool italic = false, bool strikeThrough = false, bool underline = false})
const

Properties

bold bool
If true, renders the heading text in a bold font weight. Defaults to false.
final
hashCode int
The hash code for this object.
no setterinherited
highlight bool
If true, applies a highlight effect to the heading text. Defaults to false.
final
isTruncated bool
Determines if the heading should be truncated with an ellipsis when it overflows the available space. Defaults to false, allowing text to wrap by default.
final
italic bool
If true, applies an italic font style to the heading text. Defaults to false.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
locale Locale?
The locale used for rendering the heading text, affecting its format and display.
final
maxLines int?
The maximum number of lines the heading text can occupy. Text exceeding this limit will be truncated according to the overflow property. If null, the text can span an unlimited number of lines.
final
overflow TextOverflow?
How visual overflow of the heading text should be handled, such as clipping or ellipsis.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectionColor Color?
The color used for text selection within the heading. Defaults to null, in which case the selection color of the environment is used.
final
semanticsLabel String?
An optional semantic label for the heading text, enhancing accessibility by providing a text description for screen readers.
final
size GSHeadingSizes?
The size of the text, allowing for predefined scaling according to GSSizes. This provides a consistent method for adjusting text size across different headings.
final
softWrap bool?
Whether the heading text should break at soft line breaks. Defaults to null, allowing the environment's setting to determine behavior.
final
strikeThrough bool
If true, applies a strikethrough decoration to the heading text. Defaults to false.
final
strutStyle StrutStyle?
The strut style for the heading text, defining the minimum height a line can occupy.
final
style GSStyle?
Custom GSConfigStyle to apply to the heading, enabling detailed customization of text appearance, including font, color, size, and more.
final
sub bool
Indicates if the heading should be styled as a subtitle or secondary text, potentially applying a smaller font size and adjusted line height. Defaults to false.
final
text String
The text content of the heading. This is the primary display text for the widget.
final
textAlign TextAlign?
The alignment of the heading text within its bounding box. Defaults to null, allowing the environment's setting to determine alignment.
final
textDirection TextDirection?
The directionality of the heading text, determining how textAlign values are interpreted.
final
textHeightBehavior TextHeightBehavior?
Controls the behavior of the heading text's height, allowing customization of how text height is calculated and rendered.
final
textScaler TextScaler?
A mechanism to scale the text size dynamically, suitable for adjusting text size based on user preferences or accessibility settings.
final
textWidthBasis TextWidthBasis?
Determines the basis for measuring the width of the heading text, influencing text wrapping and overflow handling.
final
underline bool
If true, adds an underline decoration to the heading text. Defaults to false.
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