addValidCheckWidget method
dynamic
addValidCheckWidget(
- dynamic param,
- dynamic context
Implementation
addValidCheckWidget(param, context) {
myLogAll('addValidCheckWidget');
getItemIcon(param, context);
//获得焦点时显示图标
List<Widget> result = [];
/*if (param[gTypeOwner] == gForm) {
result.add(MyLabel({
gLabel: getSCurrent(param[gItem][gLabel]) + gCommaStr,
gNeedi10n: false
}, param[gBackgroundColor]));
result.add(const SizedBox(width: 5.0));
}*/
if (param[gTypeOwner] == gForm) {
result.add(Expanded(child: param[gWidget]));
} else {
result.add(param[gWidget]);
}
if (param[gItem][gSuffixIcon] != null) {
result.add(param[gItem][gSuffixIcon]);
} else if (param[gTypeOwner] == gForm) {
result.add(const SizedBox(width: 50.0));
}
int widgetLength = result.length;
if (!isNull(param[gAlert]) && param[gTypeOwner] != gForm) {
widgetLength++;
}
if (widgetLength < 2) {
return param[gWidget];
}
if (param[gTypeOwner] != gForm) {
result[0] = Expanded(child: result[0]);
}
//return param[gWidget];
param[gWidget] = Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, children: result);
if (!isNull(param[gAlert]) &&
(param[gTypeOwner] == gForm || param[gIsLabel])) {
param[gWidget] = Column(children: [
param[gWidget],
MyLabel({
gLabel: param[gAlert],
gFontSize: _defaultFontSize,
gColorLabel: Colors.red
}, -1)
]);
}
if (!isNull(param[gItem][gBottomIcon]) && param[gTypeOwner] == gForm) {
param[gWidget] = addBorder(param[gWidget], null);
param[gWidget] = Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [param[gWidget], param[gItem][gBottomIcon]]);
}
return param[gWidget];
}