aboutsummaryrefslogtreecommitdiffstats
path: root/lib/presentation/common_widget/volume_and_fan_control.dart
blob: b38e30385c0700db594d5d40d9b2dd1b2d4932a6 (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.media ? false : true,
              child: const VolumeBar()),
          SizedBox(
            height: gapSize,
          ),
          Visibility.maintain(
            visible: state == AppState.hvac ? false : true,
            child: const FanBar(),
          ),
        ],
      ),
    );
  }
}