Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
smart_hotel_app
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张宏
smart_hotel_app
Commits
dc39b305
Commit
dc39b305
authored
May 19, 2026
by
张宏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
3b5ba7b4
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
854 additions
and
132 deletions
+854
-132
app_router.gr.dart
lib/routes/app_router.gr.dart
+1
-1
abnormal_detail.dart
lib/views/home/abnormal/abnormal_detail.dart
+0
-0
controller.dart
lib/views/home/abnormal/controller.dart
+0
-0
equipment_list_block.dart
lib/views/home/index/child/equipment_list_block.dart
+208
-0
task_head_block.dart
lib/views/home/index/child/task_head_block.dart
+66
-0
task_total_block.dart
lib/views/home/index/child/task_total_block.dart
+156
-0
temperature_block.dart
lib/views/home/index/child/temperature_block.dart
+209
-0
voltage_operate_block.dart
lib/views/home/index/child/voltage_operate_block.dart
+150
-0
controller.dart
lib/views/home/index/controller.dart
+5
-0
index_view.dart
lib/views/home/index/index_view.dart
+50
-0
index_view.dart
lib/views/home/index_view.dart
+0
-131
pubspec.lock
pubspec.lock
+8
-0
pubspec.yaml
pubspec.yaml
+1
-0
No files found.
lib/routes/app_router.gr.dart
View file @
dc39b305
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
// ignore_for_file: no_leading_underscores_for_library_prefixes
// ignore_for_file: no_leading_underscores_for_library_prefixes
import
'package:auto_route/auto_route.dart'
as
_i8
;
import
'package:auto_route/auto_route.dart'
as
_i8
;
import
'package:flutter/material.dart'
as
_i9
;
import
'package:flutter/material.dart'
as
_i9
;
import
'package:smart_hotel_app/views/home/index_view.dart'
as
_i2
;
import
'package:smart_hotel_app/views/home/index
/index
_view.dart'
as
_i2
;
import
'package:smart_hotel_app/views/layout/default_view.dart'
as
_i1
;
import
'package:smart_hotel_app/views/layout/default_view.dart'
as
_i1
;
import
'package:smart_hotel_app/views/login/login_view.dart'
as
_i3
;
import
'package:smart_hotel_app/views/login/login_view.dart'
as
_i3
;
import
'package:smart_hotel_app/views/message/index_view.dart'
as
_i4
;
import
'package:smart_hotel_app/views/message/index_view.dart'
as
_i4
;
...
...
lib/views/home/abnormal/abnormal_detail.dart
0 → 100644
View file @
dc39b305
lib/views/home/abnormal/controller.dart
0 → 100644
View file @
dc39b305
lib/views/home/index/child/equipment_list_block.dart
0 → 100644
View file @
dc39b305
import
'package:flutter/material.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
class
EquipmentListBlock
extends
StatefulWidget
{
const
EquipmentListBlock
({
super
.
key
});
@override
State
<
EquipmentListBlock
>
createState
()
=>
_EquipmentListBlockState
();
}
class
_EquipmentListBlockState
extends
State
<
EquipmentListBlock
>
{
final
List
<
Map
<
String
,
dynamic
>>
_equipmentList
=
[
{
'icon'
:
Icons
.
electrical_services
,
'title'
:
'空调主机-01'
,
'subtitle'
:
'位置:A栋3楼机房'
,
'status'
:
'运行中'
,
'statusColor'
:
Color
.
fromRGBO
(
34
,
197
,
94
,
1
),
},
{
'icon'
:
Icons
.
thermostat
,
'title'
:
'温度传感器-02'
,
'subtitle'
:
'位置:B栋2楼走廊'
,
'status'
:
'异常'
,
'statusColor'
:
Color
.
fromRGBO
(
246
,
158
,
11
,
1
),
},
{
'icon'
:
Icons
.
water_drop
,
'title'
:
'水管阀门-03'
,
'subtitle'
:
'位置:C栋1楼大厅'
,
'status'
:
'待检修'
,
'statusColor'
:
Color
.
fromRGBO
(
239
,
68
,
68
,
1
),
},
{
'icon'
:
Icons
.
lightbulb
,
'title'
:
'照明系统-04'
,
'subtitle'
:
'位置:D栋5楼会议室'
,
'status'
:
'运行中'
,
'statusColor'
:
Color
.
fromRGBO
(
34
,
197
,
94
,
1
),
},
{
'icon'
:
Icons
.
electrical_services
,
'title'
:
'空调主机-05'
,
'subtitle'
:
'位置:A栋3楼机房'
,
'status'
:
'运行中'
,
'statusColor'
:
Color
.
fromRGBO
(
34
,
197
,
94
,
1
),
},
{
'icon'
:
Icons
.
thermostat
,
'title'
:
'温度传感器-06'
,
'subtitle'
:
'位置:B栋2楼走廊'
,
'status'
:
'异常'
,
'statusColor'
:
Color
.
fromRGBO
(
246
,
158
,
11
,
1
),
},
{
'icon'
:
Icons
.
water_drop
,
'title'
:
'水管阀门-07'
,
'subtitle'
:
'位置:C栋1楼大厅'
,
'status'
:
'待检修'
,
'statusColor'
:
Color
.
fromRGBO
(
239
,
68
,
68
,
1
),
},
{
'icon'
:
Icons
.
lightbulb
,
'title'
:
'照明系统-08'
,
'subtitle'
:
'位置:D栋5楼会议室'
,
'status'
:
'运行中'
,
'statusColor'
:
Color
.
fromRGBO
(
34
,
197
,
94
,
1
),
},
{
'icon'
:
Icons
.
lightbulb
,
'title'
:
'照明系统-08'
,
'subtitle'
:
'位置:D栋5楼会议室'
,
'status'
:
'运行中'
,
'statusColor'
:
Color
.
fromRGBO
(
34
,
197
,
94
,
1
),
},
{
'icon'
:
Icons
.
lightbulb
,
'title'
:
'照明系统-08'
,
'subtitle'
:
'位置:D栋5楼会议室'
,
'status'
:
'运行中'
,
'statusColor'
:
Color
.
fromRGBO
(
34
,
197
,
94
,
1
),
},
{
'icon'
:
Icons
.
lightbulb
,
'title'
:
'照明系统-08'
,
'subtitle'
:
'位置:D栋5楼会议室'
,
'status'
:
'运行中'
,
'statusColor'
:
Color
.
fromRGBO
(
34
,
197
,
94
,
1
),
},
{
'icon'
:
Icons
.
lightbulb
,
'title'
:
'照明系统-08'
,
'subtitle'
:
'位置:D栋5楼会议室'
,
'status'
:
'运行中'
,
'statusColor'
:
Color
.
fromRGBO
(
34
,
197
,
94
,
1
),
},
];
Widget
_buildEquipmentItem
(
Map
<
String
,
dynamic
>
item
)
{
return
Container
(
padding:
EdgeInsets
.
symmetric
(
vertical:
8
.
h
),
decoration:
BoxDecoration
(
border:
Border
(
bottom:
BorderSide
(
color:
Color
.
fromRGBO
(
71
,
85
,
105
,
0.3
),
width:
1
,
),
),
),
child:
Row
(
children:
[
Container
(
width:
40
.
w
,
height:
40
.
h
,
decoration:
BoxDecoration
(
color:
Color
.
fromRGBO
(
71
,
85
,
105
,
0.3
),
borderRadius:
BorderRadius
.
circular
(
8
.
r
),
),
child:
Icon
(
item
[
'icon'
]
as
IconData
,
color:
Color
.
fromRGBO
(
246
,
158
,
11
,
1
),
size:
20
.
sp
,
),
),
SizedBox
(
width:
12
.
w
),
Expanded
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
item
[
'title'
]
as
String
,
style:
TextStyle
(
fontSize:
14
.
sp
,
fontWeight:
FontWeight
.
w500
,
color:
Colors
.
white
,
),
),
SizedBox
(
height:
4
.
h
),
Text
(
item
[
'subtitle'
]
as
String
,
style:
TextStyle
(
fontSize:
12
.
sp
,
color:
Color
.
fromRGBO
(
148
,
163
,
184
,
1
),
),
),
],
),
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
8
.
w
,
vertical:
4
.
h
),
decoration:
BoxDecoration
(
color:
(
item
[
'statusColor'
]
as
Color
).
withOpacity
(
0.2
),
borderRadius:
BorderRadius
.
circular
(
4
.
r
),
),
child:
Text
(
item
[
'status'
]
as
String
,
style:
TextStyle
(
fontSize:
12
.
sp
,
color:
item
[
'statusColor'
]
as
Color
,
),
),
),
],
),
);
}
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
width:
double
.
infinity
,
margin:
EdgeInsets
.
only
(
top:
10
.
h
,
left:
20
.
w
,
right:
20
.
w
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
'设备巡检'
,
style:
TextStyle
(
fontSize:
14
.
sp
,
fontWeight:
FontWeight
.
bold
,
color:
Colors
.
white
),),
Text
(
'查看全部'
,
style:
TextStyle
(
fontSize:
14
.
sp
,
fontWeight:
FontWeight
.
bold
,
color:
Colors
.
white
),),
],
),
SizedBox
(
height:
12
.
h
),
Container
(
width:
double
.
infinity
,
padding:
EdgeInsets
.
all
(
20
.
w
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
25
.
r
),
color:
Color
.
fromRGBO
(
30
,
41
,
59
,
1
),
border:
BoxBorder
.
all
(
color:
Color
.
fromRGBO
(
246
,
158
,
11
,
1.0
),
width:
1
.
w
,
),
),
child:
Column
(
children:
[
...
_equipmentList
.
map
((
item
)
=>
_buildEquipmentItem
(
item
)).
toList
(),
],
),
),
SizedBox
(
height:
20
.
h
),
],
),
);
}
}
\ No newline at end of file
lib/views/home/index/child/task_head_block.dart
0 → 100644
View file @
dc39b305
import
'package:flutter/material.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
class
TaskHeadBlock
extends
StatefulWidget
{
const
TaskHeadBlock
({
super
.
key
});
@override
State
<
TaskHeadBlock
>
createState
()
=>
_TaskHeadBlockState
();
}
class
_TaskHeadBlockState
extends
State
<
TaskHeadBlock
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
width:
double
.
infinity
,
height:
140
.
h
,
padding:
EdgeInsets
.
only
(
top:
ScreenUtil
().
statusBarHeight
,
left:
20
.
w
,
right:
20
.
w
),
decoration:
BoxDecoration
(
border:
Border
(
bottom:
BorderSide
(
color:
Colors
.
blueGrey
,
width:
1
.
w
,
),
),
color:
Colors
.
red
,
),
child:
Column
(
children:
[
Flex
(
direction:
Axis
.
horizontal
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
'设备告警看板'
,
style:
TextStyle
(
fontSize:
28
.
sp
,
fontWeight:
FontWeight
.
bold
,
color:
Colors
.
white
),),
Text
(
'工程运维视角 今日xx条待处理'
,
style:
TextStyle
(
fontSize:
24
.
sp
,
color:
Color
.
fromRGBO
(
61
,
79
,
106
,
1.0
)),),
],
),
Container
(
width:
50
.
w
,
height:
50
.
h
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
25
.
r
),
color:
Colors
.
grey
,
border:
Border
.
all
(
color:
Colors
.
blueGrey
,
width:
1
.
w
,
),
),
),
],
),
],
),
);
}
}
\ No newline at end of file
lib/views/home/index/child/task_total_block.dart
0 → 100644
View file @
dc39b305
import
'package:flutter/material.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
class
TaskTotalBlock
extends
StatefulWidget
{
const
TaskTotalBlock
({
super
.
key
});
@override
State
<
TaskTotalBlock
>
createState
()
=>
_TaskTotalBlockState
();
}
class
_TaskTotalBlockState
extends
State
<
TaskTotalBlock
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
width:
double
.
infinity
,
height:
180
.
h
,
decoration:
BoxDecoration
(
color:
Colors
.
red
,
border:
Border
(
bottom:
BorderSide
(
width:
1
.
w
,
),
),
),
alignment:
Alignment
.
center
,
child:
Flex
(
direction:
Axis
.
horizontal
,
mainAxisAlignment:
MainAxisAlignment
.
spaceAround
,
children:
[
// 告警待处理
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Container
(
width:
190
.
w
,
height:
120
.
h
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
25
.
r
),
color:
Colors
.
white
,
border:
Border
.
all
(
color:
Colors
.
blueGrey
,
width:
1
.
w
,
),
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
'1'
,
style:
TextStyle
(
fontSize:
28
.
sp
,
fontWeight:
FontWeight
.
bold
,
color:
Colors
.
green
),),
Text
(
'告警待处理'
,
style:
TextStyle
(
fontSize:
14
.
sp
,
fontWeight:
FontWeight
.
bold
,
color:
Colors
.
grey
),),
],
),
),
Container
(
width:
110
.
w
,
height:
1
.
h
,
margin:
EdgeInsets
.
only
(
top:
5
.
h
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
border:
Border
(
bottom:
BorderSide
(
color:
Colors
.
blueGrey
,
width:
1
.
w
,
)),
),
),
],
),
// 中警待处理
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Container
(
width:
190
.
w
,
height:
120
.
h
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
25
.
r
),
color:
Colors
.
white
,
border:
Border
.
all
(
color:
Colors
.
blueGrey
,
width:
1
.
w
,
),
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
'12'
,
style:
TextStyle
(
fontSize:
28
.
sp
,
fontWeight:
FontWeight
.
bold
,
color:
Colors
.
green
),),
Text
(
'中警待处理'
,
style:
TextStyle
(
fontSize:
14
.
sp
,
fontWeight:
FontWeight
.
bold
,
color:
Colors
.
grey
),),
],
),
),
Container
(
width:
110
.
w
,
height:
1
.
h
,
margin:
EdgeInsets
.
only
(
top:
5
.
h
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
border:
Border
(
bottom:
BorderSide
(
color:
Colors
.
blueGrey
,
width:
1
.
w
,
)),
),
),
],
),
// 设备在线
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Container
(
width:
190
.
w
,
height:
120
.
h
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
25
.
r
),
color:
Colors
.
white
,
border:
Border
.
all
(
color:
Colors
.
blueGrey
,
width:
1
.
w
,
),
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
'88'
,
style:
TextStyle
(
fontSize:
28
.
sp
,
fontWeight:
FontWeight
.
bold
,
color:
Colors
.
green
),),
Text
(
'设备在线'
,
style:
TextStyle
(
fontSize:
14
.
sp
,
fontWeight:
FontWeight
.
bold
,
color:
Colors
.
grey
),),
],
),
),
Container
(
width:
110
.
w
,
height:
1
.
h
,
margin:
EdgeInsets
.
only
(
top:
5
.
h
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
border:
Border
(
bottom:
BorderSide
(
color:
Colors
.
blueGrey
,
width:
1
.
w
,
)),
),
),
],
),
],
),
);
}
}
\ No newline at end of file
lib/views/home/index/child/temperature_block.dart
0 → 100644
View file @
dc39b305
import
'package:flutter/material.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
class
TemperatureBlock
extends
StatefulWidget
{
const
TemperatureBlock
({
super
.
key
});
@override
State
<
TemperatureBlock
>
createState
()
=>
_TemperatureBlockState
();
}
class
_TemperatureBlockState
extends
State
<
TemperatureBlock
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
width:
double
.
infinity
,
// height: 280.h,
margin:
EdgeInsets
.
only
(
top:
10
.
h
,
left:
20
.
w
,
right:
20
.
w
),
padding:
EdgeInsets
.
all
(
20
.
w
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
25
.
r
),
color:
Color
.
fromRGBO
(
30
,
41
,
59
,
1
),
border:
Border
(
left:
BorderSide
(
color:
Color
.
fromRGBO
(
246
,
158
,
11
,
1.0
),
width:
10
.
w
,
)),
),
child:
Column
(
children:
[
// 描述信息
Container
(
width:
double
.
infinity
,
// height: 100.h,
margin:
EdgeInsets
.
only
(
bottom:
10
.
h
),
decoration:
BoxDecoration
(
border:
BoxBorder
.
all
(
color:
Color
.
fromRGBO
(
246
,
158
,
11
,
1.0
),
width:
1
.
w
,
),
),
child:
Flex
(
direction:
Axis
.
horizontal
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Container
(
width:
50
.
w
,
height:
50
.
h
,
decoration:
BoxDecoration
(
color:
Color
.
fromRGBO
(
71
,
85
,
105
,
0.3
),
borderRadius:
BorderRadius
.
circular
(
8
.
r
),
),
child:
Icon
(
Icons
.
thermostat
,
color:
Color
.
fromRGBO
(
246
,
158
,
11
,
1
),
size:
20
.
sp
,),
),
Expanded
(
child:
Container
(
width:
50
.
w
,
padding:
EdgeInsets
.
only
(
left:
10
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"温度异常告警"
,
style:
TextStyle
(
fontSize:
20
.
sp
,
color:
Color
.
fromRGBO
(
246
,
158
,
11
,
1.0
),),),
Text
(
"客房301 A-301 智能空开"
,
style:
TextStyle
(
fontSize:
15
.
sp
,
color:
Colors
.
grey
),),
],
),
),
),
Text
(
"置顶"
,
style:
TextStyle
(
fontSize:
15
.
sp
,
color:
Color
.
fromRGBO
(
246
,
158
,
11
,
1.0
)),)
],
)
),
// 数据行
Container
(
width:
double
.
infinity
,
height:
100
.
h
,
decoration:
BoxDecoration
(
color:
Color
.
fromRGBO
(
24
,
33
,
47
,
1.0
),
borderRadius:
BorderRadius
.
circular
(
25
.
r
),
border:
BoxBorder
.
all
(
color:
Color
.
fromRGBO
(
246
,
158
,
11
,
1.0
),
width:
1
.
w
,
),
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceAround
,
children:
[
Container
(
width:
100
.
w
,
height:
80
.
h
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
25
.
r
),
color:
Colors
.
white
,
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"85℃"
,
style:
TextStyle
(
fontSize:
20
.
sp
,
color:
Color
.
fromRGBO
(
246
,
158
,
11
,
1.0
),),),
Text
(
"当前温度"
,
style:
TextStyle
(
fontSize:
15
.
sp
,
color:
Colors
.
grey
),),
],
),
),
Container
(
width:
100
.
w
,
height:
80
.
h
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
25
.
r
),
color:
Colors
.
white
,
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"22V"
,
style:
TextStyle
(
fontSize:
20
.
sp
,
color:
Color
.
fromRGBO
(
246
,
158
,
11
,
1.0
),),),
Text
(
"电压"
,
style:
TextStyle
(
fontSize:
15
.
sp
,
color:
Colors
.
grey
),),
],
),
),
Container
(
width:
100
.
w
,
height:
80
.
h
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
25
.
r
),
color:
Colors
.
white
,
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Text
(
"3.2A"
,
style:
TextStyle
(
fontSize:
20
.
sp
,
color:
Color
.
fromRGBO
(
246
,
158
,
11
,
1.0
),),),
Text
(
"电流"
,
style:
TextStyle
(
fontSize:
15
.
sp
,
color:
Colors
.
grey
),),
],
),
)
],
),
),
// 操作行
Container
(
width:
double
.
infinity
,
// height: 100.h,
margin:
EdgeInsets
.
only
(
top:
10
.
h
),
decoration:
BoxDecoration
(
border:
BoxBorder
.
all
(
color:
Color
.
fromRGBO
(
246
,
158
,
11
,
1.0
),
width:
1
.
w
,
),
),
child:
Flex
(
direction:
Axis
.
horizontal
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Icon
(
Icons
.
warning
,
size:
15
.
sp
,
color:
Color
.
fromRGBO
(
246
,
158
,
11
,
1.0
),),
Expanded
(
child:
Text
(
"已等待2h37m 紧急"
,
style:
TextStyle
(
fontSize:
15
.
sp
,
color:
Color
.
fromRGBO
(
246
,
158
,
11
,
1.0
)),),),
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
ElevatedButton
(
style:
ElevatedButton
.
styleFrom
(
backgroundColor:
Color
.
fromRGBO
(
246
,
158
,
11
,
1.0
),
minimumSize:
Size
(
100
.
w
,
55
.
h
),
padding:
EdgeInsets
.
zero
,
alignment:
Alignment
.
center
,
visualDensity:
VisualDensity
.
compact
,
tapTargetSize:
MaterialTapTargetSize
.
shrinkWrap
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
10
.
r
),
),
),
onPressed:
()
{
print
(
"立即处理"
);
},
child:
Text
(
"立即处理"
,
style:
TextStyle
(
fontSize:
14
.
sp
,
color:
Colors
.
white
),),
),
SizedBox
(
width:
8
.
w
),
ElevatedButton
(
style:
ElevatedButton
.
styleFrom
(
backgroundColor:
Color
.
fromRGBO
(
51
,
65
,
85
,
1
),
minimumSize:
Size
(
80
.
w
,
55
.
h
),
padding:
EdgeInsets
.
zero
,
alignment:
Alignment
.
center
,
visualDensity:
VisualDensity
.
compact
,
tapTargetSize:
MaterialTapTargetSize
.
shrinkWrap
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
10
.
r
),
),
),
onPressed:
()
{
print
(
"派工"
);
},
child:
Text
(
"派工"
,
style:
TextStyle
(
fontSize:
14
.
sp
,
color:
Colors
.
white
),),
),
],
)
],
),
),
],
),
);
}
}
\ No newline at end of file
lib/views/home/index/child/voltage_operate_block.dart
0 → 100644
View file @
dc39b305
import
'package:flutter/material.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
class
VoltageOperateBlock
extends
StatefulWidget
{
const
VoltageOperateBlock
({
super
.
key
});
@override
State
<
VoltageOperateBlock
>
createState
()
=>
_VoltageOperateBlockState
();
}
class
_VoltageOperateBlockState
extends
State
<
VoltageOperateBlock
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
width:
double
.
infinity
,
// height: 280.h,
margin:
EdgeInsets
.
only
(
top:
10
.
h
,
left:
20
.
w
,
right:
20
.
w
),
padding:
EdgeInsets
.
all
(
20
.
w
),
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
25
.
r
),
color:
Color
.
fromRGBO
(
30
,
41
,
59
,
1
),
border:
BoxBorder
.
all
(
color:
Color
.
fromRGBO
(
246
,
158
,
11
,
1.0
),
width:
1
.
w
,
),
),
child:
Column
(
children:
[
// 描述信息
Container
(
width:
double
.
infinity
,
// height: 100.h,
margin:
EdgeInsets
.
only
(
bottom:
10
.
h
),
decoration:
BoxDecoration
(
border:
BoxBorder
.
all
(
color:
Color
.
fromRGBO
(
246
,
158
,
11
,
1.0
),
width:
1
.
w
,
),
),
child:
Flex
(
direction:
Axis
.
horizontal
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Container
(
width:
50
.
w
,
height:
50
.
h
,
decoration:
BoxDecoration
(
borderRadius:
BorderRadius
.
circular
(
10
.
r
),
color:
Colors
.
white
,
),
child:
Icon
(
Icons
.
warning
),
),
Expanded
(
child:
Container
(
width:
50
.
w
,
padding:
EdgeInsets
.
only
(
left:
10
.
w
),
child:
Column
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
"电压波动告警"
,
style:
TextStyle
(
fontSize:
20
.
sp
,
color:
Color
.
fromRGBO
(
246
,
158
,
11
,
1.0
),),),
Text
(
"客房301 A-301 智能空开"
,
style:
TextStyle
(
fontSize:
15
.
sp
,
color:
Colors
.
grey
),),
],
),
),
),
Text
(
"中警"
,
style:
TextStyle
(
fontSize:
15
.
sp
,
color:
Color
.
fromRGBO
(
246
,
158
,
11
,
1.0
)),)
],
)
),
// 数据行
Container
(
width:
double
.
infinity
,
decoration:
BoxDecoration
(
color:
Color
.
fromRGBO
(
24
,
33
,
47
,
1.0
),
borderRadius:
BorderRadius
.
circular
(
25
.
r
),
border:
BoxBorder
.
all
(
color:
Color
.
fromRGBO
(
246
,
158
,
11
,
1.0
),
width:
1
.
w
,
),
),
child:
Text
(
"电压220V(正常《235V) 已等待1h20m"
,
style:
TextStyle
(
fontSize:
15
.
sp
,
color:
Colors
.
grey
),)
),
// 操作行
Container
(
width:
double
.
infinity
,
// height: 100.h,
margin:
EdgeInsets
.
only
(
top:
10
.
h
),
decoration:
BoxDecoration
(
border:
BoxBorder
.
all
(
color:
Color
.
fromRGBO
(
246
,
158
,
11
,
1.0
),
width:
1
.
w
,
),
),
child:
Flex
(
direction:
Axis
.
horizontal
,
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
ElevatedButton
(
style:
ElevatedButton
.
styleFrom
(
backgroundColor:
Color
.
fromRGBO
(
246
,
158
,
11
,
1.0
),
minimumSize:
Size
(
330
.
w
,
55
.
h
),
padding:
EdgeInsets
.
zero
,
alignment:
Alignment
.
center
,
visualDensity:
VisualDensity
.
compact
,
tapTargetSize:
MaterialTapTargetSize
.
shrinkWrap
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
10
.
r
),
),
),
onPressed:
()
{
print
(
"确认处理"
);
},
child:
Text
(
"确认处理"
,
style:
TextStyle
(
fontSize:
14
.
sp
,
color:
Colors
.
white
),),
),
SizedBox
(
width:
8
.
w
),
ElevatedButton
(
style:
ElevatedButton
.
styleFrom
(
backgroundColor:
Color
.
fromRGBO
(
51
,
65
,
85
,
1
),
minimumSize:
Size
(
330
.
w
,
55
.
h
),
padding:
EdgeInsets
.
zero
,
alignment:
Alignment
.
center
,
visualDensity:
VisualDensity
.
compact
,
tapTargetSize:
MaterialTapTargetSize
.
shrinkWrap
,
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
10
.
r
),
),
),
onPressed:
()
{
print
(
"查看详情"
);
},
child:
Text
(
"查看详情"
,
style:
TextStyle
(
fontSize:
14
.
sp
,
color:
Colors
.
white
),),
),
],
),
),
],
),
);
}
}
\ No newline at end of file
lib/views/home/index/controller.dart
0 → 100644
View file @
dc39b305
// 处理index相关逻辑
class
HomeIndexController
{
}
\ No newline at end of file
lib/views/home/index/index_view.dart
0 → 100644
View file @
dc39b305
import
'dart:math'
;
import
'package:auto_route/auto_route.dart'
;
import
'package:flutter/material.dart'
;
import
'package:smart_hotel_app/routes/app_router.gr.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
import
'package:smart_hotel_app/views/home/index/child/equipment_list_block.dart'
;
import
'package:smart_hotel_app/views/home/index/child/task_head_block.dart'
;
import
'package:smart_hotel_app/views/home/index/child/task_total_block.dart'
;
import
'package:smart_hotel_app/views/home/index/child/temperature_block.dart'
;
import
'package:smart_hotel_app/views/home/index/child/voltage_operate_block.dart'
;
@RoutePage
()
class
HomeView
extends
StatefulWidget
{
const
HomeView
({
super
.
key
});
@override
State
<
HomeView
>
createState
()
=>
_HomeViewState
();
}
class
_HomeViewState
extends
State
<
HomeView
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
LayoutBuilder
(
builder:
(
context
,
constraints
)
{
return
SingleChildScrollView
(
child:
ConstrainedBox
(
constraints:
BoxConstraints
(
minHeight:
constraints
.
maxHeight
,
),
child:
Container
(
width:
double
.
infinity
,
color:
Color
.
fromRGBO
(
15
,
23
,
42
,
1
),
child:
const
Column
(
children:
[
TaskHeadBlock
(),
TaskTotalBlock
(),
TemperatureBlock
(),
VoltageOperateBlock
(),
EquipmentListBlock
(),
],
),
),
)
);
},
);
}
}
lib/views/home/index_view.dart
deleted
100644 → 0
View file @
3b5ba7b4
import
'dart:math'
;
import
'package:auto_route/auto_route.dart'
;
import
'package:flutter/material.dart'
;
import
'package:smart_hotel_app/routes/app_router.gr.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
@RoutePage
()
class
HomeView
extends
StatefulWidget
{
const
HomeView
({
super
.
key
});
@override
State
<
HomeView
>
createState
()
=>
_HomeViewState
();
}
class
_HomeViewState
extends
State
<
HomeView
>
{
@override
Widget
build
(
BuildContext
context
)
{
return
CustomScrollView
(
slivers:
[
// SliverToBoxAdapter(
// child: Container(
// height: ScreenUtil().statusBarHeight,
// width: double.infinity,
// color: Colors.red,
// ),
// ),
// banner区域
SliverToBoxAdapter
(
child:
Stack
(
children:
[
Container
(
width:
double
.
infinity
,
height:
748
.
h
,
decoration:
BoxDecoration
(
border:
Border
.
all
(
width:
1
.
w
,
color:
Colors
.
red
),
color:
Colors
.
yellow
,
borderRadius:
BorderRadius
.
only
(
bottomLeft:
Radius
.
circular
(
20
),
bottomRight:
Radius
.
circular
(
20
)),
gradient:
LinearGradient
(
stops:
[
0.65
,
1.0
],
begin:
Alignment
.
topCenter
,
end:
Alignment
.
bottomCenter
,
colors:
[
Color
(
0xFF0B392F
),
Color
(
0x000B392F
)])),
),
Container
(
width:
double
.
infinity
,
height:
748
.
h
,
padding:
EdgeInsets
.
only
(
left:
23
.
w
,
right:
23
.
w
),
decoration:
BoxDecoration
(
border:
Border
.
all
(
width:
1
.
w
,
color:
Colors
.
yellow
)),
child:
Column
(
children:
[
SizedBox
(
height:
ScreenUtil
().
statusBarHeight
,
),
Container
(
width:
double
.
infinity
,
alignment:
Alignment
.
centerLeft
,
padding:
EdgeInsets
.
only
(
top:
23
.
h
),
decoration:
BoxDecoration
(
border:
Border
.
all
(
width:
1
.
w
,
color:
Colors
.
red
)),
child:
Image
.
asset
(
"lib/assets/scp_logo.png"
,
width:
304
.
w
,
height:
54
.
h
,
),
),
Flex
(
direction:
Axis
.
horizontal
,
crossAxisAlignment:
CrossAxisAlignment
.
center
,
children:
[
Expanded
(
flex:
4
,
child:
Container
(
// width: 238.w,
height:
45
.
h
,
decoration:
BoxDecoration
(
border:
Border
.
all
(
width:
1
.
w
,
color:
Colors
.
red
)),
child:
Row
(
children:
[
Icon
(
Icons
.
shop
),
SizedBox
(
width:
2
.
w
,
),
Text
(
"xxxx"
,
style:
TextStyle
(
color:
Color
(
0xFFFFFFFF
),
fontSize:
32
.
sp
),
),
SizedBox
(
width:
5
.
w
,
),
Icon
(
Icons
.
arrow_right_rounded
)
]),
)),
Expanded
(
flex:
6
,
child:
GestureDetector
(
onTap:
()
{
print
(
"点击搜索"
);
context
.
router
.
push
(
SearchRoute
(
searchKey:
"hahaha"
));
},
child:
Container
(
// width: 440.w,
height:
68
.
h
,
padding:
EdgeInsets
.
only
(
left:
20
.
w
),
decoration:
BoxDecoration
(
border:
Border
.
all
(
width:
1
.
w
,
color:
Colors
.
blue
),
borderRadius:
BorderRadius
.
all
(
Radius
.
circular
(
36
)),
color:
Color
(
0xCCFFFFFF
),
),
child:
Row
(
children:
[
Icon
(
Icons
.
search
),
Text
(
"搜索"
)]),
)),
)
],
)
],
))
],
),
)
],
);
}
}
pubspec.lock
View file @
dc39b305
...
@@ -265,6 +265,14 @@ packages:
...
@@ -265,6 +265,14 @@ packages:
url: "https://pub.dev"
url: "https://pub.dev"
source: hosted
source: hosted
version: "1.1.1"
version: "1.1.1"
fl_chart:
dependency: "direct main"
description:
name: fl_chart
sha256: b938f77d042cbcd822936a7a359a7235bad8bd72070de1f827efc2cc297ac888
url: "https://pub.dev"
source: hosted
version: "1.2.0"
flutter:
flutter:
dependency: "direct main"
dependency: "direct main"
description: flutter
description: flutter
...
...
pubspec.yaml
View file @
dc39b305
...
@@ -43,6 +43,7 @@ dependencies:
...
@@ -43,6 +43,7 @@ dependencies:
flutter_screenutil
:
^5.9.3
flutter_screenutil
:
^5.9.3
fluttertoast
:
^8.2.5
fluttertoast
:
^8.2.5
loading_animation_widget
:
^1.3.0
loading_animation_widget
:
^1.3.0
fl_chart
:
^1.2.0
dev_dependencies
:
dev_dependencies
:
flutter_test
:
flutter_test
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment