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