ResponsiveText class
A responsive text widget that adjusts its size and padding based on the screen width.
The widget also supports localization, custom styling, and flexible padding.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- ResponsiveText
Constructors
- ResponsiveText.new(String text, {Key? key, FontWeight? fontWeight, TextAlign? textAlign, bool? isPaddingLeft = false, bool? isPaddingRight = false, bool? isPaddingTop = false, bool? isPaddingButton = false, Color? color, double? fontSize = 0, bool? softWrap = true, TextDecoration? decoration, FontStyle? fontStyle, int? maxLines})
-
Creates a ResponsiveText widget.
const
Properties
- color → Color?
-
The color of the text.
final
- decoration → TextDecoration?
-
An optional text decoration (e.g., underline, line-through).
final
- fontSize → double?
-
The font size for the text. Defaults to
0
, which calculates a size based on the screen width.final - fontStyle → FontStyle?
-
The font style of the text (e.g., italic).
final
- fontWeight → FontWeight?
-
The font weight of the text.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isPaddingButton → bool?
-
Whether to add bottom padding to the text.
final
- isPaddingLeft → bool?
-
Whether to add left padding to the text.
final
- isPaddingRight → bool?
-
Whether to add right padding to the text.
final
- isPaddingTop → bool?
-
Whether to add top padding to the text.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- maxLines → int?
-
property determines the maximum number of lines the text can occupy before being truncated with an ellipsis
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- softWrap → bool?
-
Whether to allow text wrapping.
final
- text → String
-
The text to display.
final
- textAlign → TextAlign?
-
The alignment of the text within its container.
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