2019-09-14 19:07:21 +03:00
|
|
|
part of '../main.dart';
|
|
|
|
|
2019-09-14 19:53:39 +03:00
|
|
|
class EntityPageLayout extends StatelessWidget {
|
2019-09-14 19:07:21 +03:00
|
|
|
|
|
|
|
final bool showClose;
|
|
|
|
final Entity entity;
|
|
|
|
|
2019-09-14 19:37:52 +03:00
|
|
|
EntityPageLayout({Key key, this.showClose: false, this.entity}) : super(key: key);
|
|
|
|
|
2019-09-14 19:07:21 +03:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return EntityModel(
|
2019-09-14 19:53:39 +03:00
|
|
|
entityWrapper: EntityWrapper(entity: entity),
|
2019-09-14 19:07:21 +03:00
|
|
|
child: ListView(
|
|
|
|
padding: EdgeInsets.all(0),
|
|
|
|
children: <Widget>[
|
2019-09-14 19:53:39 +03:00
|
|
|
showClose ?
|
2019-09-14 19:07:21 +03:00
|
|
|
Container(
|
|
|
|
color: Colors.blue[300],
|
2019-10-28 19:59:47 +02:00
|
|
|
height: 40,
|
2019-09-14 19:07:21 +03:00
|
|
|
child: Row(
|
|
|
|
children: <Widget>[
|
|
|
|
Expanded(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.only(left: 8),
|
|
|
|
child: Text(
|
2019-09-14 19:53:39 +03:00
|
|
|
entity.displayName,
|
2019-09-14 19:07:21 +03:00
|
|
|
style: TextStyle(
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
color: Colors.white,
|
|
|
|
fontSize: 22
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
IconButton(
|
|
|
|
padding: EdgeInsets.all(0),
|
|
|
|
icon: Icon(Icons.close),
|
|
|
|
color: Colors.white,
|
2019-10-28 19:59:47 +02:00
|
|
|
iconSize: 36.0,
|
2019-09-14 19:07:21 +03:00
|
|
|
onPressed: () {
|
|
|
|
eventBus.fire(ShowEntityPageEvent());
|
|
|
|
},
|
|
|
|
)
|
|
|
|
],
|
|
|
|
),
|
|
|
|
) :
|
|
|
|
Container(height: 0, width: 0,),
|
|
|
|
Padding(
|
|
|
|
padding: EdgeInsets.only(top: Sizes.rowPadding, left: Sizes.leftWidgetPadding),
|
2019-09-14 19:53:39 +03:00
|
|
|
child: DefaultEntityContainer(state: entity._buildStatePartForPage(context)),
|
2019-09-14 19:07:21 +03:00
|
|
|
),
|
|
|
|
LastUpdatedWidget(),
|
|
|
|
Divider(),
|
2019-09-14 19:53:39 +03:00
|
|
|
entity._buildAdditionalControlsForPage(context),
|
2019-09-14 19:07:21 +03:00
|
|
|
Divider(),
|
2019-09-14 19:37:52 +03:00
|
|
|
SpoilerCard(
|
|
|
|
title: "State history",
|
|
|
|
body: EntityHistoryWidget(),
|
|
|
|
),
|
|
|
|
SpoilerCard(
|
|
|
|
title: "Attributes",
|
|
|
|
body: EntityAttributesList(),
|
|
|
|
),
|
2019-09-14 19:07:21 +03:00
|
|
|
]
|
|
|
|
),
|
|
|
|
handleTap: false,
|
|
|
|
);
|
|
|
|
}
|
2019-09-14 19:37:52 +03:00
|
|
|
}
|