builderXEditDialog_BTNs method
XBtnbase
builderXEditDialog_BTNs(
- XFDataItem item,
- TextEditingController controller,
- String valueAndLabel,
- bool isSconto,
- void parentSetState(
- void ()
- XCol? xCol,
Builder dei bottoni cher verranno visualizzati nell'XEditDialog
Implementation
XBtnbase builderXEditDialog_BTNs(XFDataItem item, TextEditingController controller, String valueAndLabel, bool isSconto, void Function(void Function()) parentSetState, {XCol? xCol}) {
return XBtnbase(
padding: EdgeInsets.all(1),
width: 45 * XUtils.kforScale,
label_Style: XStyles.xStyTextForSubLabel(
textColor: valueAndLabel.contains("+")
? Colors.green
: valueAndLabel.contains("-") || valueAndLabel == ("C")
? Colors.red
: Colors.green),
label: valueAndLabel,
backGroundColor: Colors.grey[700],
onPressed: () {
if (valueAndLabel == "C") {
controller.text = "";
FocusScope.of(context).unfocus();
} else {
if (isSconto) {
parentSetState(() => controller.text += calcSconto(controller, valueAndLabel));
} else {
if (valueAndLabel.contains("-")) {
calcCell_Negative(xCol!, controller, int.parse(valueAndLabel.replaceFirst("-", "")));
} else {
calcCell_Positive(xCol!, controller, int.parse(valueAndLabel.replaceFirst("+", "")));
}
}
controller.selection = TextSelection(baseOffset: controller.text.length, extentOffset: controller.text.length);
}
});
}