WIP #183 Glance card ui improvements

This commit is contained in:
Yegor Vialov 2018-11-15 16:13:54 +02:00
parent 26187e6233
commit 37ad5e81cf
2 changed files with 15 additions and 6 deletions

View File

@ -3,8 +3,12 @@ part of '../main.dart';
class EntityName extends StatelessWidget {
final EdgeInsetsGeometry padding;
final TextOverflow textOverflow;
final bool wordsWrap;
final double fontSize;
final TextAlign textAlign;
const EntityName({Key key, this.padding: const EdgeInsets.only(right: 10.0)}) : super(key: key);
const EntityName({Key key, this.padding: const EdgeInsets.only(right: 10.0), this.textOverflow: TextOverflow.ellipsis, this.wordsWrap: true, this.fontSize: Sizes.nameFontSize, this.textAlign: TextAlign.left}) : super(key: key);
@override
Widget build(BuildContext context) {
@ -14,9 +18,10 @@ class EntityName extends StatelessWidget {
padding: padding,
child: Text(
"${entityModel.entity.displayName}",
overflow: TextOverflow.ellipsis,
softWrap: true,
style: TextStyle(fontSize: Sizes.nameFontSize),
overflow: textOverflow,
softWrap: wordsWrap,
style: TextStyle(fontSize: fontSize),
textAlign: textAlign,
),
),
onTap: () =>

View File

@ -13,7 +13,11 @@ class GlanceEntityContainer extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
EntityName(
padding: EdgeInsets.all(0.0),
padding: EdgeInsets.only(bottom: Sizes.rowPadding),
textOverflow: TextOverflow.ellipsis,
wordsWrap: false,
textAlign: TextAlign.center,
fontSize: Sizes.smallFontSize,
),
EntityIcon(
padding: EdgeInsets.all(0.0),
@ -22,7 +26,7 @@ class GlanceEntityContainer extends StatelessWidget {
SimpleEntityState(
textAlign: TextAlign.center,
expanded: false,
padding: EdgeInsets.all(0.0),
padding: EdgeInsets.only(top: Sizes.rowPadding),
)
],
);