ts move
This commit is contained in:
parent
f1abe6572d
commit
4a93adf463
1 changed files with 54 additions and 0 deletions
|
@ -13,6 +13,60 @@ class TransactionPage extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text(transaction.item),
|
||||||
|
actions: [
|
||||||
|
IconButton(
|
||||||
|
onPressed: () async {
|
||||||
|
final locations = await API().getLocations();
|
||||||
|
List<String> locationList = locations.keys.toList();
|
||||||
|
String? selectedLocationID;
|
||||||
|
|
||||||
|
await showDialog<int>(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return AlertDialog(
|
||||||
|
title: const Text('Select Location'),
|
||||||
|
content: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
DropdownButton<String>(
|
||||||
|
value: selectedLocationID,
|
||||||
|
onChanged: (value) {
|
||||||
|
selectedLocationID = value!;
|
||||||
|
},
|
||||||
|
items: locationList
|
||||||
|
.map<DropdownMenuItem<String>>((locationID) {
|
||||||
|
return DropdownMenuItem<String>(
|
||||||
|
value: locationID,
|
||||||
|
child: Text(locations[locationID]!.name),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
// todo : implement
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.qr_code))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
ElevatedButton(
|
||||||
|
onPressed: () async {
|
||||||
|
await API().moveTransaction(
|
||||||
|
transaction.uuid, selectedLocationID!);
|
||||||
|
Navigator.pop<int>(context);
|
||||||
|
},
|
||||||
|
child: const Text('Done'),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
icon: const Icon(Icons.move_up))
|
||||||
|
],
|
||||||
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
Text("UUID: ${transaction.uuid}"),
|
Text("UUID: ${transaction.uuid}"),
|
||||||
|
|
Loading…
Reference in a new issue