This commit is contained in:
JMARyA 2024-09-25 10:49:21 +02:00
parent 20bc5a9ae6
commit 3da48add7e
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
6 changed files with 98 additions and 87 deletions

View file

@ -3,6 +3,7 @@ import 'package:http/http.dart' as http;
import 'package:shared_preferences/shared_preferences.dart';
// todo : api errors
// todo : api caching
class API {
late SharedPreferences pref;

View file

@ -20,9 +20,11 @@ class _EndFlowWithProduceState extends State<EndFlowWithProduce> {
List<Widget> ret = [];
for (var i in widget.info.produces!) {
ret.add(ElevatedButton(onPressed: () {
ret.add(ElevatedButton(
onPressed: () {
// todo : implement adding
}, child: Text("Produced $i")));
},
child: Text("Produced $i")));
}
return ret;
@ -38,14 +40,20 @@ class _EndFlowWithProduceState extends State<EndFlowWithProduce> {
Widget build(BuildContext context) {
// todo : show end screen with produce
return Scaffold(
appBar: AppBar(title: Text("End ${widget.info.name} Flow"),),
body: Column(children: [
appBar: AppBar(
title: Text("End ${widget.info.name} Flow"),
),
body: Column(
children: [
...addProduceButtons(),
const Divider(),
// todo : add produced list
const SizedBox(height: 10,),
const SizedBox(
height: 10,
),
ElevatedButton(onPressed: _endFlow, child: const Text("End Flow"))
],),
],
),
);
}
}

View file

@ -40,7 +40,7 @@ class _ItemViewState extends State<ItemView> {
fallbackWidth: 100,
fallbackHeight: 100,
),
), // todo
),
const SizedBox(
width: 16.0,
),

View file

@ -180,8 +180,7 @@ class _SupplyPageState extends State<SupplyPage> {
TextFormField(
decoration: const InputDecoration(labelText: 'Note'),
controller: _noteController,
maxLines: 5
),
maxLines: 5),
const SizedBox(height: 20),

View file

@ -23,16 +23,16 @@ class _TransactionPageState extends State<TransactionPage> {
title: Text(widget.transaction.item),
actions: [
IconButton(
onPressed: () async {
final locations = await API().getLocations();
onPressed: () {
API().getLocations().then((locations) {
List<String> locationList = locations.keys.toList();
String? selectedLocationID;
await showDialog<int>(
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Select Location'),
title: const Text('Move Transaction'),
content: Row(
mainAxisSize: MainAxisSize.min,
children: [
@ -60,13 +60,15 @@ class _TransactionPageState extends State<TransactionPage> {
IconButton(
onPressed: () {
API().getLocations().then((locations) {
QrBarCodeScannerDialog().getScannedQrBarCode(
QrBarCodeScannerDialog()
.getScannedQrBarCode(
context: context,
onCode: (code) {
// library is retarded
code = code!.replaceFirst(
"Code scanned = ", "");
if (!locations.containsKey(code)) {
if (!locations
.containsKey(code)) {
ScaffoldMessenger.of(context)
.showSnackBar(
SnackBar(
@ -95,6 +97,7 @@ class _TransactionPageState extends State<TransactionPage> {
);
},
);
});
},
icon: const Icon(Icons.move_up))
],