TextCell<T> class
A versatile table cell widget that displays text or formatted numeric data.
TextCell supports custom alignment, background colors, text styling, and advanced number formatting (International/Indian) with rounding options.
- Inheritance
Constructors
- TextCell({Key? key, required T itemContent, String itemToString(T)?, double? cellWidth, double? cellHeight, double? textSize, AlignmentGeometry? textAlignment = Alignment.center, Color? backgroundColor = Colors.white, Color? textColor = Colors.black, Color? borderColor = Colors.black12, bool isBold = false, bool isItalic = false, bool isUnderline = false, bool isAmount = false, CellNumberFormat numberFormatType = CellNumberFormat.international, RoundMode roundMode = RoundMode.withRoundUp, int roundTo = 0, void onTap(T)?})
-
Creates a TextCell.
const
Properties
- backgroundColor → Color?
-
The background color of the cell. Defaults to Colors.white.
final
- borderColor → Color?
-
The color of the cell borders. Defaults to Colors.black12.
final
- cellHeight → double?
-
The fixed height of the cell. If null, it adapts to the parent.
final
- cellWidth → double?
-
The fixed width of the cell. If null, it adapts to the parent.
final
- exportAlignment → AlignmentGeometry?
-
Alignment metadata for the Excel Exporter.
no setteroverride
- exportBackgroundColor → Color?
-
Background color metadata for the Excel Exporter.
no setteroverride
- exportIsBold → bool
-
Bold styling metadata for the Excel Exporter.
no setteroverride
- exportTextColor → Color?
-
Text color metadata for the Excel Exporter.
no setteroverride
- exportValue → String
-
Data extraction property for the Excel Exporter.
no setteroverride
- formattedText → String
-
Processes the itemContent into its final display string.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isAmount → bool
-
If true, treats the itemContent as a numeric value for formatting.
final
- isBold → bool
-
Whether the text should be bold.
final
- isItalic → bool
-
Whether the text should be italicized.
final
- isUnderline → bool
-
Whether the text should have an underline.
final
- itemContent → T
-
The raw content to be displayed in the cell.
final
- itemToString → String Function(T)?
-
An optional function to convert itemContent into a custom string.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- numberFormatType → CellNumberFormat
-
The numbering system to use (e.g., Indian or International).
final
- onTap → void Function(T)?
-
Callback triggered when the cell is tapped.
Returns the original itemContent.
final
- roundMode → RoundMode
-
The rounding logic to apply to numeric values.
final
- roundTo → int
-
The number of decimal places to round to.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- textAlignment → AlignmentGeometry?
-
How the text should be aligned within the cell. Defaults to Alignment.center.
final
- textColor → Color?
-
The color of the text. Defaults to Colors.black.
final
- textSize → double?
-
The font size of the text.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
copyWith(
{T? itemContent, String itemToString(T)?, double? cellWidth, double? cellHeight, double? textSize, AlignmentGeometry? textAlignment, Color? backgroundColor, Color? textColor, Color? borderColor, bool? isBold, bool? isItalic, bool? isUnderline, bool? isAmount, CellNumberFormat? numberFormatType, RoundMode? roundMode, int? roundTo, void onTap(T)?}) → TextCell< T> -
Creates a copy of this TextCell with updated properties.
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