CkText class
- Inheritance
- Available extensions
Constructors
- CkText({required String text, Key? key, int? maxLines, TextAlign textAlign = TextAlign.center, double left = 0, double right = 0, double top = 0, double bottom = 0, double? fontSize, FontWeight? fontWeight, Color? textColor, TextStyle? style, TextOverflow? overflow, bool? enableBorder = false, Color? borderColor, double? borderRadious, Color? backgroundColor, MainAxisAlignment? alignment, BorderRadius? borderRadiusOnly, Widget? suffix, Widget? preffix, bool isDescription = false, double? textHeight, bool autoResize = true, double minFontSize = 10, double? maxAutoFontSize, double stepGranularity = 0.5, bool? softWrap, Color? decorationColor, TextDecoration? decoration, TextDirection? textDirection, double? height, double textSpacing = 10, double textScaleFactor = .9, bool preventScaling = false, Gradient? gradient, int? decimalPlaces = 2})
-
const
Properties
- alignment → MainAxisAlignment?
-
Alignment for the inner row/content layout.
final
- autoResize → bool
-
Whether to automatically resize the text to fit within available space.
final
- backgroundColor → Color?
-
Background color for the text container.
final
- borderColor → Color?
-
Border color for the surrounding container when enableBorder is
true.final - borderRadious → double?
-
Uniform border radius in logical pixels (scaled via ScreenUtil
.r) for the container.final - borderRadiusOnly → BorderRadius?
-
Directional BorderRadius for custom corner rounding (e.g., BorderRadius.only).
final
- bottom → double
-
Responsive bottom padding applied to the text container via ScreenUtil (
bottom.h).final - center → Widget
-
Available on Widget, provided by the Alignments extension
no setter - decimalPlaces → int?
-
The number of decimal places to format floating-point numbers found in text.
final
- decoration → TextDecoration?
-
Direct convenience shortcut for text decoration (e.g. underline, line-through) without creating a TextStyle.
final
- decorationColor → Color?
-
Direct convenience shortcut for text decoration line color without creating a TextStyle.
final
- enableBorder → bool?
-
Whether to wrap the text inside a bordered container card.
final
- end → Widget
-
Available on Widget, provided by the Alignments extension
no setter - fontSize → double?
-
Direct convenience shortcut for font size in logical pixels without creating a TextStyle.
final
- fontWeight → FontWeight?
-
Direct convenience shortcut for font weight without creating a TextStyle.
final
- gradient → Gradient?
-
Gradient shader applied across the text glyphs via ShaderMask.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
Direct convenience shortcut for line height multiplier without creating a TextStyle.
final
- isDescription → bool
-
Whether to render the text as an unscaled paragraph or description.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- left → double
-
Responsive left padding applied to the text container via ScreenUtil (
left.w).final - marginZero → Widget
-
Available on Widget, provided by the WidgetMarginX extension
no setter - maxAutoFontSize → double?
-
Maximum font size ceiling in logical pixels when auto-scaling multiline text.
final
- maxLines → int?
-
final
- minFontSize → double
-
Minimum font size threshold in logical pixels when auto-scaling multiline text.
final
- overflow → TextOverflow?
-
final
- paddingZero → Widget
-
Available on Widget, provided by the WidgetPaddingX extension
no setter - preffix → Widget?
-
A leading widget (e.g., Icon, avatar, or badge) placed immediately before the text.
final
- preventScaling → bool
-
Whether to prevent automatic text scaling down.
final
- right → double
-
Responsive right padding applied to the text container via ScreenUtil (
right.w).final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sliverBox → Widget
-
Available on Widget, provided by the WidgetSliverBoxX extension
no setter - softWrap → bool?
-
final
- start → Widget
-
Available on Widget, provided by the Alignments extension
no setter - stepGranularity → double
-
Font size step granularity resolution during binary search in adaptive multiline mode.
final
- style → TextStyle?
-
final
- suffix → Widget?
-
A trailing widget (e.g., Icon, checkmark, or badge) placed immediately after the text.
final
- text → String
-
final
- textAlign → TextAlign
-
final
- textColor → Color?
-
Direct convenience shortcut for text color without creating a TextStyle.
final
- textDirection → TextDirection?
-
final
- textHeight → double?
-
Absolute line height in logical pixels.
final
- textScaleFactor → double
-
Text scale factor multiplier applied to the text widget.
final
- textSpacing → double
-
Horizontal gap spacing in logical pixels between the text and preffix or suffix widgets.
final
- top → double
-
Responsive top padding applied to the text container via ScreenUtil (
top.h).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
-
getStyle(
) → TextStyle -
marginAll(
double margin) → Widget -
Available on Widget, provided by the WidgetMarginX extension
-
marginOnly(
{double left = 0.0, double top = 0.0, double right = 0.0, double bottom = 0.0}) → Widget -
Available on Widget, provided by the WidgetMarginX extension
-
marginSymmetric(
{double horizontal = 0.0, double vertical = 0.0}) → Widget -
Available on Widget, provided by the WidgetMarginX extension
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
paddingAll(
double padding) → Widget -
Available on Widget, provided by the WidgetPaddingX extension
-
paddingOnly(
{double left = 0.0, double top = 0.0, double right = 0.0, double bottom = 0.0}) → Widget -
Available on Widget, provided by the WidgetPaddingX extension
-
paddingSymmetric(
{double horizontal = 0.0, double vertical = 0.0}) → Widget -
Available on Widget, provided by the WidgetPaddingX extension
-
toAr(
num width, num height) → Widget -
Available on Widget, provided by the WidgetAspectRatio extension
-
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