getTipProgram method
dynamic
getTipProgram(
- dynamic context,
- dynamic data
Implementation
getTipProgram(context, data) {
myLogAll('getTipProgram');
var sWidth = MediaQuery.of(context).size.width;
//if (appParam['$gTip$gStatus'] == gSelect) {
List tableData = getTableData(gZzytip, context);
var sHeight = sWidth / (tableData.length + 2);
List icons = [];
for (int i = 0; i < tableData.length; i++) {
var tip = tableData[i][gTip];
//var tipLabel = appParam['$gTip$gParam'][gLabel];
var tipPercentage = toNumeric(tip) / 100.0;
var paramValue = 'getValueByCol($gAmount) $tipPercentage $tip%[tipLabel]';
icons.add(
getMoneyProgramKey(paramValue, sWidth, sHeight, gBackContext, gTip));
}
icons.add(
{
gLabel: "Manual enter",
gType: gLocalAction,
gActionid: gSetValueFocus,
gValue: gBackContext,
gInputType: gMoney,
gWidth: sWidth,
gHeight: sHeight,
'$gAfter$gBackContext': '$gTip$gStatus'
},
);
return [
{
gAction: "showProgram",
gData: [
{
gLabel: "Tip",
gActionid: "e0464c41-3bbe-4094-12",
gType: gCard,
gBody: [
{
gLabel: "getValueByCol($gAmount)",
gType: "process",
gActionid: "system",
gIcon: null,
gHeight: sHeight,
gFontSize: '38.0',
gFontWeight: FontWeight.bold,
gBackgroundColor: Colors.grey.shade200,
gDetail: []
},
{
gLabel: 'Select tips',
gType: "process",
gActionid: "system",
gIcon: null,
gHeight: 25.0,
gBackgroundColor: Colors.grey.shade200,
gDetail: icons
},
]
}
]
}
];
// } else {
//return getMoneyProgram(context, gTip, '$gTip$gReset',data);
//}
}