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
95546f15
Commit
95546f15
authored
Jun 05, 2026
by
张宏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
设备拓扑及相关样式调整
parent
3c72b94e
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
1043 additions
and
185 deletions
+1043
-185
app_router.dart
lib/routes/app_router.dart
+2
-0
app_router.gr.dart
lib/routes/app_router.gr.dart
+150
-128
inspection_device_view.dart
lib/views/home/inspection_device/inspection_device_view.dart
+21
-15
inspection_topology_cubit.dart
.../inspection_topology/cubit/inspection_topology_cubit.dart
+113
-0
inspection_topology_state.dart
.../inspection_topology/cubit/inspection_topology_state.dart
+62
-0
inspection_topology_view.dart
...ws/home/inspection_topology/inspection_topology_view.dart
+89
-0
device_detail_dialog.dart
...home/inspection_topology/widget/device_detail_dialog.dart
+235
-0
device_header_widget.dart
...home/inspection_topology/widget/device_header_widget.dart
+68
-0
network_topology_widget.dart
...e/inspection_topology/widget/network_topology_widget.dart
+181
-0
status_legend_widget.dart
...home/inspection_topology/widget/status_legend_widget.dart
+68
-0
index_view.dart
lib/views/service/index/index_view.dart
+6
-4
service_head_block.dart
lib/views/service/index/widget/service_head_block.dart
+48
-38
No files found.
lib/routes/app_router.dart
View file @
95546f15
...
...
@@ -2,6 +2,7 @@ import 'package:auto_route/auto_route.dart';
import
'package:smart_hotel_app/routes/app_router.gr.dart'
;
import
'package:smart_hotel_app/views/report/rule/rule_management_view.dart'
;
import
'package:smart_hotel_app/views/report/device/device_list_view.dart'
;
import
'package:smart_hotel_app/views/home/inspection_topology/inspection_topology_view.dart'
;
@AutoRouterConfig
(
replaceInRouteName:
'View,Route'
)
class
AppRouter
extends
$AppRouter
{
...
...
@@ -34,5 +35,6 @@ class AppRouter extends $AppRouter {
AutoRoute
(
page:
AbnormalListRoute
.
page
),
AutoRoute
(
page:
ReportRuleManagementRoute
.
page
),
AutoRoute
(
page:
ReportDeviceListRoute
.
page
),
AutoRoute
(
page:
InspectionTopologyRoute
.
page
),
];
}
lib/routes/app_router.gr.dart
View file @
95546f15
...
...
@@ -8,8 +8,8 @@
// coverage:ignore-file
// ignore_for_file: no_leading_underscores_for_library_prefixes
import
'package:auto_route/auto_route.dart'
as
_i2
0
;
import
'package:flutter/material.dart'
as
_i2
1
;
import
'package:auto_route/auto_route.dart'
as
_i2
1
;
import
'package:flutter/material.dart'
as
_i2
2
;
import
'package:smart_hotel_app/views/home/abnormal/abnormal_detail_view.dart'
as
_i1
;
import
'package:smart_hotel_app/views/home/abnormal_list/index_view.dart'
...
...
@@ -23,62 +23,64 @@ import 'package:smart_hotel_app/views/home/inspection_device/inspection_device_v
as
_i7
;
import
'package:smart_hotel_app/views/home/inspection_history/inspection_history_view.dart'
as
_i8
;
import
'package:smart_hotel_app/views/home/inspection_topology/inspection_topology_view.dart'
as
_i9
;
import
'package:smart_hotel_app/views/layout/default_view.dart'
as
_i3
;
import
'package:smart_hotel_app/views/login/login_view.dart'
as
_i
9
;
import
'package:smart_hotel_app/views/profile/index/index_view.dart'
as
_i1
0
;
import
'package:smart_hotel_app/views/login/login_view.dart'
as
_i
10
;
import
'package:smart_hotel_app/views/profile/index/index_view.dart'
as
_i1
1
;
import
'package:smart_hotel_app/views/report/device/device_list_view.dart'
as
_i11
;
import
'package:smart_hotel_app/views/report/energy/energy_detail_view.dart'
as
_i12
;
import
'package:smart_hotel_app/views/report/index/index_view.dart'
as
_i13
;
import
'package:smart_hotel_app/views/report/energy/energy_detail_view.dart'
as
_i13
;
import
'package:smart_hotel_app/views/report/index/index_view.dart'
as
_i14
;
import
'package:smart_hotel_app/views/report/room/room_detail_view.dart'
as
_i14
;
import
'package:smart_hotel_app/views/report/rule/rule_management_view.dart'
as
_i15
;
import
'package:smart_hotel_app/views/search/index_view.dart'
as
_i16
;
import
'package:smart_hotel_app/views/report/rule/rule_management_view.dart'
as
_i16
;
import
'package:smart_hotel_app/views/search/index_view.dart'
as
_i17
;
import
'package:smart_hotel_app/views/service/device/device_detail_view.dart'
as
_i1
7
;
import
'package:smart_hotel_app/views/service/index/index_view.dart'
as
_i1
8
;
as
_i1
8
;
import
'package:smart_hotel_app/views/service/index/index_view.dart'
as
_i1
9
;
import
'package:smart_hotel_app/views/service/room/room_detail_view.dart'
as
_i
19
;
as
_i
20
;
abstract
class
$
AppRouter
extends
_i2
0
.
RootStackRouter
{
abstract
class
$
AppRouter
extends
_i2
1
.
RootStackRouter
{
$AppRouter
({
super
.
navigatorKey
});
@override
final
Map
<
String
,
_i2
0
.
PageFactory
>
pagesMap
=
{
final
Map
<
String
,
_i2
1
.
PageFactory
>
pagesMap
=
{
AbnormalDetailRoute
.
name
:
(
routeData
)
{
return
_i2
0
.
AutoRoutePage
<
dynamic
>(
return
_i2
1
.
AutoRoutePage
<
dynamic
>(
routeData:
routeData
,
child:
const
_i1
.
AbnormalDetailView
(),
);
},
AbnormalListRoute
.
name
:
(
routeData
)
{
return
_i2
0
.
AutoRoutePage
<
dynamic
>(
return
_i2
1
.
AutoRoutePage
<
dynamic
>(
routeData:
routeData
,
child:
const
_i2
.
AbnormalListView
(),
);
},
DefaultLayoutRoute
.
name
:
(
routeData
)
{
return
_i2
0
.
AutoRoutePage
<
dynamic
>(
return
_i2
1
.
AutoRoutePage
<
dynamic
>(
routeData:
routeData
,
child:
const
_i3
.
DefaultLayoutView
(),
);
},
DeviceDetailRoute
.
name
:
(
routeData
)
{
return
_i2
0
.
AutoRoutePage
<
dynamic
>(
return
_i2
1
.
AutoRoutePage
<
dynamic
>(
routeData:
routeData
,
child:
const
_i4
.
DeviceDetailView
(),
);
},
HomeRoute
.
name
:
(
routeData
)
{
return
_i2
0
.
AutoRoutePage
<
dynamic
>(
return
_i2
1
.
AutoRoutePage
<
dynamic
>(
routeData:
routeData
,
child:
const
_i5
.
HomeView
(),
);
},
InspectionDetailRoute
.
name
:
(
routeData
)
{
return
_i2
0
.
AutoRoutePage
<
dynamic
>(
return
_i2
1
.
AutoRoutePage
<
dynamic
>(
routeData:
routeData
,
child:
const
_i6
.
InspectionDetailView
(),
);
...
...
@@ -88,7 +90,7 @@ abstract class $AppRouter extends _i20.RootStackRouter {
final
args
=
routeData
.
argsAs
<
InspectionDeviceRouteArgs
>(
orElse:
()
=>
InspectionDeviceRouteArgs
(
deviceId:
pathParams
.
getString
(
'deviceId'
)));
return
_i2
0
.
AutoRoutePage
<
dynamic
>(
return
_i2
1
.
AutoRoutePage
<
dynamic
>(
routeData:
routeData
,
child:
_i7
.
InspectionDeviceView
(
key:
args
.
key
,
...
...
@@ -101,7 +103,7 @@ abstract class $AppRouter extends _i20.RootStackRouter {
final
args
=
routeData
.
argsAs
<
InspectionHistoryRouteArgs
>(
orElse:
()
=>
InspectionHistoryRouteArgs
(
deviceId:
pathParams
.
getString
(
'deviceId'
)));
return
_i2
0
.
AutoRoutePage
<
dynamic
>(
return
_i2
1
.
AutoRoutePage
<
dynamic
>(
routeData:
routeData
,
child:
_i8
.
InspectionHistoryView
(
key:
args
.
key
,
...
...
@@ -109,79 +111,85 @@ abstract class $AppRouter extends _i20.RootStackRouter {
),
);
},
InspectionTopologyRoute
.
name
:
(
routeData
)
{
return
_i21
.
AutoRoutePage
<
dynamic
>(
routeData:
routeData
,
child:
const
_i9
.
InspectionTopologyView
(),
);
},
LoginRoute
.
name
:
(
routeData
)
{
final
args
=
routeData
.
argsAs
<
LoginRouteArgs
>(
orElse:
()
=>
const
LoginRouteArgs
());
return
_i2
0
.
AutoRoutePage
<
dynamic
>(
return
_i2
1
.
AutoRoutePage
<
dynamic
>(
routeData:
routeData
,
child:
_i
9
.
LoginView
(
key:
args
.
key
),
child:
_i
10
.
LoginView
(
key:
args
.
key
),
);
},
ProfileRoute
.
name
:
(
routeData
)
{
return
_i2
0
.
AutoRoutePage
<
dynamic
>(
return
_i2
1
.
AutoRoutePage
<
dynamic
>(
routeData:
routeData
,
child:
const
_i1
0
.
ProfileView
(),
child:
const
_i1
1
.
ProfileView
(),
);
},
ReportDeviceListRoute
.
name
:
(
routeData
)
{
return
_i2
0
.
AutoRoutePage
<
dynamic
>(
return
_i2
1
.
AutoRoutePage
<
dynamic
>(
routeData:
routeData
,
child:
const
_i1
1
.
ReportDeviceListView
(),
child:
const
_i1
2
.
ReportDeviceListView
(),
);
},
ReportEnergyDetailRoute
.
name
:
(
routeData
)
{
return
_i2
0
.
AutoRoutePage
<
dynamic
>(
return
_i2
1
.
AutoRoutePage
<
dynamic
>(
routeData:
routeData
,
child:
const
_i1
2
.
ReportEnergyDetailView
(),
child:
const
_i1
3
.
ReportEnergyDetailView
(),
);
},
ReportIndexRoute
.
name
:
(
routeData
)
{
return
_i2
0
.
AutoRoutePage
<
dynamic
>(
return
_i2
1
.
AutoRoutePage
<
dynamic
>(
routeData:
routeData
,
child:
const
_i1
3
.
ReportIndexView
(),
child:
const
_i1
4
.
ReportIndexView
(),
);
},
ReportRoomDetailRoute
.
name
:
(
routeData
)
{
return
_i2
0
.
AutoRoutePage
<
dynamic
>(
return
_i2
1
.
AutoRoutePage
<
dynamic
>(
routeData:
routeData
,
child:
const
_i1
4
.
ReportRoomDetailView
(),
child:
const
_i1
5
.
ReportRoomDetailView
(),
);
},
ReportRuleManagementRoute
.
name
:
(
routeData
)
{
return
_i2
0
.
AutoRoutePage
<
dynamic
>(
return
_i2
1
.
AutoRoutePage
<
dynamic
>(
routeData:
routeData
,
child:
const
_i1
5
.
ReportRuleManagementView
(),
child:
const
_i1
6
.
ReportRuleManagementView
(),
);
},
SearchRoute
.
name
:
(
routeData
)
{
final
args
=
routeData
.
argsAs
<
SearchRouteArgs
>(
orElse:
()
=>
const
SearchRouteArgs
());
return
_i2
0
.
AutoRoutePage
<
dynamic
>(
return
_i2
1
.
AutoRoutePage
<
dynamic
>(
routeData:
routeData
,
child:
_i1
6
.
SearchView
(
child:
_i1
7
.
SearchView
(
key:
args
.
key
,
searchKey:
args
.
searchKey
,
),
);
},
ServiceDeviceDetailRoute
.
name
:
(
routeData
)
{
return
_i2
0
.
AutoRoutePage
<
dynamic
>(
return
_i2
1
.
AutoRoutePage
<
dynamic
>(
routeData:
routeData
,
child:
const
_i1
7
.
ServiceDeviceDetailView
(),
child:
const
_i1
8
.
ServiceDeviceDetailView
(),
);
},
ServiceIndexRoute
.
name
:
(
routeData
)
{
return
_i2
0
.
AutoRoutePage
<
dynamic
>(
return
_i2
1
.
AutoRoutePage
<
dynamic
>(
routeData:
routeData
,
child:
const
_i1
8
.
ServiceIndexView
(),
child:
const
_i1
9
.
ServiceIndexView
(),
);
},
ServiceRoomDetailRoute
.
name
:
(
routeData
)
{
final
args
=
routeData
.
argsAs
<
ServiceRoomDetailRouteArgs
>(
orElse:
()
=>
const
ServiceRoomDetailRouteArgs
());
return
_i2
0
.
AutoRoutePage
<
dynamic
>(
return
_i2
1
.
AutoRoutePage
<
dynamic
>(
routeData:
routeData
,
child:
_i
19
.
ServiceRoomDetailView
(
child:
_i
20
.
ServiceRoomDetailView
(
key:
args
.
key
,
roomNumber:
args
.
roomNumber
,
),
...
...
@@ -192,8 +200,8 @@ abstract class $AppRouter extends _i20.RootStackRouter {
/// generated route for
/// [_i1.AbnormalDetailView]
class
AbnormalDetailRoute
extends
_i2
0
.
PageRouteInfo
<
void
>
{
const
AbnormalDetailRoute
({
List
<
_i2
0
.
PageRouteInfo
>?
children
})
class
AbnormalDetailRoute
extends
_i2
1
.
PageRouteInfo
<
void
>
{
const
AbnormalDetailRoute
({
List
<
_i2
1
.
PageRouteInfo
>?
children
})
:
super
(
AbnormalDetailRoute
.
name
,
initialChildren:
children
,
...
...
@@ -201,13 +209,13 @@ class AbnormalDetailRoute extends _i20.PageRouteInfo<void> {
static
const
String
name
=
'AbnormalDetailRoute'
;
static
const
_i2
0
.
PageInfo
<
void
>
page
=
_i20
.
PageInfo
<
void
>(
name
);
static
const
_i2
1
.
PageInfo
<
void
>
page
=
_i21
.
PageInfo
<
void
>(
name
);
}
/// generated route for
/// [_i2.AbnormalListView]
class
AbnormalListRoute
extends
_i2
0
.
PageRouteInfo
<
void
>
{
const
AbnormalListRoute
({
List
<
_i2
0
.
PageRouteInfo
>?
children
})
class
AbnormalListRoute
extends
_i2
1
.
PageRouteInfo
<
void
>
{
const
AbnormalListRoute
({
List
<
_i2
1
.
PageRouteInfo
>?
children
})
:
super
(
AbnormalListRoute
.
name
,
initialChildren:
children
,
...
...
@@ -215,13 +223,13 @@ class AbnormalListRoute extends _i20.PageRouteInfo<void> {
static
const
String
name
=
'AbnormalListRoute'
;
static
const
_i2
0
.
PageInfo
<
void
>
page
=
_i20
.
PageInfo
<
void
>(
name
);
static
const
_i2
1
.
PageInfo
<
void
>
page
=
_i21
.
PageInfo
<
void
>(
name
);
}
/// generated route for
/// [_i3.DefaultLayoutView]
class
DefaultLayoutRoute
extends
_i2
0
.
PageRouteInfo
<
void
>
{
const
DefaultLayoutRoute
({
List
<
_i2
0
.
PageRouteInfo
>?
children
})
class
DefaultLayoutRoute
extends
_i2
1
.
PageRouteInfo
<
void
>
{
const
DefaultLayoutRoute
({
List
<
_i2
1
.
PageRouteInfo
>?
children
})
:
super
(
DefaultLayoutRoute
.
name
,
initialChildren:
children
,
...
...
@@ -229,13 +237,13 @@ class DefaultLayoutRoute extends _i20.PageRouteInfo<void> {
static
const
String
name
=
'DefaultLayoutRoute'
;
static
const
_i2
0
.
PageInfo
<
void
>
page
=
_i20
.
PageInfo
<
void
>(
name
);
static
const
_i2
1
.
PageInfo
<
void
>
page
=
_i21
.
PageInfo
<
void
>(
name
);
}
/// generated route for
/// [_i4.DeviceDetailView]
class
DeviceDetailRoute
extends
_i2
0
.
PageRouteInfo
<
void
>
{
const
DeviceDetailRoute
({
List
<
_i2
0
.
PageRouteInfo
>?
children
})
class
DeviceDetailRoute
extends
_i2
1
.
PageRouteInfo
<
void
>
{
const
DeviceDetailRoute
({
List
<
_i2
1
.
PageRouteInfo
>?
children
})
:
super
(
DeviceDetailRoute
.
name
,
initialChildren:
children
,
...
...
@@ -243,13 +251,13 @@ class DeviceDetailRoute extends _i20.PageRouteInfo<void> {
static
const
String
name
=
'DeviceDetailRoute'
;
static
const
_i2
0
.
PageInfo
<
void
>
page
=
_i20
.
PageInfo
<
void
>(
name
);
static
const
_i2
1
.
PageInfo
<
void
>
page
=
_i21
.
PageInfo
<
void
>(
name
);
}
/// generated route for
/// [_i5.HomeView]
class
HomeRoute
extends
_i2
0
.
PageRouteInfo
<
void
>
{
const
HomeRoute
({
List
<
_i2
0
.
PageRouteInfo
>?
children
})
class
HomeRoute
extends
_i2
1
.
PageRouteInfo
<
void
>
{
const
HomeRoute
({
List
<
_i2
1
.
PageRouteInfo
>?
children
})
:
super
(
HomeRoute
.
name
,
initialChildren:
children
,
...
...
@@ -257,13 +265,13 @@ class HomeRoute extends _i20.PageRouteInfo<void> {
static
const
String
name
=
'HomeRoute'
;
static
const
_i2
0
.
PageInfo
<
void
>
page
=
_i20
.
PageInfo
<
void
>(
name
);
static
const
_i2
1
.
PageInfo
<
void
>
page
=
_i21
.
PageInfo
<
void
>(
name
);
}
/// generated route for
/// [_i6.InspectionDetailView]
class
InspectionDetailRoute
extends
_i2
0
.
PageRouteInfo
<
void
>
{
const
InspectionDetailRoute
({
List
<
_i2
0
.
PageRouteInfo
>?
children
})
class
InspectionDetailRoute
extends
_i2
1
.
PageRouteInfo
<
void
>
{
const
InspectionDetailRoute
({
List
<
_i2
1
.
PageRouteInfo
>?
children
})
:
super
(
InspectionDetailRoute
.
name
,
initialChildren:
children
,
...
...
@@ -271,17 +279,17 @@ class InspectionDetailRoute extends _i20.PageRouteInfo<void> {
static
const
String
name
=
'InspectionDetailRoute'
;
static
const
_i2
0
.
PageInfo
<
void
>
page
=
_i20
.
PageInfo
<
void
>(
name
);
static
const
_i2
1
.
PageInfo
<
void
>
page
=
_i21
.
PageInfo
<
void
>(
name
);
}
/// generated route for
/// [_i7.InspectionDeviceView]
class
InspectionDeviceRoute
extends
_i2
0
.
PageRouteInfo
<
InspectionDeviceRouteArgs
>
{
extends
_i2
1
.
PageRouteInfo
<
InspectionDeviceRouteArgs
>
{
InspectionDeviceRoute
({
_i2
1
.
Key
?
key
,
_i2
2
.
Key
?
key
,
required
String
deviceId
,
List
<
_i2
0
.
PageRouteInfo
>?
children
,
List
<
_i2
1
.
PageRouteInfo
>?
children
,
})
:
super
(
InspectionDeviceRoute
.
name
,
args:
InspectionDeviceRouteArgs
(
...
...
@@ -294,8 +302,8 @@ class InspectionDeviceRoute
static
const
String
name
=
'InspectionDeviceRoute'
;
static
const
_i2
0
.
PageInfo
<
InspectionDeviceRouteArgs
>
page
=
_i2
0
.
PageInfo
<
InspectionDeviceRouteArgs
>(
name
);
static
const
_i2
1
.
PageInfo
<
InspectionDeviceRouteArgs
>
page
=
_i2
1
.
PageInfo
<
InspectionDeviceRouteArgs
>(
name
);
}
class
InspectionDeviceRouteArgs
{
...
...
@@ -304,7 +312,7 @@ class InspectionDeviceRouteArgs {
required
this
.
deviceId
,
});
final
_i2
1
.
Key
?
key
;
final
_i2
2
.
Key
?
key
;
final
String
deviceId
;
...
...
@@ -317,11 +325,11 @@ class InspectionDeviceRouteArgs {
/// generated route for
/// [_i8.InspectionHistoryView]
class
InspectionHistoryRoute
extends
_i2
0
.
PageRouteInfo
<
InspectionHistoryRouteArgs
>
{
extends
_i2
1
.
PageRouteInfo
<
InspectionHistoryRouteArgs
>
{
InspectionHistoryRoute
({
_i2
1
.
Key
?
key
,
_i2
2
.
Key
?
key
,
required
String
deviceId
,
List
<
_i2
0
.
PageRouteInfo
>?
children
,
List
<
_i2
1
.
PageRouteInfo
>?
children
,
})
:
super
(
InspectionHistoryRoute
.
name
,
args:
InspectionHistoryRouteArgs
(
...
...
@@ -334,8 +342,8 @@ class InspectionHistoryRoute
static
const
String
name
=
'InspectionHistoryRoute'
;
static
const
_i2
0
.
PageInfo
<
InspectionHistoryRouteArgs
>
page
=
_i2
0
.
PageInfo
<
InspectionHistoryRouteArgs
>(
name
);
static
const
_i2
1
.
PageInfo
<
InspectionHistoryRouteArgs
>
page
=
_i2
1
.
PageInfo
<
InspectionHistoryRouteArgs
>(
name
);
}
class
InspectionHistoryRouteArgs
{
...
...
@@ -344,7 +352,7 @@ class InspectionHistoryRouteArgs {
required
this
.
deviceId
,
});
final
_i2
1
.
Key
?
key
;
final
_i2
2
.
Key
?
key
;
final
String
deviceId
;
...
...
@@ -355,11 +363,25 @@ class InspectionHistoryRouteArgs {
}
/// generated route for
/// [_i9.LoginView]
class
LoginRoute
extends
_i20
.
PageRouteInfo
<
LoginRouteArgs
>
{
/// [_i9.InspectionTopologyView]
class
InspectionTopologyRoute
extends
_i21
.
PageRouteInfo
<
void
>
{
const
InspectionTopologyRoute
({
List
<
_i21
.
PageRouteInfo
>?
children
})
:
super
(
InspectionTopologyRoute
.
name
,
initialChildren:
children
,
);
static
const
String
name
=
'InspectionTopologyRoute'
;
static
const
_i21
.
PageInfo
<
void
>
page
=
_i21
.
PageInfo
<
void
>(
name
);
}
/// generated route for
/// [_i10.LoginView]
class
LoginRoute
extends
_i21
.
PageRouteInfo
<
LoginRouteArgs
>
{
LoginRoute
({
_i2
1
.
Key
?
key
,
List
<
_i2
0
.
PageRouteInfo
>?
children
,
_i2
2
.
Key
?
key
,
List
<
_i2
1
.
PageRouteInfo
>?
children
,
})
:
super
(
LoginRoute
.
name
,
args:
LoginRouteArgs
(
key:
key
),
...
...
@@ -368,14 +390,14 @@ class LoginRoute extends _i20.PageRouteInfo<LoginRouteArgs> {
static
const
String
name
=
'LoginRoute'
;
static
const
_i2
0
.
PageInfo
<
LoginRouteArgs
>
page
=
_i2
0
.
PageInfo
<
LoginRouteArgs
>(
name
);
static
const
_i2
1
.
PageInfo
<
LoginRouteArgs
>
page
=
_i2
1
.
PageInfo
<
LoginRouteArgs
>(
name
);
}
class
LoginRouteArgs
{
const
LoginRouteArgs
({
this
.
key
});
final
_i2
1
.
Key
?
key
;
final
_i2
2
.
Key
?
key
;
@override
String
toString
()
{
...
...
@@ -384,9 +406,9 @@ class LoginRouteArgs {
}
/// generated route for
/// [_i1
0
.ProfileView]
class
ProfileRoute
extends
_i2
0
.
PageRouteInfo
<
void
>
{
const
ProfileRoute
({
List
<
_i2
0
.
PageRouteInfo
>?
children
})
/// [_i1
1
.ProfileView]
class
ProfileRoute
extends
_i2
1
.
PageRouteInfo
<
void
>
{
const
ProfileRoute
({
List
<
_i2
1
.
PageRouteInfo
>?
children
})
:
super
(
ProfileRoute
.
name
,
initialChildren:
children
,
...
...
@@ -394,13 +416,13 @@ class ProfileRoute extends _i20.PageRouteInfo<void> {
static
const
String
name
=
'ProfileRoute'
;
static
const
_i2
0
.
PageInfo
<
void
>
page
=
_i20
.
PageInfo
<
void
>(
name
);
static
const
_i2
1
.
PageInfo
<
void
>
page
=
_i21
.
PageInfo
<
void
>(
name
);
}
/// generated route for
/// [_i1
1
.ReportDeviceListView]
class
ReportDeviceListRoute
extends
_i2
0
.
PageRouteInfo
<
void
>
{
const
ReportDeviceListRoute
({
List
<
_i2
0
.
PageRouteInfo
>?
children
})
/// [_i1
2
.ReportDeviceListView]
class
ReportDeviceListRoute
extends
_i2
1
.
PageRouteInfo
<
void
>
{
const
ReportDeviceListRoute
({
List
<
_i2
1
.
PageRouteInfo
>?
children
})
:
super
(
ReportDeviceListRoute
.
name
,
initialChildren:
children
,
...
...
@@ -408,13 +430,13 @@ class ReportDeviceListRoute extends _i20.PageRouteInfo<void> {
static
const
String
name
=
'ReportDeviceListRoute'
;
static
const
_i2
0
.
PageInfo
<
void
>
page
=
_i20
.
PageInfo
<
void
>(
name
);
static
const
_i2
1
.
PageInfo
<
void
>
page
=
_i21
.
PageInfo
<
void
>(
name
);
}
/// generated route for
/// [_i1
2
.ReportEnergyDetailView]
class
ReportEnergyDetailRoute
extends
_i2
0
.
PageRouteInfo
<
void
>
{
const
ReportEnergyDetailRoute
({
List
<
_i2
0
.
PageRouteInfo
>?
children
})
/// [_i1
3
.ReportEnergyDetailView]
class
ReportEnergyDetailRoute
extends
_i2
1
.
PageRouteInfo
<
void
>
{
const
ReportEnergyDetailRoute
({
List
<
_i2
1
.
PageRouteInfo
>?
children
})
:
super
(
ReportEnergyDetailRoute
.
name
,
initialChildren:
children
,
...
...
@@ -422,13 +444,13 @@ class ReportEnergyDetailRoute extends _i20.PageRouteInfo<void> {
static
const
String
name
=
'ReportEnergyDetailRoute'
;
static
const
_i2
0
.
PageInfo
<
void
>
page
=
_i20
.
PageInfo
<
void
>(
name
);
static
const
_i2
1
.
PageInfo
<
void
>
page
=
_i21
.
PageInfo
<
void
>(
name
);
}
/// generated route for
/// [_i1
3
.ReportIndexView]
class
ReportIndexRoute
extends
_i2
0
.
PageRouteInfo
<
void
>
{
const
ReportIndexRoute
({
List
<
_i2
0
.
PageRouteInfo
>?
children
})
/// [_i1
4
.ReportIndexView]
class
ReportIndexRoute
extends
_i2
1
.
PageRouteInfo
<
void
>
{
const
ReportIndexRoute
({
List
<
_i2
1
.
PageRouteInfo
>?
children
})
:
super
(
ReportIndexRoute
.
name
,
initialChildren:
children
,
...
...
@@ -436,13 +458,13 @@ class ReportIndexRoute extends _i20.PageRouteInfo<void> {
static
const
String
name
=
'ReportIndexRoute'
;
static
const
_i2
0
.
PageInfo
<
void
>
page
=
_i20
.
PageInfo
<
void
>(
name
);
static
const
_i2
1
.
PageInfo
<
void
>
page
=
_i21
.
PageInfo
<
void
>(
name
);
}
/// generated route for
/// [_i1
4
.ReportRoomDetailView]
class
ReportRoomDetailRoute
extends
_i2
0
.
PageRouteInfo
<
void
>
{
const
ReportRoomDetailRoute
({
List
<
_i2
0
.
PageRouteInfo
>?
children
})
/// [_i1
5
.ReportRoomDetailView]
class
ReportRoomDetailRoute
extends
_i2
1
.
PageRouteInfo
<
void
>
{
const
ReportRoomDetailRoute
({
List
<
_i2
1
.
PageRouteInfo
>?
children
})
:
super
(
ReportRoomDetailRoute
.
name
,
initialChildren:
children
,
...
...
@@ -450,13 +472,13 @@ class ReportRoomDetailRoute extends _i20.PageRouteInfo<void> {
static
const
String
name
=
'ReportRoomDetailRoute'
;
static
const
_i2
0
.
PageInfo
<
void
>
page
=
_i20
.
PageInfo
<
void
>(
name
);
static
const
_i2
1
.
PageInfo
<
void
>
page
=
_i21
.
PageInfo
<
void
>(
name
);
}
/// generated route for
/// [_i1
5
.ReportRuleManagementView]
class
ReportRuleManagementRoute
extends
_i2
0
.
PageRouteInfo
<
void
>
{
const
ReportRuleManagementRoute
({
List
<
_i2
0
.
PageRouteInfo
>?
children
})
/// [_i1
6
.ReportRuleManagementView]
class
ReportRuleManagementRoute
extends
_i2
1
.
PageRouteInfo
<
void
>
{
const
ReportRuleManagementRoute
({
List
<
_i2
1
.
PageRouteInfo
>?
children
})
:
super
(
ReportRuleManagementRoute
.
name
,
initialChildren:
children
,
...
...
@@ -464,16 +486,16 @@ class ReportRuleManagementRoute extends _i20.PageRouteInfo<void> {
static
const
String
name
=
'ReportRuleManagementRoute'
;
static
const
_i2
0
.
PageInfo
<
void
>
page
=
_i20
.
PageInfo
<
void
>(
name
);
static
const
_i2
1
.
PageInfo
<
void
>
page
=
_i21
.
PageInfo
<
void
>(
name
);
}
/// generated route for
/// [_i1
6
.SearchView]
class
SearchRoute
extends
_i2
0
.
PageRouteInfo
<
SearchRouteArgs
>
{
/// [_i1
7
.SearchView]
class
SearchRoute
extends
_i2
1
.
PageRouteInfo
<
SearchRouteArgs
>
{
SearchRoute
({
_i2
1
.
Key
?
key
,
_i2
2
.
Key
?
key
,
String
?
searchKey
,
List
<
_i2
0
.
PageRouteInfo
>?
children
,
List
<
_i2
1
.
PageRouteInfo
>?
children
,
})
:
super
(
SearchRoute
.
name
,
args:
SearchRouteArgs
(
...
...
@@ -485,8 +507,8 @@ class SearchRoute extends _i20.PageRouteInfo<SearchRouteArgs> {
static
const
String
name
=
'SearchRoute'
;
static
const
_i2
0
.
PageInfo
<
SearchRouteArgs
>
page
=
_i2
0
.
PageInfo
<
SearchRouteArgs
>(
name
);
static
const
_i2
1
.
PageInfo
<
SearchRouteArgs
>
page
=
_i2
1
.
PageInfo
<
SearchRouteArgs
>(
name
);
}
class
SearchRouteArgs
{
...
...
@@ -495,7 +517,7 @@ class SearchRouteArgs {
this
.
searchKey
,
});
final
_i2
1
.
Key
?
key
;
final
_i2
2
.
Key
?
key
;
final
String
?
searchKey
;
...
...
@@ -506,9 +528,9 @@ class SearchRouteArgs {
}
/// generated route for
/// [_i1
7
.ServiceDeviceDetailView]
class
ServiceDeviceDetailRoute
extends
_i2
0
.
PageRouteInfo
<
void
>
{
const
ServiceDeviceDetailRoute
({
List
<
_i2
0
.
PageRouteInfo
>?
children
})
/// [_i1
8
.ServiceDeviceDetailView]
class
ServiceDeviceDetailRoute
extends
_i2
1
.
PageRouteInfo
<
void
>
{
const
ServiceDeviceDetailRoute
({
List
<
_i2
1
.
PageRouteInfo
>?
children
})
:
super
(
ServiceDeviceDetailRoute
.
name
,
initialChildren:
children
,
...
...
@@ -516,13 +538,13 @@ class ServiceDeviceDetailRoute extends _i20.PageRouteInfo<void> {
static
const
String
name
=
'ServiceDeviceDetailRoute'
;
static
const
_i2
0
.
PageInfo
<
void
>
page
=
_i20
.
PageInfo
<
void
>(
name
);
static
const
_i2
1
.
PageInfo
<
void
>
page
=
_i21
.
PageInfo
<
void
>(
name
);
}
/// generated route for
/// [_i1
8
.ServiceIndexView]
class
ServiceIndexRoute
extends
_i2
0
.
PageRouteInfo
<
void
>
{
const
ServiceIndexRoute
({
List
<
_i2
0
.
PageRouteInfo
>?
children
})
/// [_i1
9
.ServiceIndexView]
class
ServiceIndexRoute
extends
_i2
1
.
PageRouteInfo
<
void
>
{
const
ServiceIndexRoute
({
List
<
_i2
1
.
PageRouteInfo
>?
children
})
:
super
(
ServiceIndexRoute
.
name
,
initialChildren:
children
,
...
...
@@ -530,17 +552,17 @@ class ServiceIndexRoute extends _i20.PageRouteInfo<void> {
static
const
String
name
=
'ServiceIndexRoute'
;
static
const
_i2
0
.
PageInfo
<
void
>
page
=
_i20
.
PageInfo
<
void
>(
name
);
static
const
_i2
1
.
PageInfo
<
void
>
page
=
_i21
.
PageInfo
<
void
>(
name
);
}
/// generated route for
/// [_i
19
.ServiceRoomDetailView]
/// [_i
20
.ServiceRoomDetailView]
class
ServiceRoomDetailRoute
extends
_i2
0
.
PageRouteInfo
<
ServiceRoomDetailRouteArgs
>
{
extends
_i2
1
.
PageRouteInfo
<
ServiceRoomDetailRouteArgs
>
{
ServiceRoomDetailRoute
({
_i2
1
.
Key
?
key
,
_i2
2
.
Key
?
key
,
String
?
roomNumber
,
List
<
_i2
0
.
PageRouteInfo
>?
children
,
List
<
_i2
1
.
PageRouteInfo
>?
children
,
})
:
super
(
ServiceRoomDetailRoute
.
name
,
args:
ServiceRoomDetailRouteArgs
(
...
...
@@ -552,8 +574,8 @@ class ServiceRoomDetailRoute
static
const
String
name
=
'ServiceRoomDetailRoute'
;
static
const
_i2
0
.
PageInfo
<
ServiceRoomDetailRouteArgs
>
page
=
_i2
0
.
PageInfo
<
ServiceRoomDetailRouteArgs
>(
name
);
static
const
_i2
1
.
PageInfo
<
ServiceRoomDetailRouteArgs
>
page
=
_i2
1
.
PageInfo
<
ServiceRoomDetailRouteArgs
>(
name
);
}
class
ServiceRoomDetailRouteArgs
{
...
...
@@ -562,7 +584,7 @@ class ServiceRoomDetailRouteArgs {
this
.
roomNumber
,
});
final
_i2
1
.
Key
?
key
;
final
_i2
2
.
Key
?
key
;
final
String
?
roomNumber
;
...
...
lib/views/home/inspection_device/inspection_device_view.dart
View file @
95546f15
...
...
@@ -2,6 +2,7 @@ import 'package:auto_route/auto_route.dart';
import
'package:flutter/material.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
import
'package:smart_hotel_app/routes/app_router.gr.dart'
;
import
'cubit/inspection_device_cubit.dart'
;
import
'cubit/inspection_device_state.dart'
;
import
'widget/device_overview_card.dart'
;
...
...
@@ -31,24 +32,29 @@ class InspectionDeviceView extends StatelessWidget {
context
.
popRoute
();
},
),
title:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
center
,
children:
[
Text
(
'设备拓扑图'
,
style:
TextStyle
(
title:
GestureDetector
(
onTap:
()
{
context
.
pushRoute
(
const
InspectionTopologyRoute
());
},
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
end
,
children:
[
Text
(
'设备拓扑图'
,
style:
TextStyle
(
color:
const
Color
.
fromRGBO
(
100
,
116
,
139
,
1
),
fontSize:
32
.
sp
,
fontWeight:
FontWeight
.
w200
,
),
),
Icon
(
Icons
.
arrow_forward
,
color:
const
Color
.
fromRGBO
(
100
,
116
,
139
,
1
),
fontSize:
32
.
sp
,
fontWeight:
FontWeight
.
w200
,
),
),
// Icon(
// Icons.arrow_forward,
// color: const Color.fromRGBO(100, 116, 139, 1),
// ),
],
],
),
),
centerTitle:
tru
e
,
centerTitle:
fals
e
,
),
body:
SingleChildScrollView
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
28
.
w
,
vertical:
20
.
h
),
...
...
lib/views/home/inspection_topology/cubit/inspection_topology_cubit.dart
0 → 100644
View file @
95546f15
import
'package:flutter/material.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'inspection_topology_state.dart'
;
class
InspectionTopologyCubit
extends
Cubit
<
InspectionTopologyState
>
{
InspectionTopologyCubit
()
:
super
(
const
InspectionTopologyState
(
deviceName:
''
,
deviceModel:
''
,
topologyNodes:
[],
))
{
_loadTopologyData
();
}
void
selectNode
(
TopologyNode
?
node
)
{
emit
(
state
.
copyWith
(
selectedNode:
node
));
}
void
_loadTopologyData
()
{
final
rootNode
=
TopologyNode
(
id:
'1'
,
name:
'智能空开'
,
status:
'online'
,
x:
0.5
,
y:
0.15
,
children:
[
TopologyNode
(
id:
'2'
,
name:
'串口分配器'
,
status:
'online'
,
x:
0.25
,
y:
0.45
,
children:
[
TopologyNode
(
id:
'5'
,
name:
'环境采集'
,
status:
'online'
,
x:
0.15
,
y:
0.75
,
children:
[],
),
TopologyNode
(
id:
'6'
,
name:
'人体存在'
,
status:
'online'
,
x:
0.35
,
y:
0.75
,
children:
[],
),
],
),
TopologyNode
(
id:
'3'
,
name:
'网关'
,
status:
'online'
,
x:
0.5
,
y:
0.45
,
children:
[
TopologyNode
(
id:
'7'
,
name:
'环境采集'
,
status:
'online'
,
x:
0.45
,
y:
0.75
,
children:
[],
),
TopologyNode
(
id:
'8'
,
name:
'人体存在'
,
status:
'online'
,
x:
0.55
,
y:
0.75
,
children:
[],
),
],
),
TopologyNode
(
id:
'4'
,
name:
'WIFI'
,
status:
'online'
,
x:
0.75
,
y:
0.45
,
children:
[
TopologyNode
(
id:
'9'
,
name:
'环境采集'
,
status:
'online'
,
x:
0.65
,
y:
0.75
,
children:
[],
),
TopologyNode
(
id:
'10'
,
name:
'人体存在'
,
status:
'online'
,
x:
0.85
,
y:
0.75
,
children:
[],
),
],
),
],
);
emit
(
InspectionTopologyState
(
deviceName:
'客房305 智能空开'
,
deviceModel:
'A-301智能空开·客房301'
,
topologyNodes:
[
rootNode
],
deviceCount:
10
,
connectionCount:
11
,
));
}
}
lib/views/home/inspection_topology/cubit/inspection_topology_state.dart
0 → 100644
View file @
95546f15
import
'package:flutter/material.dart'
;
import
'package:equatable/equatable.dart'
;
class
InspectionTopologyState
extends
Equatable
{
final
String
deviceName
;
final
String
deviceModel
;
final
List
<
TopologyNode
>
topologyNodes
;
final
int
deviceCount
;
final
int
connectionCount
;
final
TopologyNode
?
selectedNode
;
const
InspectionTopologyState
({
required
this
.
deviceName
,
required
this
.
deviceModel
,
required
this
.
topologyNodes
,
this
.
deviceCount
=
10
,
this
.
connectionCount
=
11
,
this
.
selectedNode
,
});
InspectionTopologyState
copyWith
({
String
?
deviceName
,
String
?
deviceModel
,
List
<
TopologyNode
>?
topologyNodes
,
int
?
deviceCount
,
int
?
connectionCount
,
TopologyNode
?
selectedNode
,
})
{
return
InspectionTopologyState
(
deviceName:
deviceName
??
this
.
deviceName
,
deviceModel:
deviceModel
??
this
.
deviceModel
,
topologyNodes:
topologyNodes
??
this
.
topologyNodes
,
deviceCount:
deviceCount
??
this
.
deviceCount
,
connectionCount:
connectionCount
??
this
.
connectionCount
,
selectedNode:
selectedNode
,
);
}
@override
List
<
Object
?>
get
props
=>
[
deviceName
,
deviceModel
,
topologyNodes
,
deviceCount
,
connectionCount
,
selectedNode
];
}
class
TopologyNode
extends
Equatable
{
final
String
id
;
final
String
name
;
final
String
status
;
final
List
<
TopologyNode
>
children
;
final
double
x
;
final
double
y
;
const
TopologyNode
({
required
this
.
id
,
required
this
.
name
,
required
this
.
status
,
required
this
.
children
,
required
this
.
x
,
required
this
.
y
,
});
@override
List
<
Object
?>
get
props
=>
[
id
,
name
,
status
,
children
,
x
,
y
];
}
lib/views/home/inspection_topology/inspection_topology_view.dart
0 → 100644
View file @
95546f15
import
'package:auto_route/auto_route.dart'
;
import
'package:flutter/material.dart'
;
import
'package:flutter_bloc/flutter_bloc.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
import
'cubit/inspection_topology_cubit.dart'
;
import
'cubit/inspection_topology_state.dart'
;
import
'widget/device_header_widget.dart'
;
import
'widget/status_legend_widget.dart'
;
import
'widget/network_topology_widget.dart'
;
import
'widget/device_detail_dialog.dart'
;
@RoutePage
()
class
InspectionTopologyView
extends
StatelessWidget
{
const
InspectionTopologyView
({
super
.
key
});
@override
Widget
build
(
BuildContext
context
)
{
return
BlocProvider
(
create:
(
_
)
=>
InspectionTopologyCubit
(),
child:
const
InspectionTopologyPage
(),
);
}
}
class
InspectionTopologyPage
extends
StatelessWidget
{
const
InspectionTopologyPage
({
super
.
key
});
@override
Widget
build
(
BuildContext
context
)
{
return
Scaffold
(
backgroundColor:
const
Color
.
fromRGBO
(
242
,
243
,
245
,
1
),
appBar:
AppBar
(
backgroundColor:
Colors
.
white
,
elevation:
0
,
leading:
IconButton
(
icon:
const
Icon
(
Icons
.
arrow_back_ios
,
color:
Color
.
fromRGBO
(
100
,
116
,
139
,
1
)),
onPressed:
()
{
context
.
popRoute
();
},
),
title:
Text
(
'设备拓扑'
,
style:
TextStyle
(
color:
const
Color
.
fromRGBO
(
15
,
23
,
42
,
1
),
fontSize:
32
.
sp
,
fontWeight:
FontWeight
.
w600
,
),
),
centerTitle:
true
,
),
body:
BlocBuilder
<
InspectionTopologyCubit
,
InspectionTopologyState
>(
builder:
(
context
,
state
)
{
return
Stack
(
children:
[
SingleChildScrollView
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
28
.
w
,
vertical:
24
.
h
),
child:
Column
(
children:
[
SizedBox
(
height:
10
.
h
),
StatusLegendWidget
(),
SizedBox
(
height:
20
.
h
),
DeviceHeaderWidget
(
deviceName:
state
.
deviceName
,
deviceModel:
state
.
deviceModel
,
),
NetworkTopologyWidget
(
topologyNodes:
state
.
topologyNodes
,
deviceCount:
state
.
deviceCount
,
connectionCount:
state
.
connectionCount
,
onNodeTap:
(
node
)
=>
context
.
read
<
InspectionTopologyCubit
>().
selectNode
(
node
),
),
],
),
),
if
(
state
.
selectedNode
!=
null
)
DeviceDetailDialog
(
node:
state
.
selectedNode
!,
onClose:
()
=>
context
.
read
<
InspectionTopologyCubit
>().
selectNode
(
null
),
),
],
);
},
),
);
}
}
lib/views/home/inspection_topology/widget/device_detail_dialog.dart
0 → 100644
View file @
95546f15
import
'package:flutter/material.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
import
'../cubit/inspection_topology_state.dart'
;
class
DeviceDetailDialog
extends
StatelessWidget
{
final
TopologyNode
node
;
final
VoidCallback
onClose
;
const
DeviceDetailDialog
({
super
.
key
,
required
this
.
node
,
required
this
.
onClose
,
});
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
color:
Colors
.
transparent
,
child:
Stack
(
children:
[
Positioned
.
fill
(
child:
GestureDetector
(
onTap:
onClose
,
child:
Container
(
color:
Colors
.
black
.
withOpacity
(
0.5
),
),
),
),
Positioned
(
left:
0
,
right:
0
,
bottom:
0
,
child:
Container
(
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
48
.
r
),
topRight:
Radius
.
circular
(
48
.
r
),
),
),
child:
SafeArea
(
top:
false
,
child:
Column
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Container
(
margin:
EdgeInsets
.
only
(
top:
20
.
h
),
width:
120
.
w
,
height:
8
.
h
,
decoration:
BoxDecoration
(
color:
const
Color
.
fromRGBO
(
203
,
213
,
225
,
1
),
borderRadius:
BorderRadius
.
circular
(
4
.
r
),
),
),
Padding
(
padding:
EdgeInsets
.
all
(
48
.
w
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Row
(
children:
[
Container
(
width:
80
.
w
,
height:
80
.
h
,
decoration:
BoxDecoration
(
color:
const
Color
.
fromRGBO
(
239
,
246
,
255
,
1
),
borderRadius:
BorderRadius
.
circular
(
20
.
r
),
),
child:
Icon
(
_getDeviceIcon
(
node
.
name
),
size:
80
.
sp
,
color:
const
Color
.
fromRGBO
(
59
,
130
,
246
,
1
),
),
),
SizedBox
(
width:
32
.
w
),
Expanded
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
_getDeviceFullName
(
node
.
name
),
style:
TextStyle
(
fontSize:
28
.
sp
,
fontWeight:
FontWeight
.
w600
,
color:
const
Color
.
fromRGBO
(
15
,
23
,
42
,
1
),
),
),
SizedBox
(
height:
12
.
h
),
Text
(
'传感器'
,
style:
TextStyle
(
fontSize:
24
.
sp
,
color:
const
Color
.
fromRGBO
(
148
,
163
,
184
,
1
),
),
),
],
),
),
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
24
.
w
,
vertical:
12
.
h
,
),
decoration:
BoxDecoration
(
color:
const
Color
.
fromRGBO
(
209
,
250
,
229
,
1
),
borderRadius:
BorderRadius
.
circular
(
40
.
r
),
),
child:
Text
(
'正常'
,
style:
TextStyle
(
fontSize:
24
.
sp
,
fontWeight:
FontWeight
.
w500
,
color:
const
Color
.
fromRGBO
(
16
,
185
,
129
,
1
),
),
),
),
],
),
SizedBox
(
height:
48
.
h
),
Container
(
width:
double
.
infinity
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
32
.
w
,
vertical:
32
.
h
,
),
decoration:
BoxDecoration
(
color:
const
Color
.
fromRGBO
(
241
,
245
,
249
,
1
),
borderRadius:
BorderRadius
.
circular
(
32
.
r
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
'设备ID'
,
style:
TextStyle
(
fontSize:
24
.
sp
,
color:
const
Color
.
fromRGBO
(
148
,
163
,
184
,
1
),
),
),
Text
(
'dev-
${node.id.padLeft(3, '0')}
'
,
style:
TextStyle
(
fontSize:
24
.
sp
,
fontWeight:
FontWeight
.
w500
,
color:
const
Color
.
fromRGBO
(
15
,
23
,
42
,
1
),
),
),
],
),
SizedBox
(
height:
32
.
h
),
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
'连接方式'
,
style:
TextStyle
(
fontSize:
24
.
sp
,
color:
const
Color
.
fromRGBO
(
148
,
163
,
184
,
1
),
),
),
Text
(
'自动检测'
,
style:
TextStyle
(
fontSize:
24
.
sp
,
fontWeight:
FontWeight
.
w500
,
color:
const
Color
.
fromRGBO
(
15
,
23
,
42
,
1
),
),
),
],
),
],
),
),
SizedBox
(
height:
48
.
h
),
SizedBox
(
width:
double
.
infinity
,
height:
104
.
h
,
child:
ElevatedButton
(
onPressed:
()
{},
style:
ElevatedButton
.
styleFrom
(
backgroundColor:
const
Color
.
fromRGBO
(
59
,
130
,
246
,
1
),
shape:
RoundedRectangleBorder
(
borderRadius:
BorderRadius
.
circular
(
40
.
r
),
),
),
child:
Text
(
'查看详情'
,
style:
TextStyle
(
fontSize:
40
.
sp
,
color:
Colors
.
white
,
fontWeight:
FontWeight
.
w500
,
),
),
),
),
],
),
),
],
),
),
),
),
],
),
);
}
IconData
_getDeviceIcon
(
String
name
)
{
if
(
name
.
contains
(
'环境'
)
||
name
.
contains
(
'温湿'
))
{
return
Icons
.
thermostat
;
}
else
if
(
name
.
contains
(
'人体'
))
{
return
Icons
.
person_search
;
}
else
if
(
name
.
contains
(
'空开'
))
{
return
Icons
.
power
;
}
else
if
(
name
.
contains
(
'网关'
))
{
return
Icons
.
router
;
}
else
if
(
name
.
contains
(
'WIFI'
))
{
return
Icons
.
wifi
;
}
else
if
(
name
.
contains
(
'串口'
))
{
return
Icons
.
usb
;
}
return
Icons
.
devices
;
}
String
_getDeviceFullName
(
String
name
)
{
if
(
name
==
'环境采集'
)
{
return
'温湿度传感器'
;
}
return
name
;
}
}
lib/views/home/inspection_topology/widget/device_header_widget.dart
0 → 100644
View file @
95546f15
import
'package:flutter/material.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
class
DeviceHeaderWidget
extends
StatelessWidget
{
final
String
deviceName
;
final
String
deviceModel
;
const
DeviceHeaderWidget
({
super
.
key
,
required
this
.
deviceName
,
required
this
.
deviceModel
,
});
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
24
.
w
,
vertical:
32
.
h
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
only
(
topLeft:
Radius
.
circular
(
24
.
r
),
topRight:
Radius
.
circular
(
24
.
r
),
),
),
child:
Row
(
children:
[
Container
(
width:
64
.
w
,
height:
64
.
h
,
decoration:
BoxDecoration
(
color:
const
Color
.
fromRGBO
(
219
,
234
,
254
,
1
),
borderRadius:
BorderRadius
.
circular
(
20
.
r
),
),
child:
Icon
(
Icons
.
power
,
size:
50
.
sp
,
color:
const
Color
.
fromRGBO
(
59
,
130
,
246
,
1
),
),
),
SizedBox
(
width:
24
.
w
),
Expanded
(
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
deviceName
,
style:
TextStyle
(
fontSize:
28
.
sp
,
fontWeight:
FontWeight
.
w600
,
color:
const
Color
.
fromRGBO
(
15
,
23
,
42
,
1
),
),
),
SizedBox
(
height:
12
.
h
),
Text
(
deviceModel
,
style:
TextStyle
(
fontSize:
24
.
sp
,
color:
const
Color
.
fromRGBO
(
100
,
116
,
139
,
1
),
),
),
],
),
),
],
),
);
}
}
lib/views/home/inspection_topology/widget/network_topology_widget.dart
0 → 100644
View file @
95546f15
import
'package:flutter/material.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
import
'../cubit/inspection_topology_state.dart'
;
class
NetworkTopologyWidget
extends
StatelessWidget
{
final
List
<
TopologyNode
>
topologyNodes
;
final
int
deviceCount
;
final
int
connectionCount
;
final
Function
(
TopologyNode
)
onNodeTap
;
const
NetworkTopologyWidget
({
super
.
key
,
required
this
.
topologyNodes
,
required
this
.
deviceCount
,
required
this
.
connectionCount
,
required
this
.
onNodeTap
,
});
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
24
.
w
,
vertical:
32
.
h
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
only
(
bottomLeft:
Radius
.
circular
(
24
.
r
),
bottomRight:
Radius
.
circular
(
24
.
r
),
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
'网络拓扑'
,
style:
TextStyle
(
fontSize:
28
.
sp
,
fontWeight:
FontWeight
.
w600
,
color:
const
Color
.
fromRGBO
(
15
,
23
,
42
,
1
),
),
),
Text
(
'共
$deviceCount
个设备,
$connectionCount
条连接'
,
style:
TextStyle
(
fontSize:
24
.
sp
,
color:
const
Color
.
fromRGBO
(
148
,
163
,
184
,
1
),
),
),
],
),
SizedBox
(
height:
32
.
h
),
SizedBox
(
width:
double
.
infinity
,
height:
800
.
h
,
child:
ClipRRect
(
borderRadius:
BorderRadius
.
circular
(
32
.
r
),
child:
Stack
(
children:
[
Container
(
width:
double
.
infinity
,
height:
double
.
infinity
,
color:
const
Color
.
fromRGBO
(
241
,
245
,
249
,
1
),
),
if
(
topologyNodes
.
isNotEmpty
)
CustomPaint
(
size:
Size
.
infinite
,
painter:
TopologyPainter
(
nodes:
topologyNodes
),
),
if
(
topologyNodes
.
isNotEmpty
)
LayoutBuilder
(
builder:
(
context
,
constraints
)
{
final
List
<
Widget
>
clickableNodes
=
[];
_collectNodes
(
topologyNodes
[
0
],
clickableNodes
,
constraints
.
maxWidth
,
constraints
.
maxHeight
,
);
return
Stack
(
children:
clickableNodes
);
},
),
],
),
),
),
],
),
);
}
void
_collectNodes
(
TopologyNode
node
,
List
<
Widget
>
nodes
,
double
maxWidth
,
double
maxHeight
,
)
{
final
centerX
=
maxWidth
*
node
.
x
;
final
centerY
=
maxHeight
*
node
.
y
;
final
nodeWidth
=
150
.
w
;
// final nodeHeight = node.name.length > 4 ? 160.h : 100.h;
final
nodeHeight
=
80
.
h
;
nodes
.
add
(
Positioned
(
left:
centerX
-
nodeWidth
/
2
,
top:
centerY
-
nodeHeight
/
2
,
width:
nodeWidth
,
height:
nodeHeight
,
child:
GestureDetector
(
onTap:
()
=>
onNodeTap
(
node
),
child:
Container
(
decoration:
BoxDecoration
(
color:
const
Color
.
fromRGBO
(
239
,
246
,
255
,
1
),
border:
Border
.
all
(
color:
const
Color
.
fromRGBO
(
59
,
130
,
246
,
1
),
width:
1
.
w
,
),
borderRadius:
BorderRadius
.
circular
(
60
.
r
),
),
child:
Center
(
child:
Text
(
node
.
name
,
style:
TextStyle
(
color:
const
Color
.
fromRGBO
(
71
,
85
,
105
,
1
),
fontSize:
24
.
sp
,
fontWeight:
FontWeight
.
w500
,
),
textAlign:
TextAlign
.
center
,
),
),
),
),
),
);
for
(
var
child
in
node
.
children
)
{
_collectNodes
(
child
,
nodes
,
maxWidth
,
maxHeight
);
}
}
}
class
TopologyPainter
extends
CustomPainter
{
final
List
<
TopologyNode
>
nodes
;
TopologyPainter
({
required
this
.
nodes
});
@override
void
paint
(
Canvas
canvas
,
Size
size
)
{
if
(
nodes
.
isEmpty
)
return
;
final
paint
=
Paint
()
..
color
=
const
Color
.
fromRGBO
(
203
,
213
,
225
,
1
)
..
strokeWidth
=
3
.
w
..
style
=
PaintingStyle
.
stroke
;
_drawConnections
(
canvas
,
size
,
nodes
[
0
],
paint
);
}
void
_drawConnections
(
Canvas
canvas
,
Size
size
,
TopologyNode
node
,
Paint
paint
)
{
final
centerX
=
size
.
width
*
node
.
x
;
final
centerY
=
size
.
height
*
node
.
y
;
for
(
var
child
in
node
.
children
)
{
final
childCenterX
=
size
.
width
*
child
.
x
;
final
childCenterY
=
size
.
height
*
child
.
y
;
canvas
.
drawLine
(
Offset
(
centerX
,
centerY
),
Offset
(
childCenterX
,
childCenterY
),
paint
,
);
_drawConnections
(
canvas
,
size
,
child
,
paint
);
}
}
@override
bool
shouldRepaint
(
covariant
CustomPainter
oldDelegate
)
=>
false
;
}
lib/views/home/inspection_topology/widget/status_legend_widget.dart
0 → 100644
View file @
95546f15
import
'package:flutter/material.dart'
;
import
'package:flutter_screenutil/flutter_screenutil.dart'
;
class
StatusLegendWidget
extends
StatelessWidget
{
const
StatusLegendWidget
({
super
.
key
});
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
width:
double
.
infinity
,
padding:
EdgeInsets
.
symmetric
(
horizontal:
24
.
w
,
vertical:
24
.
h
),
decoration:
BoxDecoration
(
color:
Colors
.
white
,
borderRadius:
BorderRadius
.
circular
(
16
.
r
),
),
child:
Column
(
crossAxisAlignment:
CrossAxisAlignment
.
start
,
children:
[
Text
(
'状态图例'
,
style:
TextStyle
(
fontSize:
28
.
sp
,
fontWeight:
FontWeight
.
w600
,
color:
const
Color
.
fromRGBO
(
15
,
23
,
42
,
1
),
),
),
SizedBox
(
height:
24
.
h
),
Wrap
(
spacing:
32
.
w
,
runSpacing:
20
.
h
,
children:
[
_buildLegendItem
(
const
Color
.
fromRGBO
(
59
,
130
,
246
,
1
),
'开启'
),
_buildLegendItem
(
const
Color
.
fromRGBO
(
226
,
232
,
240
,
1
),
'关闭'
),
_buildLegendItem
(
const
Color
.
fromRGBO
(
16
,
185
,
129
,
1
),
'在线'
),
_buildLegendItem
(
const
Color
.
fromRGBO
(
71
,
85
,
105
,
1
),
'离线'
),
_buildLegendItem
(
const
Color
.
fromRGBO
(
251
,
191
,
36
,
1
),
'告警'
),
_buildLegendItem
(
const
Color
.
fromRGBO
(
239
,
68
,
68
,
1
),
'故障'
),
],
),
],
),
);
}
Widget
_buildLegendItem
(
Color
color
,
String
label
)
{
return
Row
(
mainAxisSize:
MainAxisSize
.
min
,
children:
[
Container
(
width:
32
.
w
,
height:
32
.
h
,
decoration:
BoxDecoration
(
color:
color
,
shape:
BoxShape
.
circle
,
),
),
SizedBox
(
width:
12
.
w
),
Text
(
label
,
style:
TextStyle
(
fontSize:
24
.
sp
,
color:
const
Color
.
fromRGBO
(
71
,
85
,
105
,
1
),
),
),
],
);
}
}
lib/views/service/index/index_view.dart
View file @
95546f15
...
...
@@ -19,12 +19,14 @@ class ServiceIndexView extends StatelessWidget {
child:
LayoutBuilder
(
builder:
(
context
,
constraints
)
{
return
SingleChildScrollView
(
padding:
EdgeInsets
.
symmetric
(
horizontal:
28
.
w
),
child:
ConstrainedBox
(
constraints:
BoxConstraints
(
minHeight:
constraints
.
maxHeight
),
constraints:
BoxConstraints
(
minHeight:
constraints
.
maxHeight
,
),
child:
Container
(
// color: const Color.fromRGBO(242, 243, 245, 1),
color:
Color
.
fromRGBO
(
242
,
243
,
245
,
1.0
),
width:
double
.
infinity
,
color:
const
Color
.
fromRGBO
(
242
,
243
,
245
,
1
),
padding:
EdgeInsets
.
symmetric
(
horizontal:
28
.
w
),
child:
BlocBuilder
<
ServiceIndexCubit
,
ServiceIndexState
>(
builder:
(
context
,
state
)
{
return
Column
(
...
...
lib/views/service/index/widget/service_head_block.dart
View file @
95546f15
...
...
@@ -6,48 +6,58 @@ class ServiceHeadBlock extends StatelessWidget {
@override
Widget
build
(
BuildContext
context
)
{
return
Container
(
width:
double
.
infinity
,
height:
150
.
h
,
padding:
EdgeInsets
.
only
(
top:
ScreenUtil
().
statusBarHeight
,
left:
20
.
w
,
right:
20
.
w
),
decoration:
BoxDecoration
(
// borderRadius: BorderRadius.circular(20.r),
color:
Colors
.
white
,
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
'客房服务看板'
,
style:
TextStyle
(
fontSize:
32
.
sp
,
fontWeight:
FontWeight
.
bold
,
color:
const
Color
.
fromRGBO
(
0
,
0
,
0
,
1
),
fontFamily:
'FZLTXH'
,
),
final
screenWidth
=
MediaQuery
.
of
(
context
).
size
.
width
;
return
Stack
(
clipBehavior:
Clip
.
none
,
children:
[
Positioned
(
left:
-
28
.
w
,
right:
-
28
.
w
,
top:
0
,
child:
Container
(
height:
150
.
h
,
color:
Colors
.
white
,
),
Container
(
width:
64
.
w
,
height:
64
.
w
,
decoration:
BoxDecoration
(
shape:
BoxShape
.
circle
,
border:
Border
.
all
(
color:
const
Color
.
fromRGBO
(
73
,
149
,
234
,
1
),
width:
1
.
w
,
),
Container
(
height:
150
.
h
,
padding:
EdgeInsets
.
only
(
top:
ScreenUtil
().
statusBarHeight
,
left:
20
.
w
,
right:
20
.
w
),
child:
Row
(
mainAxisAlignment:
MainAxisAlignment
.
spaceBetween
,
children:
[
Text
(
'客房服务看板'
,
style:
TextStyle
(
fontSize:
32
.
sp
,
fontWeight:
FontWeight
.
bold
,
color:
const
Color
.
fromRGBO
(
0
,
0
,
0
,
1
),
fontFamily:
'FZLTXH'
,
),
),
),
child:
CircleAvatar
(
radius:
40
.
w
,
backgroundColor:
Colors
.
white
,
child:
Icon
(
Icons
.
person
,
color:
const
Color
.
fromRGBO
(
73
,
149
,
234
,
1
),
size:
48
.
sp
,
Container
(
width:
64
.
w
,
height:
64
.
w
,
decoration:
BoxDecoration
(
shape:
BoxShape
.
circle
,
border:
Border
.
all
(
color:
const
Color
.
fromRGBO
(
73
,
149
,
234
,
1
),
width:
1
.
w
,
),
),
child:
CircleAvatar
(
radius:
40
.
w
,
backgroundColor:
Colors
.
white
,
child:
Icon
(
Icons
.
person
,
color:
const
Color
.
fromRGBO
(
73
,
149
,
234
,
1
),
size:
48
.
sp
,
),
),
),
)
,
]
,
),
]
,
)
,
)
,
]
,
);
}
}
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