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/entity_class/slider_entity.dart
2018-11-05 20:21:44 +02:00

40 lines
905 B
Dart

part of '../main.dart';
class SliderEntity extends Entity {
SliderEntity(Map rawData) : super(rawData);
double get minValue => _getDoubleAttributeValue("min") ?? 0.0;
double get maxValue =>_getDoubleAttributeValue("max") ?? 100.0;
double get valueStep => _getDoubleAttributeValue("step") ?? 1.0;
@override
Widget _buildStatePart(BuildContext context) {
return Expanded(
//width: 200.0,
child: Row(
children: <Widget>[
SliderStateWidget(
expanded: true,
),
SimpleEntityState(
expanded: false,
),
],
),
);
}
@override
Widget _buildStatePartForPage(BuildContext context) {
return SimpleEntityState(
expanded: false,
);
}
@override
Widget _buildAdditionalControlsForPage(BuildContext context) {
return SliderStateWidget(
expanded: false,
);
}
}