diff options
Diffstat (limited to 'lib/vehicle-signals/vss_signal_providers.dart')
-rw-r--r-- | lib/vehicle-signals/vss_signal_providers.dart | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/lib/vehicle-signals/vss_signal_providers.dart b/lib/vehicle-signals/vss_signal_providers.dart new file mode 100644 index 0000000..51b8b6c --- /dev/null +++ b/lib/vehicle-signals/vss_signal_providers.dart @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: Apache-2.0 + +import 'package:meta/meta.dart'; +import 'package:flutter_riverpod/flutter_riverpod.dart'; + +// Left Temperature + +final LeftClimateTempProvider = StateNotifierProvider<LeftClimateTemp, int>( + (ref) => LeftClimateTemp(), +); + +class LeftClimateTemp extends StateNotifier<int> { + LeftClimateTemp() : super(22); + + Future<void> update(value) async { + state = value; + } +} + +// Right Temperature + +final RightClimateTempProvider = StateNotifierProvider<RightClimateTemp, int>( + (ref) => RightClimateTemp(), +); + +class RightClimateTemp extends StateNotifier<int> { + RightClimateTemp() : super(22); + + Future<void> update(value) async { + state = value; + } +} + +// Fan Speed + +final fanSpeedProvider = + StateNotifierProvider<fanslider, int>((ref) => fanslider()); + +class fanslider extends StateNotifier<int> { + fanslider() : super(30); + void update(value) { + state = value; + } +} |