getPicker method
dynamic
getPicker(
- dynamic param,
- dynamic i,
- dynamic labelColor,
- dynamic backcolor,
Implementation
getPicker(param, i, labelColor, backcolor) {
myLogAll('getPicker');
dynamic dpid = param[gData][i];
bool isIcon = false;
if (param[gIsIcon] ?? false) {
isIcon = true;
}
bool isLabel = false;
if (param[gIsLabel] ?? false) {
isLabel = true;
}
List dataList = getDpDataSearch(dpid, isIcon, isLabel);
return CupertinoPicker(
scrollController:
FixedExtentScrollController(initialItem: param[gSelectedList][i]),
diameterRatio: 1.5,
offAxisFraction: 0.2, //轴偏离系数
//useMagnifier: false, //使用放大镜
magnification: 1.2, //当前选中item放大倍数
itemExtent: 30.0, //行高
squeeze: 1.2,
onSelectedItemChanged: (value) {
dpListDefaultIndex[param[gData][i]] = value;
/*_param[gRow] = i;
_param[gIndex] = value;
_param[gSelectedList][i] = value;
datamodel.sendRequestOne(
_param[gAction], _param, this._param[gContext] ?? context);*/
},
//children: datamodel.dpList[param[gData][i]].map((data) {
children: (dataList).map((data) {
if (data is Map) {
if (isNull(data[gValue])) {
isLabel = true;
} else {
isIcon = true;
}
}
return isLabel
? Text(data,
style: TextStyle(
fontWeight: (isNull(param[gIsBold]))
? param[gFontWeight]
: FontWeight.bold, //FontWeight.bold,
fontSize: getFontSize(param),
color: labelColor,
//backgroundColor: Colors.transparent
))
: isIcon
? Row(children: [
const SizedBox(
width: 5.0,
),
Expanded(child: MyLabel({gLabel: data[gLabel]}, backcolor)),
MyIcon(data),
/*Icon(
IconData(
getInt(data[gValue]),
fontFamily: 'MaterialIcons',
),
size: 36.0,
color: Colors.white),*/
const SizedBox(
width: 5.0,
)
])
: MyLabel({gLabel: getSCurrent(data)}, backcolor);
}).toList(),
);
}