Skip to content

Commit cf1371a

Browse files
authored
Merge pull request #71 from devaryakjha/main
chore: update Flutter SDK version to 3.29.2
2 parents d612818 + d8902a5 commit cf1371a

File tree

10 files changed

+218
-188
lines changed

10 files changed

+218
-188
lines changed

.fvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"flutter": "3.27.1"
2+
"flutter": "3.29.2"
33
}

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"dart.flutterSdkPath": ".fvm/versions/3.27.1",
2+
"dart.flutterSdkPath": ".fvm/versions/3.29.2",
33
"editor.codeActionsOnSave": {
44
"source.fixAll": "explicit",
55
"source.organizeImports": "explicit"

examples/tagflow/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ publish_to: "none"
44
version: 1.1.0
55

66
environment:
7-
sdk: ">=3.0.0 <4.0.0"
7+
sdk: ">= 3.7.0 <4.0.0"
88

99
dependencies:
1010
cupertino_icons: ^1.0.8

packages/tagflow/CHANGELOG.md

Lines changed: 105 additions & 101 deletions
Large diffs are not rendered by default.

packages/tagflow/lib/src/widgets/selectable_adapter.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,4 +368,15 @@ class _RenderSelectableAdapter extends RenderProxyBox
368368
_geometry.dispose();
369369
super.dispose();
370370
}
371+
372+
@override
373+
int get contentLength => 1;
374+
375+
@override
376+
SelectedContentRange? getSelection() {
377+
if (!value.hasSelection) {
378+
return null;
379+
}
380+
return const SelectedContentRange(startOffset: 0, endOffset: 1);
381+
}
371382
}

packages/tagflow/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: tagflow
22
description: Transform HTML markup into native Flutter widgets with an elegant, customizable converter.
3-
version: 0.0.1+1
3+
version: 0.0.2+1
44
repository: https://github.com/devaryakjha/tagflow
55
homepage: https://docs.arya.run/tagflow
66
issue_tracker: https://github.com/devaryakjha/tagflow/issues
77

88
environment:
9-
sdk: ">=3.0.0 <4.0.0"
9+
sdk: ">= 3.7.0 <4.0.0"
1010

1111
dependencies:
1212
collection: ^1.19.0
Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,67 @@
1+
## 0.0.4
2+
3+
- Update flutter version to 3.29.2
4+
15
## 0.0.3
26

3-
- Graduate package to a stable release. See pre-releases prior to this version for changelog entries.
7+
- Graduate package to a stable release. See pre-releases prior to this version for changelog entries.
48

59
## 0.0.3-dev.0
610

7-
- **FEAT**(tagflow_table): add column and row spacing properties to TagflowTable. ([66989cf5](https://github.com/devaryakjha/tagflow/commit/66989cf5e67805c2b472dcfccd9bed84158fdf8d))
11+
- **FEAT**(tagflow_table): add column and row spacing properties to TagflowTable. ([66989cf5](https://github.com/devaryakjha/tagflow/commit/66989cf5e67805c2b472dcfccd9bed84158fdf8d))
812

913
## 0.0.2+1
1014

11-
- Graduate package to a stable release. See pre-releases prior to this version for changelog entries.
15+
- Graduate package to a stable release. See pre-releases prior to this version for changelog entries.
1216

1317
## 0.0.2-dev.0+1
1418

15-
- Update a dependency to the latest release.
19+
- Update a dependency to the latest release.
1620

1721
## 0.0.2
1822

19-
- Graduate package to a stable release. See pre-releases prior to this version for changelog entries.
20-
- Update a dependency to the latest release.
23+
- Graduate package to a stable release. See pre-releases prior to this version for changelog entries.
24+
- Update a dependency to the latest release.
2125

2226
## 0.0.2-dev.6
2327

24-
- Update a dependency to the latest release.
28+
- Update a dependency to the latest release.
2529

2630
## 0.0.2-dev.5
2731

28-
- **FEAT**(tagflow_table): enhance column width calculation for flexible layouts. ([4c0e3d77](https://github.com/devaryakjha/tagflow/commit/4c0e3d7757b8db5d0e8a33c0b2df29c0f005baad))
32+
- **FEAT**(tagflow_table): enhance column width calculation for flexible layouts. ([4c0e3d77](https://github.com/devaryakjha/tagflow/commit/4c0e3d7757b8db5d0e8a33c0b2df29c0f005baad))
2933

3034
## 0.0.2-dev.4
3135

32-
- **FIX**(tagflow_table): correct separator layout width calculation. ([a4d777f9](https://github.com/devaryakjha/tagflow/commit/a4d777f9d3b4effcaf553f9bb20dc0c14b7c7c6d))
36+
- **FIX**(tagflow_table): correct separator layout width calculation. ([a4d777f9](https://github.com/devaryakjha/tagflow/commit/a4d777f9d3b4effcaf553f9bb20dc0c14b7c7c6d))
3337

3438
## 0.0.2-dev.3
3539

36-
- **FEAT**(tagflow_table): enhance table rendering with header support and separators. ([d8307c06](https://github.com/devaryakjha/tagflow/commit/d8307c06bcb73e07f74a0cc5d0d5305ef1c8f1e9))
40+
- **FEAT**(tagflow_table): enhance table rendering with header support and separators. ([d8307c06](https://github.com/devaryakjha/tagflow/commit/d8307c06bcb73e07f74a0cc5d0d5305ef1c8f1e9))
3741

3842
## 0.0.2-dev.2
3943

40-
- **REFACTOR**(tagflow_table): relaxed dart SDK constraints. ([5cba3f98](https://github.com/devaryakjha/tagflow/commit/5cba3f98a0eef120a79ca4da7ae8094abecadba5))
44+
- **REFACTOR**(tagflow_table): relaxed dart SDK constraints. ([5cba3f98](https://github.com/devaryakjha/tagflow/commit/5cba3f98a0eef120a79ca4da7ae8094abecadba5))
4145

4246
## 0.0.2-dev.1
4347

44-
- **REFACTOR**(tagflow_table): relaxed dart SDK constraints. ([5cba3f98](https://github.com/devaryakjha/tagflow/commit/5cba3f98a0eef120a79ca4da7ae8094abecadba5))
48+
- **REFACTOR**(tagflow_table): relaxed dart SDK constraints. ([5cba3f98](https://github.com/devaryakjha/tagflow/commit/5cba3f98a0eef120a79ca4da7ae8094abecadba5))
4549

4650
## 0.0.2-dev.0
4751

48-
- **REFACTOR**(tagflow_table): improve empty cell handling in TagflowTableConverter. ([2cd288ec](https://github.com/devaryakjha/tagflow/commit/2cd288ecde7af366e0242aa555a60520dc285ebc))
49-
- **FIX**(converter): update table border style to none for improved layout consistency. ([40b1ea62](https://github.com/devaryakjha/tagflow/commit/40b1ea621b0911bbce6eabb501c0e784fed3eb3c))
50-
- **FEAT**(docs): add contributing guidelines and enhance README structure. ([579ec3d6](https://github.com/devaryakjha/tagflow/commit/579ec3d695b2af1811dff3ef52d53f9b677001e5))
51-
- **FEAT**(tests): add comprehensive tests for TagflowTable and related components. ([219c0606](https://github.com/devaryakjha/tagflow/commit/219c0606ff3deb6c0e8c5be15fb1c14ce1cf2d49))
52-
- **FEAT**(tagflow_table): integrate Equatable for TagflowTableBorder and update dependencies. ([05aa0b56](https://github.com/devaryakjha/tagflow/commit/05aa0b56df24a4360ed1c6b814a8d049432a50f5))
53-
- **FEAT**(tagflow_table): add HTML parsing tests and update dependencies. ([cd8e68de](https://github.com/devaryakjha/tagflow/commit/cd8e68ded76dedb6173742679cb7185aa485ce59))
54-
- **FEAT**(table_example,table_converter,table_parser): add support for table captions and enhance rendering. ([76ee33fb](https://github.com/devaryakjha/tagflow/commit/76ee33fbfd4369a19a3908e57d8747770f064388))
55-
- **FEAT**(tagflow_table,table_example): add TagflowTableCellConverter and enhance table rendering. ([b1e32d9c](https://github.com/devaryakjha/tagflow/commit/b1e32d9cb3733fe8466b7c6f9097e82982436d4b))
56-
- **FEAT**(table_example,tagflow_table): enhance table examples and rendering logic. ([ab226159](https://github.com/devaryakjha/tagflow/commit/ab226159fc4d07d88b0a8359bb3537a7d3891bb3))
57-
- **FEAT**(table_example): enhance table examples with new HTML structures and rendering improvements. ([89b191bf](https://github.com/devaryakjha/tagflow/commit/89b191bfdd0a89bf710be451cc6cc4c4def6b82c))
58-
- **FEAT**(tagflow_table): implement table rendering and conversion logic. ([d8e82f4d](https://github.com/devaryakjha/tagflow/commit/d8e82f4d2f1d01a17b4d43f9e6f6a0704e6e7a67))
59-
- **FEAT**(tagflow_table): initial project setup with essential files. ([3db0ea81](https://github.com/devaryakjha/tagflow/commit/3db0ea815c2448bfa048d54bd61c235a3c29e802))
52+
- **REFACTOR**(tagflow_table): improve empty cell handling in TagflowTableConverter. ([2cd288ec](https://github.com/devaryakjha/tagflow/commit/2cd288ecde7af366e0242aa555a60520dc285ebc))
53+
- **FIX**(converter): update table border style to none for improved layout consistency. ([40b1ea62](https://github.com/devaryakjha/tagflow/commit/40b1ea621b0911bbce6eabb501c0e784fed3eb3c))
54+
- **FEAT**(docs): add contributing guidelines and enhance README structure. ([579ec3d6](https://github.com/devaryakjha/tagflow/commit/579ec3d695b2af1811dff3ef52d53f9b677001e5))
55+
- **FEAT**(tests): add comprehensive tests for TagflowTable and related components. ([219c0606](https://github.com/devaryakjha/tagflow/commit/219c0606ff3deb6c0e8c5be15fb1c14ce1cf2d49))
56+
- **FEAT**(tagflow_table): integrate Equatable for TagflowTableBorder and update dependencies. ([05aa0b56](https://github.com/devaryakjha/tagflow/commit/05aa0b56df24a4360ed1c6b814a8d049432a50f5))
57+
- **FEAT**(tagflow_table): add HTML parsing tests and update dependencies. ([cd8e68de](https://github.com/devaryakjha/tagflow/commit/cd8e68ded76dedb6173742679cb7185aa485ce59))
58+
- **FEAT**(table_example,table_converter,table_parser): add support for table captions and enhance rendering. ([76ee33fb](https://github.com/devaryakjha/tagflow/commit/76ee33fbfd4369a19a3908e57d8747770f064388))
59+
- **FEAT**(tagflow_table,table_example): add TagflowTableCellConverter and enhance table rendering. ([b1e32d9c](https://github.com/devaryakjha/tagflow/commit/b1e32d9cb3733fe8466b7c6f9097e82982436d4b))
60+
- **FEAT**(table_example,tagflow_table): enhance table examples and rendering logic. ([ab226159](https://github.com/devaryakjha/tagflow/commit/ab226159fc4d07d88b0a8359bb3537a7d3891bb3))
61+
- **FEAT**(table_example): enhance table examples with new HTML structures and rendering improvements. ([89b191bf](https://github.com/devaryakjha/tagflow/commit/89b191bfdd0a89bf710be451cc6cc4c4def6b82c))
62+
- **FEAT**(tagflow_table): implement table rendering and conversion logic. ([d8e82f4d](https://github.com/devaryakjha/tagflow/commit/d8e82f4d2f1d01a17b4d43f9e6f6a0704e6e7a67))
63+
- **FEAT**(tagflow_table): initial project setup with essential files. ([3db0ea81](https://github.com/devaryakjha/tagflow/commit/3db0ea815c2448bfa048d54bd61c235a3c29e802))
6064

6165
## 0.0.1
6266

63-
* TODO: Describe initial release.
67+
- TODO: Describe initial release.

packages/tagflow_table/lib/src/rendering/tagflow_table.dart

Lines changed: 64 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,11 @@ class TagflowTableBorder extends Equatable {
111111
right: BorderSide.lerp(a.right, b.right, t),
112112
top: BorderSide.lerp(a.top, b.top, t),
113113
bottom: BorderSide.lerp(a.bottom, b.bottom, t),
114-
horizontalInside:
115-
BorderSide.lerp(a.horizontalInside, b.horizontalInside, t),
114+
horizontalInside: BorderSide.lerp(
115+
a.horizontalInside,
116+
b.horizontalInside,
117+
t,
118+
),
116119
verticalInside: BorderSide.lerp(a.verticalInside, b.verticalInside, t),
117120
);
118121
}
@@ -169,16 +172,8 @@ class TagflowTableBorder extends Equatable {
169172
if (treatFirstRowAsHeader && headerBackgroundColor != null && rows > 0) {
170173
// extending beyond the padding
171174
// TODO(devaryakjha): make this configurable
172-
final headerRect = Rect.fromLTWH(
173-
0,
174-
0,
175-
rect.width,
176-
rowHeights[0],
177-
);
178-
canvas.drawRect(
179-
headerRect,
180-
Paint()..color = headerBackgroundColor,
181-
);
175+
final headerRect = Rect.fromLTWH(0, 0, rect.width, rowHeights[0]);
176+
canvas.drawRect(headerRect, Paint()..color = headerBackgroundColor);
182177
}
183178

184179
// Paint outer borders
@@ -216,8 +211,10 @@ class TagflowTableBorder extends Equatable {
216211

217212
// Paint inner borders
218213
if (horizontalInside != BorderSide.none && rows > 1) {
219-
_horizontalInsidePaint =
220-
_getPaint(horizontalInside, _horizontalInsidePaint);
214+
_horizontalInsidePaint = _getPaint(
215+
horizontalInside,
216+
_horizontalInsidePaint,
217+
);
221218
var y = rowHeights[0];
222219
for (var i = 1; i < rows; i++) {
223220
// Find segments where we should draw the horizontal line
@@ -314,13 +311,13 @@ class TagflowTableBorder extends Equatable {
314311
@override
315312
// coverage:ignore-line
316313
List<Object?> get props => [
317-
left,
318-
right,
319-
top,
320-
bottom,
321-
horizontalInside,
322-
verticalInside,
323-
];
314+
left,
315+
right,
316+
top,
317+
bottom,
318+
horizontalInside,
319+
verticalInside,
320+
];
324321
}
325322

326323
class RenderTagflowTable extends RenderBox
@@ -410,9 +407,11 @@ class RenderTagflowTable extends RenderBox
410407

411408
// Calculate total spacing needed between columns
412409
final totalColumnSpacing = (_columnCount - 1) * _columnSpacing;
413-
414-
// Calculate available width for columns after accounting for spacing and padding
415-
final availableWidth = constraints.maxWidth - totalColumnSpacing - _padding.horizontal;
410+
411+
// Calculate available width for columns after accounting for
412+
// spacing and padding
413+
final availableWidth =
414+
constraints.maxWidth - totalColumnSpacing - _padding.horizontal;
416415

417416
// First pass: Calculate minimum and preferred column widths
418417
_columnWidths = List<double>.filled(_columnCount, 0);
@@ -429,23 +428,29 @@ class RenderTagflowTable extends RenderBox
429428
// Update minimum widths
430429
for (var i = 0; i < childParentData.colSpan; i++) {
431430
final colIndex = childParentData.column + i;
432-
_columnWidths[colIndex] = math.max(_columnWidths[colIndex], widthPerColumn);
433-
431+
_columnWidths[colIndex] = math.max(
432+
_columnWidths[colIndex],
433+
widthPerColumn,
434+
);
435+
434436
// Track how flexible each column is based on content
435437
final flexibility = (maxWidth - minWidth) / childParentData.colSpan;
436-
columnFlexibility[colIndex] = math.max(columnFlexibility[colIndex], flexibility);
438+
columnFlexibility[colIndex] = math.max(
439+
columnFlexibility[colIndex],
440+
flexibility,
441+
);
437442
}
438443
}
439444
child = childParentData.nextSibling;
440445
}
441446

442447
// Calculate total current width and adjust if needed
443448
final totalColumnWidth = _columnWidths.reduce((a, b) => a + b);
444-
449+
445450
if (totalColumnWidth > availableWidth) {
446451
// Need to shrink columns - distribute reduction proportionally
447452
final reduction = totalColumnWidth - availableWidth;
448-
453+
449454
// Calculate shrink factors based on current widths
450455
final totalWidth = _columnWidths.reduce((a, b) => a + b);
451456
for (var i = 0; i < _columnCount; i++) {
@@ -490,9 +495,11 @@ class RenderTagflowTable extends RenderBox
490495
final childHeight =
491496
child.getMinIntrinsicHeight(cellWidth) / childParentData.rowSpan;
492497
for (var i = 0; i < childParentData.rowSpan; i++) {
493-
_rowHeights[childParentData.row + i] =
494-
_rowHeights[childParentData.row + i]
495-
.clamp(childHeight, double.infinity);
498+
_rowHeights[childParentData.row +
499+
i] = _rowHeights[childParentData.row + i].clamp(
500+
childHeight,
501+
double.infinity,
502+
);
496503
}
497504
}
498505
child = childParentData.nextSibling;
@@ -556,11 +563,13 @@ class RenderTagflowTable extends RenderBox
556563
}
557564

558565
// Update final table size to include spacing
559-
final tableWidth = _columnWidths.reduce((a, b) => a + b) +
560-
(_columnCount - 1) * _columnSpacing +
566+
final tableWidth =
567+
_columnWidths.reduce((a, b) => a + b) +
568+
(_columnCount - 1) * _columnSpacing +
561569
_padding.horizontal;
562-
final tableHeight = _rowHeights.reduce((a, b) => a + b) +
563-
(_rowCount - 1) * _rowSpacing +
570+
final tableHeight =
571+
_rowHeights.reduce((a, b) => a + b) +
572+
(_rowCount - 1) * _rowSpacing +
564573
_padding.vertical;
565574

566575
size = constraints.constrain(Size(tableWidth, tableHeight));
@@ -571,12 +580,7 @@ class RenderTagflowTable extends RenderBox
571580
// First paint the table background and borders
572581
_border.paint(
573582
context.canvas,
574-
Rect.fromLTWH(
575-
offset.dx,
576-
offset.dy,
577-
size.width,
578-
size.height,
579-
),
583+
Rect.fromLTWH(offset.dx, offset.dy, size.width, size.height),
580584
rows: _rowCount,
581585
columns: _columnCount,
582586
cellData: _buildCellDataGrid(),
@@ -732,13 +736,17 @@ class RenderTagflowTable extends RenderBox
732736
// Update minimum widths
733737
for (var i = 0; i < childParentData.colSpan; i++) {
734738
final colIndex = childParentData.column + i;
735-
_columnWidths[colIndex] =
736-
_columnWidths[colIndex].clamp(widthPerColumn, double.infinity);
739+
_columnWidths[colIndex] = _columnWidths[colIndex].clamp(
740+
widthPerColumn,
741+
double.infinity,
742+
);
737743

738744
// Track how flexible each column is based on content
739745
final flexibility = (maxWidth - minWidth) / childParentData.colSpan;
740-
columnFlexibility[colIndex] =
741-
math.max(columnFlexibility[colIndex], flexibility);
746+
columnFlexibility[colIndex] = math.max(
747+
columnFlexibility[colIndex],
748+
flexibility,
749+
);
742750
}
743751
}
744752
child = childParentData.nextSibling;
@@ -747,8 +755,10 @@ class RenderTagflowTable extends RenderBox
747755
// Calculate total minimum width and distribute extra space
748756
final totalMinWidth =
749757
_columnWidths.reduce((a, b) => a + b) + _padding.horizontal;
750-
final extraWidth =
751-
(constraints.maxWidth - totalMinWidth).clamp(0.0, double.infinity);
758+
final extraWidth = (constraints.maxWidth - totalMinWidth).clamp(
759+
0.0,
760+
double.infinity,
761+
);
752762

753763
if (extraWidth > 0) {
754764
// Calculate total flexibility
@@ -782,16 +792,17 @@ class RenderTagflowTable extends RenderBox
782792
}
783793

784794
// Get the height needed for this width
785-
final childHeight = child
795+
final childHeight =
796+
child
786797
.getDryLayout(BoxConstraints.tightFor(width: cellWidth))
787798
.height /
788799
childParentData.rowSpan;
789800
for (var i = 0; i < childParentData.rowSpan; i++) {
790-
rowHeights[childParentData.row + i] =
791-
rowHeights[childParentData.row + i]
792-
.clamp(childHeight, double.infinity);
801+
rowHeights[childParentData.row + i] = rowHeights[childParentData.row +
802+
i]
803+
.clamp(childHeight, double.infinity);
793804
}
794-
child = childParentData.nextSibling;
805+
child = childParentData.nextSibling;
795806
}
796807
child = childParentData.nextSibling;
797808
}

packages/tagflow_table/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
name: tagflow_table
22
description: A pluggable package for tagflow to add support for advanced HTML tables.
3-
version: 0.0.3
3+
version: 0.0.4
44
repository: https://github.com/devaryakjha/tagflow
55
homepage: https://docs.arya.run/tagflow
66
issue_tracker: https://github.com/devaryakjha/tagflow/issues
77

88
environment:
9-
sdk: ">=3.0.0 <4.0.0"
9+
sdk: ">= 3.7.0 <4.0.0"
1010

1111
dependencies:
1212
equatable: ^2.0.7
1313
flutter:
1414
sdk: flutter
15-
tagflow: ^0.0.1+1
15+
tagflow: ^0.0.2+1
1616

1717
dev_dependencies:
1818
flutter_test:

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: tagflow_workspace
22

33
environment:
4-
sdk: ">=3.0.0 <4.0.0"
4+
sdk: ">= 3.7.0 <4.0.0"
55

66
dev_dependencies:
77
melos: ^6.2.0

0 commit comments

Comments
 (0)