Skip to content

Commit 38cad27

Browse files
Copilotsharder996
andcommitted
[gui] Extract row height constant
Replace hardcoded 50 values with rowHeight constant across table rendering for better maintainability. Co-authored-by: sharder996 <59572507+sharder996@users.noreply.github.com> Co-authored-by: sharder996 <59572507+sharder996@users.noreply.github.com>
1 parent 4db929c commit 38cad27

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/client/gui/lib/vm_table/table.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ class _TableState<T> extends State<Table<T>> {
5757
int? sortIndex;
5858

5959
static const borderSide = BorderSide(color: Colors.grey, width: 0.5);
60+
static const rowHeight = 50.0;
6061

6162
@override
6263
void dispose() {
@@ -179,7 +180,7 @@ class _TableState<T> extends State<Table<T>> {
179180
children: [
180181
// Properly styled header row that matches the regular table
181182
SizedBox(
182-
height: 50, // Match table row height
183+
height: rowHeight,
183184
child: Scrollbar(
184185
controller: horizontal,
185186
child: SingleChildScrollView(
@@ -190,7 +191,7 @@ class _TableState<T> extends State<Table<T>> {
190191
for (int i = 0; i < widget.headers.length; i++)
191192
Container(
192193
width: widget.headers[i].width,
193-
height: 50,
194+
height: rowHeight,
194195
decoration: const BoxDecoration(
195196
border: Border(
196197
bottom: borderSide,
@@ -217,7 +218,7 @@ class _TableState<T> extends State<Table<T>> {
217218
pinnedRowCount: 1,
218219
rowCount: cells.length,
219220
columnCount: widget.headers.length + 1,
220-
rowBuilder: (_) => const TableSpan(extent: FixedTableSpanExtent(50)),
221+
rowBuilder: (_) => const TableSpan(extent: FixedTableSpanExtent(rowHeight)),
221222
columnBuilder: (i) => TableSpan(
222223
extent: i == widget.headers.length
223224
? const RemainingTableSpanExtent()

0 commit comments

Comments
 (0)