summaryrefslogtreecommitdiffstats
path: root/lib/vehicle-signals/vss_signal_providers.dart
blob: 51b8b6c64eda1e72356829f3aa16b510c9d9d216 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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;
  }
}