Table class

A table, with Bangla shaped correctly in every cell.

Modelled on pw.TableHelper.fromTextArray so the styling parameters read the same way. The first row of data is the header unless headerCount is changed.

Inheritance

Constructors

Table({required List<List<String>> data, int headerCount = 1, double fontSize = 14, FontWeight fontWeight = pw.FontWeight.normal, Font? banglaFont, Font? generalFont, PdfColor headerColor = PdfColors.grey300, PdfColor? headerTextColor, TextAlign headerAlignment = pw.TextAlign.center, TextStyle? headerStyle, EdgeInsetsGeometry? headerPadding, double? headerHeight, BoxDecoration? headerDecoration, TextStyle? cellStyle, TextStyle? oddCellStyle, String cellFormat(int column, String value)?, String headerFormat(int column, String value)?, BoxDecoration? headerCellDecoration, TextDirection? headerDirection, TextDirection? tableDirection, PdfColor cellTextColor = PdfColors.black, EdgeInsetsGeometry cellPadding = const pw.EdgeInsets.all(6), double cellHeight = 0, AlignmentGeometry cellAlignment = pw.Alignment.centerLeft, Map<int, AlignmentGeometry>? cellAlignments, Map<int, AlignmentGeometry>? headerAlignments, BoxDecoration? cellDecoration(int column, String value, int row)?, TextStyle? textStyleBuilder(int column, String value, int row)?, Widget? cellBuilder(int column, String value, int row)?, BoxDecoration? rowDecoration, BoxDecoration? oddRowDecoration, PdfColor borderColor = PdfColors.grey, TableBorder? border, Map<int, TableColumnWidth>? columnWidths, TableColumnWidth defaultColumnWidth = const pw.IntrinsicColumnWidth(), TableWidth tableWidth = pw.TableWidth.max, TableCellVerticalAlignment defaultVerticalAlignment = pw.TableCellVerticalAlignment.middle, TextStyle? style, TextStyle? banglaStyle})
Creates a Table.

Properties

banglaFont Font?
The font to use for Bangla runs.
final
banglaStyle TextStyle?
Style for Bangla runs.
final
border TableBorder?
Border, or null for none. Overrides borderColor.
final
borderColor → PdfColor
Colour of the default border.
final
box ↔ PdfRect?
The bounding box of this widget, calculated at layout time
getter/setter pairinherited
canSpan bool
no setterinherited
cellAlignment AlignmentGeometry
Alignment of body cell contents.
final
cellAlignments Map<int, AlignmentGeometry>?
Per-column alignment overrides for body cells.
final
cellBuilder Widget? Function(int column, String value, int row)?
Replaces a body cell entirely: (column, value, row).
final
cellDecoration BoxDecoration? Function(int column, String value, int row)?
Decoration for one body cell: (column, value, row).
final
cellFormat String Function(int column, String value)?
Rewrites a body cell's text before it is drawn.
final
cellHeight double
Fixed body row height, or 0 to size to content.
final
cellPadding EdgeInsetsGeometry
Padding inside body cells.
final
cellStyle TextStyle?
Style for body cells.
final
cellTextColor → PdfColor
Text colour in body cells.
final
columnWidths Map<int, TableColumnWidth>?
Fixed column widths, by index.
final
data List<List<String>>
Row data. The first headerCount rows are headers.
final
defaultColumnWidth TableColumnWidth
Width strategy for columns with no explicit width.
final
defaultVerticalAlignment TableCellVerticalAlignment
Vertical alignment inside cells.
final
fontSize double
Font size for every cell.
final
fontWeight FontWeight
Font weight for body cells.
final
generalFont Font?
The font to use for non-Bangla runs.
final
hashCode int
The hash code for this object.
no setterinherited
hasMoreWidgets bool
no setterinherited
headerAlignment TextAlign
Horizontal alignment of header text.
final
headerAlignments Map<int, AlignmentGeometry>?
Per-column alignment overrides for header cells.
final
headerCellDecoration BoxDecoration?
Decoration behind each header cell, as opposed to the whole row.
final
headerColor → PdfColor
Background of the header row.
final
headerCount int
How many leading rows are headers. 0 for none.
final
headerDecoration BoxDecoration?
Decoration behind the whole header row.
final
headerDirection TextDirection?
Reading direction of the header row.
final
headerFormat String Function(int column, String value)?
Rewrites a header cell's text before it is drawn.
final
headerHeight double?
Fixed header row height, or 0 to size to content.
final
headerPadding EdgeInsetsGeometry?
Padding inside header cells; defaults to cellPadding.
final
headerStyle TextStyle?
Style for header cells; overrides headerColor and fontSize.
final
headerTextColor → PdfColor?
Text colour in header cells.
final
oddCellStyle TextStyle?
Style for odd body rows, for banded text.
final
oddRowDecoration BoxDecoration?
Decoration behind odd body rows, for banding.
final
rowDecoration BoxDecoration?
Decoration behind every body row.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
style TextStyle?
Style for non-Bangla runs.
final
tableDirection TextDirection?
Reading direction of the table as a whole.
final
tableWidth TableWidth
How the table sizes itself horizontally.
final
textStyleBuilder TextStyle? Function(int column, String value, int row)?
Style for one body cell: (column, value, row). Wins over cellStyle.
final

Methods

applyContext(covariant WidgetContext context) → void
Called before relayout to restore the saved state and restart the layout in the same conditions
inherited
build(Context context) Widget
override
cloneContext() WidgetContext
Called after layout to save the state
inherited
debugPaint(Context context) → void
inherited
layout(Context context, BoxConstraints constraints, {bool parentUsesSize = false}) → void
First widget pass to calculate the children layout and bounding box
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
paint(Context context) → void
Draw itself and its children, according to the calculated box.offset
inherited
restoreContext(covariant WidgetContext context) → void
Apply the context for next page layout. Called before layout to prepare for next page
inherited
saveContext() WidgetContext
Get unmodified mutable context object
inherited
toString() String
A string representation of this object.
inherited

Operators

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