summaryrefslogtreecommitdiffstats
path: root/lib/presentation/screens/dashboard/widgets/hybrid_mode.dart
blob: f5f128619620358ace24a83e4c73836faf32a4a1 (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
import 'package:flutter_ics_homescreen/export.dart';

class HybridModel extends ConsumerStatefulWidget {
  const HybridModel({super.key});

  @override
  HybridModelState createState() => HybridModelState();
}

class HybridModelState extends ConsumerState<HybridModel> {

  @override
  Widget build(BuildContext context) {
    if (!randomHybridAnimation) {
      ref.listen<Vehicle>(vehicleProvider, (Vehicle? previous, Vehicle next) {
        ref.watch(hybridStateProvider.notifier).updateHybridState(
            next.speed,
            next.engineSpeed,
            false); //TODO get brake value and improve state logic
      });
    }
    
    return const SizedBox(
      width: 500,
      height: 500,
      child: Stack(
        children: [
          HybridBackround(),
          TopArrow(),
          LeftArrow(),
          RightArrow(),
          BatteryHybrid(),
        ],
      ),
    );
  }
}