Resolves #162 View names display
This commit is contained in:
@ -55,6 +55,42 @@ class HAView {
|
||||
cards.addAll(autoGeneratedCards);
|
||||
}
|
||||
|
||||
Widget buildTab() {
|
||||
if (linkedEntity == null) {
|
||||
if (iconName != null) {
|
||||
return
|
||||
Tab(
|
||||
icon:
|
||||
Icon(
|
||||
MaterialDesignIcons.createIconDataFromIconName(
|
||||
iconName ?? "mdi:home-assistant"),
|
||||
size: 24.0,
|
||||
)
|
||||
);
|
||||
} else {
|
||||
return
|
||||
Tab(
|
||||
text: name.toUpperCase(),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (linkedEntity.icon != null && linkedEntity.icon.length > 0) {
|
||||
return Tab(
|
||||
icon: Icon(
|
||||
MaterialDesignIcons.createIconDataFromIconName(
|
||||
linkedEntity.icon),
|
||||
size: 24.0,
|
||||
)
|
||||
);
|
||||
} else {
|
||||
return Tab(
|
||||
text: linkedEntity.displayName.toUpperCase(),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
return ViewWidget(
|
||||
view: this,
|
||||
|
Reference in New Issue
Block a user