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, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
EntityIcon(), EntityIcon(),
Expanded(
Flexible(
fit: FlexFit.tight,
flex: 3,
child: EntityName(), child: EntityName(),
), ),
state state

View File

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

View File

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

View File

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

View File

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