'How can I add a number from one cell to another while also subtracting it from a third cell, based on information entered into a fourth cell?
I have a fund with a negative balance. I need to move transactions from it to others with positive balances.
I would like to input the new fund number and have the transaction amount both subtracted from the original fund and added to the new fund.
Here is an example—notice the two tabs at the bottom, "Transactions" and "Balances".
On line 2 of the "Transactions" tab, the amount of $3,774.72 is being moved from Fund 427 to 426. By typing "426" into cell C2, I would like the following to happen:
- The amount is added to Balances!B2
- The amount is subtracted from Balances!B3
This would repeat down the list.
Solution 1:[1]
I believe this may be because in the FutureBuilder you create the future by calling _setupCameras() within the build function. The FutureBuilder documentation explicitly states that the future must be initialized outside of the build function:
If the future is created at the same time as the FutureBuilder, then every time the FutureBuilder's parent is rebuilt, the asynchronous task will be restarted.
You can fix this by adding a field setupDone = _setupCameras() to the initState method of your widget, and then referring to that field in your FutureBuilder
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Bram |
