Code structure
This commit is contained in:
22
lib/entity_widgets/state/simple_state.dart
Normal file
22
lib/entity_widgets/state/simple_state.dart
Normal file
@ -0,0 +1,22 @@
|
||||
part of '../../main.dart';
|
||||
|
||||
class SimpleEntityState extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final entityModel = EntityModel.of(context);
|
||||
return Padding(
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
0.0, 0.0, Entity.rightWidgetPadding, 0.0),
|
||||
child: GestureDetector(
|
||||
child: Text(
|
||||
"${entityModel.entity.state}${entityModel.entity.unitOfMeasurement}",
|
||||
textAlign: TextAlign.right,
|
||||
style: new TextStyle(
|
||||
fontSize: Entity.stateFontSize,
|
||||
)),
|
||||
onTap: () => entityModel.handleTap
|
||||
? eventBus.fire(new ShowEntityPageEvent(entityModel.entity))
|
||||
: null,
|
||||
));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user