add notes
This commit is contained in:
parent
35977e9a61
commit
4b9e616581
3 changed files with 25 additions and 3 deletions
|
@ -168,6 +168,12 @@ class TransactionCard extends StatelessWidget {
|
|||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
if ((t.note ?? "").isNotEmpty) ...[
|
||||
Text(t.note!),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
)
|
||||
],
|
||||
Row(
|
||||
children: [
|
||||
const Icon(Icons.money, size: 18, color: Colors.green),
|
||||
|
|
|
@ -18,12 +18,14 @@ class _SupplyPageState extends State<SupplyPage> {
|
|||
String _selectedOrigin = "";
|
||||
String _selectedLocation = "";
|
||||
late TextEditingController _priceController;
|
||||
late TextEditingController _noteController;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
variant = widget.item.variants.keys.first;
|
||||
_priceController = TextEditingController(text: "");
|
||||
_noteController = TextEditingController(text: "");
|
||||
}
|
||||
|
||||
void _supply() {
|
||||
|
@ -32,7 +34,7 @@ class _SupplyPageState extends State<SupplyPage> {
|
|||
|
||||
API()
|
||||
.supplyItem(widget.item.name, variant, "${_priceController.text} €",
|
||||
_selectedOrigin, _selectedLocation)
|
||||
_selectedOrigin, _selectedLocation, _noteController.text)
|
||||
.then((_) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(content: Text('Item added successfully!')),
|
||||
|
@ -174,6 +176,13 @@ class _SupplyPageState extends State<SupplyPage> {
|
|||
],
|
||||
),
|
||||
|
||||
// Note
|
||||
TextFormField(
|
||||
decoration: const InputDecoration(labelText: 'Note'),
|
||||
keyboardType: TextInputType.number,
|
||||
controller: _noteController,
|
||||
),
|
||||
|
||||
const SizedBox(height: 20),
|
||||
|
||||
// Submit Button
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue