Skip to content

Commit fb6fe72

Browse files
rahul31124marcnause
authored andcommitted
update provider
1 parent eea8122 commit fb6fe72

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

lib/providers/gas_sensor_state_provider.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,17 @@ class GasSensorStateProvider extends ChangeNotifier {
462462
super.dispose();
463463
}
464464

465+
void setActiveMode(String mode) {
466+
if (_activeMode != mode) {
467+
_activeMode = mode;
468+
469+
clearData();
470+
_startTime = DateTime.now().millisecondsSinceEpoch / 1000.0;
471+
472+
notifyListeners();
473+
}
474+
}
475+
465476
double getCurrentValue() => _currentValue;
466477
String getActiveMode() => _activeMode;
467478

0 commit comments

Comments
 (0)