@@ -56,16 +56,16 @@ class LyfiDeviceModuleMetadata extends DeviceModuleMetadata {
5656 }
5757
5858 static List <Widget > _secondaryStatesBuilder (BuildContext context, AbstractDeviceSummaryViewModel vm) {
59- final modeWidget = Selector <AbstractDeviceSummaryViewModel , LyfiMode ?>(
60- selector: (_, vm) => (vm as LyfiSummaryDeviceViewModel ).ledMode,
61- builder: (context, mode, child) => Text (_modeText (context, mode), style: Theme .of (context).textTheme.labelSmall),
62- );
6359 final stateWidget = Selector <AbstractDeviceSummaryViewModel , LyfiState ?>(
6460 selector: (_, vm) => (vm as LyfiSummaryDeviceViewModel ).ledState,
6561 builder: (context, state, child) =>
6662 Text (_stateText (context, state), style: Theme .of (context).textTheme.labelSmall),
6763 );
68- return [modeWidget, stateWidget];
64+ final modeWidget = Selector <AbstractDeviceSummaryViewModel , LyfiMode ?>(
65+ selector: (_, vm) => (vm as LyfiSummaryDeviceViewModel ).ledMode,
66+ builder: (context, mode, child) => Text (_modeText (context, mode), style: Theme .of (context).textTheme.labelSmall),
67+ );
68+ return [stateWidget, modeWidget];
6969 }
7070
7171 /// Custom card center: bar chart of per-channel brightness.
@@ -115,20 +115,13 @@ class LyfiDeviceModuleMetadata extends DeviceModuleMetadata {
115115 }
116116 }
117117
118- static String _stateText (BuildContext context, LyfiState ? state) {
119- switch (state) {
120- case LyfiState .normal:
121- return context.translate ('NORM' );
122- case LyfiState .dimming:
123- return context.translate ('DIMM' );
124- case LyfiState .temporary:
125- return context.translate ('TEMP' );
126- case LyfiState .preview:
127- return context.translate ('PREV' );
128- default :
129- return '-' ;
130- }
131- }
118+ static String _stateText (BuildContext context, LyfiState ? state) => switch (state) {
119+ LyfiState .normal => context.translate ('NORM' ),
120+ LyfiState .dimming => context.translate ('DIMM' ),
121+ LyfiState .temporary => context.translate ('TEMP' ),
122+ LyfiState .preview => context.translate ('PREV' ),
123+ _ => '-' ,
124+ };
132125
133126 static Future <WotThing > _createWotThing (
134127 DeviceEntity device,
@@ -161,7 +154,7 @@ class _LyfiBrightnessChart extends StatelessWidget {
161154 final fraction = (value / kLyfiBrightnessMax).clamp (0.0 , 1.0 ).toDouble ();
162155 final pct = (fraction * 100 ).round ();
163156 final primaryColor = HexColor .fromHex (ch.color);
164- final trackColor = Theme .of (context).colorScheme.surfaceContainerLow ;
157+ final trackColor = Theme .of (context).colorScheme.surfaceContainerHigh ;
165158 return Center (
166159 child: LayoutBuilder (
167160 builder: (context, constraints) {
0 commit comments