This repository has been archived on 2023-11-18. You can view files and clone it, but cannot push or open issues or pull requests.
ha_client/lib/ui_class/ui.dart
2019-03-21 14:08:07 +02:00

34 lines
596 B
Dart

part of '../main.dart';
class HomeAssistantUI {
List<HAView> views;
String title;
bool get isEmpty => views == null || views.isEmpty;
HomeAssistantUI() {
views = [];
}
Widget build(BuildContext context, TabController tabController) {
return TabBarView(
controller: tabController,
children: _buildViews(context)
);
}
List<Widget> _buildViews(BuildContext context) {
List<Widget> result = [];
views.forEach((view) {
result.add(
view.build(context)
);
});
return result;
}
void clear() {
views.clear();
}
}