ResizableTableController class
Controller for managing resizable table column and row dimensions.
Provides programmatic control over table column widths and row heights with support for constraints, default sizes, and interactive resizing. Extends ChangeNotifier to notify listeners when dimensions change.
Example:
final controller = ResizableTableController(
defaultColumnWidth: 100.0,
defaultRowHeight: 40.0,
columnWidths: {0: 150.0, 2: 200.0},
widthConstraints: {1: ConstrainedTableSize(min: 50, max: 300)},
);
- Inheritance
-
- Object
- ChangeNotifier
- ResizableTableController
Constructors
-
ResizableTableController({Map<
int, double> ? columnWidths, required double defaultColumnWidth, Map<int, double> ? rowHeights, required double defaultRowHeight, ConstrainedTableSize? defaultWidthConstraint, ConstrainedTableSize? defaultHeightConstraint, Map<int, ConstrainedTableSize> ? widthConstraints, Map<int, ConstrainedTableSize> ? heightConstraints}) - Creates a controller for managing resizable table dimensions.
Properties
-
columnWidths
→ Map<
int, double> ? -
Gets an unmodifiable map of custom column widths.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
-
rowHeights
→ Map<
int, double> ? -
Gets an unmodifiable map of custom row heights.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object.
inherited
-
getColumnMaxWidth(
int index) → double? - Gets the maximum width constraint for a specific column.
-
getColumnMinWidth(
int index) → double? - Gets the minimum width constraint for a specific column.
-
getColumnWidth(
int index) → double - Gets the width of a specific column.
-
getRowHeight(
int index) → double - Gets the height of a specific row.
-
getRowMaxHeight(
int index) → double? - Gets the maximum height constraint for a specific row.
-
getRowMinHeight(
int index) → double? - Gets the minimum height constraint for a specific row.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
resizeColumn(
int column, double width) → bool - Resizes a specific column to a new width.
-
resizeColumnBorder(
int previousColumn, int nextColumn, double deltaWidth) → double - Resizes adjacent columns by dragging their shared border.
-
resizeRow(
int row, double height) → bool - Resizes a specific row to a new height.
-
resizeRowBorder(
int previousRow, int nextRow, double deltaHeight) → double - Resizes adjacent rows by dragging their shared border.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited