Fix camera stream view navigation issue
This commit is contained in:
parent
915e8045a3
commit
1c461d2449
@ -17,6 +17,7 @@
|
|||||||
additional functionality it is fine to subclass or reimplement
|
additional functionality it is fine to subclass or reimplement
|
||||||
FlutterApplication and put your custom class here. -->
|
FlutterApplication and put your custom class here. -->
|
||||||
<application
|
<application
|
||||||
|
android:name="io.flutter.app.FlutterApplication"
|
||||||
android:label="HA Client"
|
android:label="HA Client"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
|
@ -33,7 +33,7 @@ class AlarmPanelCard extends StatelessWidget {
|
|||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
icon: Icon(MaterialDesignIcons.getIconDataFromIconName(
|
icon: Icon(MaterialDesignIcons.getIconDataFromIconName(
|
||||||
"mdi:dots-vertical")),
|
"mdi:dots-vertical")),
|
||||||
onPressed: () => eventBus.fire(new ShowEntityPageEvent(entity: card.entity.entity))
|
onPressed: () => eventBus.fire(new ShowEntityPageEvent(entityId: card.entity.entity.entityId))
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
|
@ -143,6 +143,6 @@ class BadgeWidget extends StatelessWidget {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
onTap: () =>
|
onTap: () =>
|
||||||
eventBus.fire(new ShowEntityPageEvent(entity: entityModel.entityWrapper.entity)));
|
eventBus.fire(new ShowEntityPageEvent(entityId: entityModel.entityWrapper.entity.entityId)));
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -138,8 +138,7 @@ class _CameraStreamViewState extends State<CameraStreamView> {
|
|||||||
iconSize: 40,
|
iconSize: 40,
|
||||||
color: Theme.of(context).accentColor,
|
color: Theme.of(context).accentColor,
|
||||||
onPressed: _isLoaded ? () {
|
onPressed: _isLoaded ? () {
|
||||||
eventBus.fire(ShowEntityPageEvent());
|
Navigator.of(context).pushReplacement(
|
||||||
Navigator.of(context).push(
|
|
||||||
MaterialPageRoute(
|
MaterialPageRoute(
|
||||||
builder: (conext) => FullScreenPage(
|
builder: (conext) => FullScreenPage(
|
||||||
child: EntityModel(
|
child: EntityModel(
|
||||||
@ -155,7 +154,7 @@ class _CameraStreamViewState extends State<CameraStreamView> {
|
|||||||
fullscreenDialog: true
|
fullscreenDialog: true
|
||||||
)
|
)
|
||||||
).then((_){
|
).then((_){
|
||||||
eventBus.fire(ShowEntityPageEvent(entity: _entity));
|
eventBus.fire(ShowEntityPageEvent(entityId: _entity.entityId));
|
||||||
});
|
});
|
||||||
} : null,
|
} : null,
|
||||||
)
|
)
|
||||||
|
@ -2,10 +2,9 @@ part of '../main.dart';
|
|||||||
|
|
||||||
class EntityPageLayout extends StatelessWidget {
|
class EntityPageLayout extends StatelessWidget {
|
||||||
|
|
||||||
final bool showClose;
|
|
||||||
final Entity entity;
|
final Entity entity;
|
||||||
|
|
||||||
EntityPageLayout({Key key, this.showClose: false, this.entity}) : super(key: key);
|
EntityPageLayout({Key key, this.entity}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -14,34 +13,6 @@ class EntityPageLayout extends StatelessWidget {
|
|||||||
child: ListView(
|
child: ListView(
|
||||||
padding: EdgeInsets.all(0),
|
padding: EdgeInsets.all(0),
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
showClose ?
|
|
||||||
Container(
|
|
||||||
color: Theme.of(context).primaryColor,
|
|
||||||
height: 40,
|
|
||||||
child: Row(
|
|
||||||
children: <Widget>[
|
|
||||||
Expanded(
|
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.only(left: 8),
|
|
||||||
child: Text(
|
|
||||||
entity.displayName,
|
|
||||||
style: Theme.of(context).primaryTextTheme.headline
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
IconButton(
|
|
||||||
padding: EdgeInsets.all(0),
|
|
||||||
icon: Icon(Icons.close),
|
|
||||||
color: Theme.of(context).primaryTextTheme.headline.color,
|
|
||||||
iconSize: 36.0,
|
|
||||||
onPressed: () {
|
|
||||||
eventBus.fire(ShowEntityPageEvent());
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
) :
|
|
||||||
Container(height: 0, width: 0,),
|
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.only(top: Sizes.rowPadding, left: Sizes.leftWidgetPadding),
|
padding: EdgeInsets.only(top: Sizes.rowPadding, left: Sizes.leftWidgetPadding),
|
||||||
child: DefaultEntityContainer(state: entity._buildStatePartForPage(context)),
|
child: DefaultEntityContainer(state: entity._buildStatePartForPage(context)),
|
||||||
|
@ -54,7 +54,7 @@ class EntityWrapper {
|
|||||||
|
|
||||||
case EntityUIAction.moreInfo: {
|
case EntityUIAction.moreInfo: {
|
||||||
eventBus.fire(
|
eventBus.fire(
|
||||||
new ShowEntityPageEvent(entity: entity));
|
new ShowEntityPageEvent(entityId: entity.entityId));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,7 +94,7 @@ class EntityWrapper {
|
|||||||
|
|
||||||
case EntityUIAction.moreInfo: {
|
case EntityUIAction.moreInfo: {
|
||||||
eventBus.fire(
|
eventBus.fire(
|
||||||
new ShowEntityPageEvent(entity: entity));
|
new ShowEntityPageEvent(entityId: entity.entityId));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,7 +134,7 @@ class EntityWrapper {
|
|||||||
|
|
||||||
case EntityUIAction.moreInfo: {
|
case EntityUIAction.moreInfo: {
|
||||||
eventBus.fire(
|
eventBus.fire(
|
||||||
new ShowEntityPageEvent(entity: entity));
|
new ShowEntityPageEvent(entityId: entity.entityId));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ class MediaPlayerPlaybackControls extends StatelessWidget {
|
|||||||
IconButton(
|
IconButton(
|
||||||
icon: Icon(MaterialDesignIcons.getIconDataFromIconName(
|
icon: Icon(MaterialDesignIcons.getIconDataFromIconName(
|
||||||
"mdi:dots-vertical")),
|
"mdi:dots-vertical")),
|
||||||
onPressed: () => eventBus.fire(new ShowEntityPageEvent(entity: entity))
|
onPressed: () => eventBus.fire(new ShowEntityPageEvent(entityId: entity.entityId))
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
} else if (entity.supportStop && entity.state != EntityState.off && entity.state != EntityState.unavailable) {
|
} else if (entity.supportStop && entity.state != EntityState.off && entity.state != EntityState.unavailable) {
|
||||||
|
@ -211,7 +211,7 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver, Ticker
|
|||||||
if (_showEntityPageSubscription == null) {
|
if (_showEntityPageSubscription == null) {
|
||||||
_showEntityPageSubscription =
|
_showEntityPageSubscription =
|
||||||
eventBus.on<ShowEntityPageEvent>().listen((event) {
|
eventBus.on<ShowEntityPageEvent>().listen((event) {
|
||||||
_showEntityPage(event.entity?.entityId);
|
_showEntityPage(event.entityId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ class _PlayMediaPageState extends State<PlayMediaPage> {
|
|||||||
);
|
);
|
||||||
HomeAssistant().sendFromPlayerId = null;
|
HomeAssistant().sendFromPlayerId = null;
|
||||||
}
|
}
|
||||||
eventBus.fire(ShowEntityPageEvent(entity: entity));
|
eventBus.fire(ShowEntityPageEvent(entityId: entity.entityId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,9 +77,9 @@ class ShowPopupMessageEvent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class ShowEntityPageEvent {
|
class ShowEntityPageEvent {
|
||||||
final Entity entity;
|
final String entityId;
|
||||||
|
|
||||||
ShowEntityPageEvent({this.entity});
|
ShowEntityPageEvent({@required this.entityId});
|
||||||
}
|
}
|
||||||
|
|
||||||
class ShowPageEvent {
|
class ShowPageEvent {
|
||||||
|
Reference in New Issue
Block a user