aboutsummaryrefslogtreecommitdiffstats
path: root/lib/presentation/common_widget/volume_and_fan_control.dart
blob: 051e360037aced6ce0533d314441dd80302aa86d (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
import '../common_widget/volume_bar.dart';
import '../common_widget/fan_bar.dart';

import '../../export.dart';

class VolumeFanControl extends ConsumerWidget {
  const VolumeFanControl({
    super.key,
  });

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    final state = ref.watch(appProvider);
    final size = MediaQuery.of(context).size;
    final gapSize = size.height * 0.06;

    return Padding(
      padding: const EdgeInsets.only(left: 10),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.center,
        children: [
          Visibility.maintain(
              visible: state == AppState.mediaPlayer ? false : true,
              child: const VolumeBar()),
          SizedBox(
            height: gapSize,
          ),
          Visibility.maintain(
            visible: state == AppState.hvac ? false : true,
            child: const FanBar(),
          ),
        ],
      ),
    );
  }
}