@@ -12,6 +12,7 @@ class TableViewRow<T> extends StatelessWidget {
1212 required this .row,
1313 required this .rowHeight,
1414 required this .data,
15+ this .isActive,
1516 this .fullWidthHighlight = false ,
1617 bool showEvenRowHighlight = true ,
1718 }) : hasEvenRowHighlight = (showEvenRowHighlight) ? index % 2 == 1 : false ;
@@ -29,14 +30,18 @@ class TableViewRow<T> extends StatelessWidget {
2930 final bool hasEvenRowHighlight;
3031 final bool fullWidthHighlight;
3132
33+ /// When the table is not active, the selection color is grey.
34+ final Prop <bool >? isActive;
35+
3236 @override
3337 Widget build (BuildContext context) {
3438 return GestureDetector (
3539 onTap: () {
3640 data.select (TableSelection (key: row.key, value: row.value));
3741 },
3842 behavior: HitTestBehavior .opaque,
39- child: Padding (
43+ child: AnimatedContainer (
44+ duration: const Duration (milliseconds: 75 ),
4045 padding: fullWidthHighlight
4146 ? EdgeInsets .zero
4247 : const EdgeInsets .symmetric (horizontal: 10 ),
@@ -61,6 +66,7 @@ class TableViewRow<T> extends StatelessWidget {
6166 hasEvenRowHighlight: hasEvenRowHighlight,
6267 fullWidthHighlight: fullWidthHighlight,
6368 isSelected: isSelected,
69+ isActive: isActive,
6470 columnWidths: columnWidths,
6571 childrenBuilder: (context) => colDefs.map ((colDef) {
6672 final AlignmentGeometry alignmentGeometry =
@@ -89,8 +95,9 @@ class TableViewRow<T> extends StatelessWidget {
8995}
9096
9197/// Add selection and even / odd highlighting to table rows
92- class _RowHighlight extends StatelessWidget {
98+ class _RowHighlight extends ReactiveWidget {
9399 const _RowHighlight ({
100+ this .isActive,
94101 required this .hasEvenRowHighlight,
95102 required this .fullWidthHighlight,
96103 required this .isSelected,
@@ -100,6 +107,10 @@ class _RowHighlight extends StatelessWidget {
100107
101108 final bool hasEvenRowHighlight;
102109 final bool fullWidthHighlight;
110+
111+ /// When the table is not active, the selection color is grey.
112+ final Prop <bool >? isActive;
113+
103114 final bool isSelected;
104115 final Map <int , TableColumnWidth > columnWidths;
105116 final List <Widget > Function (BuildContext ) childrenBuilder;
@@ -118,7 +129,9 @@ class _RowHighlight extends StatelessWidget {
118129 );
119130 } else if (isSelected) {
120131 decoration = BoxDecoration (
121- color: MemexColor .selection,
132+ color: (isActive? .value ?? true )
133+ ? MemexColor .selection
134+ : MemexColor .selectionInactive,
122135 borderRadius: fullWidthHighlight
123136 ? null
124137 : const BorderRadius .all (Radius .circular (5 )),
0 commit comments