mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-27 21:16:48 +00:00
* Handle error on unexpected barcode response * Add ManufacturerPart detail view * Support barcode scanning for manufacturer part * Refactoring for null checks * Ignore selected errors in sentry * Fix API implementation for ManufacturerPart * Update release notes * More error handling * Decode quantity betterer * Refactoring * Add option to confirm checkin details * Improve response handlign * Cleanup * Remove unused imports * Fix async function * Fix for assigning custom barcode * Handle barcode scan result for company * Fix * Adjust scan priority * Refactoring MODEL_TYPE - Use instead of duplicated const strings * @override fix
99 lines
3.2 KiB
Dart
99 lines
3.2 KiB
Dart
|
|
import "package:flutter/material.dart";
|
|
import "package:flutter_tabler_icons/flutter_tabler_icons.dart";
|
|
import "package:inventree/app_colors.dart";
|
|
|
|
import "package:inventree/l10.dart";
|
|
import "package:inventree/preferences.dart";
|
|
|
|
|
|
class InvenTreePurchaseOrderSettingsWidget extends StatefulWidget {
|
|
@override
|
|
_InvenTreePurchaseOrderSettingsState createState() => _InvenTreePurchaseOrderSettingsState();
|
|
}
|
|
|
|
|
|
class _InvenTreePurchaseOrderSettingsState extends State<InvenTreePurchaseOrderSettingsWidget> {
|
|
|
|
_InvenTreePurchaseOrderSettingsState();
|
|
|
|
bool poEnable = true;
|
|
bool poShowCamera = true;
|
|
bool poConfirmScan = true;
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
|
|
loadSettings();
|
|
}
|
|
|
|
Future<void> loadSettings() async {
|
|
poEnable = await InvenTreeSettingsManager().getBool(INV_PO_ENABLE, true);
|
|
poShowCamera = await InvenTreeSettingsManager().getBool(INV_PO_SHOW_CAMERA, true);
|
|
poConfirmScan = await InvenTreeSettingsManager().getBool(INV_PO_CONFIRM_SCAN, true);
|
|
|
|
if (mounted) {
|
|
setState(() {
|
|
});
|
|
}
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: Text(L10().purchaseOrderSettings),
|
|
backgroundColor: COLOR_APP_BAR,
|
|
),
|
|
body: Container(
|
|
child: ListView(
|
|
children: [
|
|
ListTile(
|
|
title: Text(L10().purchaseOrderEnable),
|
|
subtitle: Text(L10().purchaseOrderEnableDetail),
|
|
leading: Icon(TablerIcons.shopping_cart),
|
|
trailing: Switch(
|
|
value: poEnable,
|
|
onChanged: (bool value) {
|
|
InvenTreeSettingsManager().setValue(INV_PO_ENABLE, value);
|
|
setState(() {
|
|
poEnable = value;
|
|
});
|
|
},
|
|
),
|
|
),
|
|
ListTile(
|
|
title: Text(L10().purchaseOrderShowCamera),
|
|
subtitle: Text(L10().purchaseOrderShowCameraDetail),
|
|
leading: Icon(TablerIcons.camera),
|
|
trailing: Switch(
|
|
value: poShowCamera,
|
|
onChanged: (bool value) {
|
|
InvenTreeSettingsManager().setValue(INV_PO_SHOW_CAMERA, value);
|
|
setState(() {
|
|
poShowCamera = value;
|
|
});
|
|
},
|
|
),
|
|
),
|
|
ListTile(
|
|
title: Text(L10().purchaseOrderConfirmScan),
|
|
subtitle: Text(L10().purchaseOrderConfirmScanDetail),
|
|
leading: Icon(TablerIcons.barcode),
|
|
trailing: Switch (
|
|
value: poConfirmScan,
|
|
onChanged: (bool value) {
|
|
InvenTreeSettingsManager().setValue(INV_PO_CONFIRM_SCAN, value);
|
|
setState(() {
|
|
poConfirmScan = value;
|
|
});
|
|
},
|
|
),
|
|
)
|
|
]
|
|
)
|
|
)
|
|
);
|
|
}
|
|
} |