Fix font sizes, long entity states

This commit is contained in:
Yegor Vialov 2018-11-18 16:40:12 +02:00
parent af84c99a2d
commit efbe33f4e3
5 changed files with 17 additions and 8 deletions

View File

@ -14,7 +14,10 @@ class DefaultEntityContainer extends StatelessWidget {
mainAxisSize: MainAxisSize.max,
children: <Widget>[
EntityIcon(),
Expanded(
Flexible(
fit: FlexFit.tight,
flex: 3,
child: EntityName(),
),
state

View File

@ -23,6 +23,7 @@ class _SelectStateWidgetState extends State<SelectStateWidget> {
if (entity.listOptions.isNotEmpty) {
ctrl = DropdownButton<String>(
value: entity.state,
isExpanded: true,
items: entity.listOptions.map((String value) {
return new DropdownMenuItem<String>(
value: value,
@ -36,7 +37,9 @@ class _SelectStateWidgetState extends State<SelectStateWidget> {
} else {
ctrl = Text('---');
}
return Expanded(
return Flexible(
flex: 2,
fit: FlexFit.tight,
//width: Entity.INPUT_WIDTH,
child: ctrl,
);

View File

@ -17,7 +17,7 @@ class SimpleEntityState extends StatelessWidget {
child: Text(
"${entityModel.entityWrapper.entity.state}${entityModel.entityWrapper.entity.unitOfMeasurement}",
textAlign: textAlign,
maxLines: 4,
maxLines: 10,
overflow: TextOverflow.ellipsis,
softWrap: true,
style: new TextStyle(
@ -68,8 +68,9 @@ class SimpleEntityState extends StatelessWidget {
)
);
if (expanded) {
return SizedBox(
width: MediaQuery.of(context).size.width * 0.3,
return Flexible(
fit: FlexFit.tight,
flex: 2,
child: result,
);
} else {

View File

@ -66,7 +66,9 @@ class _TextInputStateWidgetState extends State<TextInputStateWidget> {
_tmpValue = entity.state;
}
if (entity.isTextField || entity.isPasswordField) {
return Expanded(
return Flexible(
fit: FlexFit.tight,
flex: 2,
//width: Entity.INPUT_WIDTH,
child: TextField(
focusNode: _focusNode,

View File

@ -6,8 +6,8 @@ class Sizes {
static const extendedWidgetHeight = 50.0;
static const iconSize = 28.0;
static const largeIconSize = 34.0;
static const stateFontSize = 16.0;
static const nameFontSize = 16.0;
static const stateFontSize = 15.0;
static const nameFontSize = 15.0;
static const smallFontSize = 14.0;
static const largeFontSize = 24.0;
static const inputWidth = 160.0;