summaryrefslogtreecommitdiffstats
path: root/lib/home_page.dart
blob: a6eb3a3a36e0a54205423a8d24ba4b24b3dbb1cd (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
// SPDX-License-Identifier: Apache-2.0


import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_hvac/Buttons/fresh_air.dart';
import 'package:flutter_svg_provider/flutter_svg_provider.dart';
import 'package:flutter_hvac/Buttons/AC.dart';
import 'package:flutter_hvac/Buttons/ac_on_face.dart';
import 'package:flutter_hvac/Buttons/ac_on_foot.dart';
import 'package:flutter_hvac/Buttons/defrost_recirculate.dart';
import 'package:flutter_hvac/size.dart';
import 'package:flutter_hvac/slider/Climate_slider.dart';
import 'package:flutter_hvac/slider/Right_climate_slider.dart';

import 'Buttons/auto.dart';
import 'widgets/Right_climate.dart';
import 'widgets/left_climate.dart';
import 'slider/slider.dart';

class MyHome_Page extends StatelessWidget {
  final WebSocket socket;
  MyHome_Page({Key? key, required this.socket}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    SizeConfig().init(context);

    return Scaffold(
      backgroundColor: Colors.black,
      body: Flex(direction: Axis.vertical,
        children: [
          Flexible(
            flex: 4,
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                children: [
                  Row(
                    children: [

                      ClimateSliderControlLeft(),
                      SizedBox(width: SizeConfig.blockSizeHorizontal*4,),


                      Column(
                        children: [
                          Text(
                            'Left',
                            style: TextStyle(
                              fontSize: SizeConfig.fontsize*4,
                              fontWeight: FontWeight.w700,
                              color: Colors.lightBlueAccent,
                            ),
                          ),

                          SizedBox(
                              height: SizeConfig.screenHeight/10,
                              width: SizeConfig.screenWidth/10,
                              child: Image.asset('images/left_climate.PNG')),

                          ScrollContainerLeft(
                            socket: socket,
                          ),
                        ],
                      ),


                    ],
                  ),
                  Row(
                    // mainAxisAlignment: MainAxisAlignment.end,
                    children: [

                      Column(
                        children: [
                          Text(
                            'Right',
                            style: TextStyle(
                              fontSize: SizeConfig.fontsize*4,
                              fontWeight: FontWeight.w700,
                              color: Colors.lightBlueAccent,
                            ),
                          ),
                          SizedBox(
                              height: SizeConfig.screenHeight/10,
                              width: SizeConfig.screenWidth/10,
                              child: Image.asset('images/right_climate.PNG')),

                          ScrollContainerRight(
                            socket: socket,
                          ),
                        ],
                      ),
                      SizedBox(width: SizeConfig.blockSizeHorizontal*4,),

                      ClimateSliderControlRight(),
                    ],
                  ),

                ],
              )),
          Flexible(
            flex: 2,
              child: Row(
                crossAxisAlignment: CrossAxisAlignment.center,
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  Image(
                    width: SizeConfig.screenWidth*0.20,
                    height: SizeConfig.screenHeight*0.25,
                    image: Svg('images/fan.svg'),
                    color: Colors.lightBlueAccent,
                  ),
                  SliderControl(
                    socket: socket,
                  )
                ],
              )),
          Flexible(
            flex: 3,
              child: Row(
                mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                children: [
                  Column(
                    children: [
                      AC(
                          socket: socket,
                          serverPath: 'Vehicle.Cabin.HVAC.IsAirConditioningActive'),
                      SizedBox(height: SizeConfig.safeBlockVertical,),

                      AcOnFoot(
                        img: 'images/ac_on_foot.svg',
                        socket: socket,
                      ),
                      SizedBox(height: SizeConfig.safeBlockVertical,),

                      AcOnFace(
                        img: 'images/ac_on_face.svg',
                        socket: socket,
                      ),
                    ],
                  ),
                  Row(
                    children: [
                      Auto(serverPath: '', socket: socket),
                      SizedBox(width: SizeConfig.safeBlockHorizontal,),
                      FreshAir(serverPath: '', socket: socket, img: 'images/wind_in.svg'),
                    ],
                  ),
                  Column(
                    children: [
                      CaustomButton(
                          serverPath: 'Vehicle.Cabin.HVAC.IsRecirculationActive',
                          socket: socket,
                          img: 'images/in_out.svg',
                          type: 'Recirculation'),
                      SizedBox(height: SizeConfig.safeBlockVertical,),
                      CaustomButton(
                          serverPath: 'Vehicle.Cabin.HVAC.IsRearDefrosterActive',
                          socket: socket,
                          img: 'images/rear_ws.svg',
                          type: 'Rear_defrost'),
                      SizedBox(height: SizeConfig.safeBlockVertical,),

                      CaustomButton(
                          serverPath: 'Vehicle.Cabin.HVAC.IsFrontDefrosterActive',
                          socket: socket,
                          img: 'images/wind_shield.svg',
                          type: 'Front_defrost'),
                    ],
                  ),
                ],
              )),
        ],


      ),
      );
  }
}