Я хочу добавить, если пользователь проверяет checkBox, тогда он должен добавить amount=amount + 18%
, если нет, то единственное количество мой код
final amountController = TextEditingController();
Container(
height: 50.0,
padding: EdgeInsets.only(left: 8),
margin: EdgeInsets.only(top: 8),
decoration:
BoxDecoration(border: Border.all(color: Colors.grey[300], width: 1)),
child: TextFormField(
controller: amountController,
decoration: new InputDecoration(
border: InputBorder.none,
hintStyle: new TextStyle(color: Colors.grey[500]),
hintText: "Assesment Amount",
fillColor: Colors.transparent,
),
keyboardType: TextInputType.number,
),
);
// ======= код checkBox ============
Container(
child: Checkbox(
value: checkBoxValue,
onChanged: (value) {
setState(() {
checkBoxValue = value;
});
}),
);
// ======== Вставить код =========
else if (update == false && imageFile != null) {
setState(() {
name = titleController.text;
nameList.add(name);
amountList.add(amountController.text);
img.add(imageFile);
titleController.clear();
amountController.clear();
imageFile = null;
});
}