Entities card build optimization
This commit is contained in:
parent
50d3280803
commit
aee99e3925
@ -155,21 +155,26 @@ class CardWidget extends StatelessWidget {
|
|||||||
trailing: headerSwitch
|
trailing: headerSwitch
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
entitiesToShow.forEach((EntityWrapper entity) {
|
body.addAll(
|
||||||
body.add(
|
entitiesToShow.map((EntityWrapper entity) {
|
||||||
Padding(
|
return Padding(
|
||||||
padding: EdgeInsets.fromLTRB(0.0, 4.0, 0.0, 4.0),
|
padding: EdgeInsets.fromLTRB(0.0, 4.0, 0.0, 4.0),
|
||||||
child: EntityModel(
|
child: EntityModel(
|
||||||
entityWrapper: entity,
|
entityWrapper: entity,
|
||||||
handleTap: true,
|
handleTap: true,
|
||||||
child: entity.entity.buildDefaultWidget(context)
|
child: entity.entity.buildDefaultWidget(context)
|
||||||
),
|
),
|
||||||
));
|
);
|
||||||
});
|
})
|
||||||
|
);
|
||||||
return Card(
|
return Card(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.only(right: Sizes.rightWidgetPadding, left: Sizes.leftWidgetPadding),
|
padding: EdgeInsets.only(right: Sizes.rightWidgetPadding, left: Sizes.leftWidgetPadding),
|
||||||
child: Column(mainAxisSize: MainAxisSize.min, children: body),
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: body
|
||||||
|
),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user