fix: table view icon style

This commit is contained in:
Rongjian Zhang 2020-01-04 22:46:59 +08:00
parent b1181ffc6f
commit ffa3ef79d9
1 changed files with 19 additions and 24 deletions

View File

@ -63,28 +63,23 @@ class TableView extends StatelessWidget {
if (headerText != null) TableViewHeader(headerText), if (headerText != null) TableViewHeader(headerText),
CommonStyle.border, CommonStyle.border,
...join( ...join(
BorderView(leftPadding: _leftPadding), BorderView(leftPadding: _leftPadding),
items.map((item) { items.map((item) {
if (item == null) return null; if (item == null) return null;
var leftWidget = item.leftWidget; var leftWidget = item.leftWidget;
if (leftWidget == null && hasIcon) { if (leftWidget == null && hasIcon) {
leftWidget = Container( leftWidget = Icon(
width: 24, item.leftIconData,
height: 24, color: theme.palette.primary,
decoration: BoxDecoration( size: 20,
borderRadius: BorderRadius.circular(12), );
color: theme.palette.primary, }
),
child: Icon(
item.leftIconData,
color: theme.palette.background,
size: 14,
),
);
}
final widget = DefaultTextStyle( return Link(
onTap: item.onTap,
url: item.url,
child: DefaultTextStyle(
style: TextStyle(fontSize: 17, color: theme.palette.text), style: TextStyle(fontSize: 17, color: theme.palette.text),
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
child: Container( child: Container(
@ -116,10 +111,10 @@ class TableView extends StatelessWidget {
], ],
), ),
), ),
); ),
);
return Link(onTap: item.onTap, url: item.url, child: widget); }).toList(),
}).toList()), ),
CommonStyle.border, CommonStyle.border,
], ],
); );