mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-13 10:45:29 +00:00
Order picture action (#557)
* Add "take picture" to purchase order detail * Rename uploaded images * Provide prefix when uploading images * Add similar functionality for "sales order" detail * Add new settings screens * Control camera shortcut * Bump release notes
This commit is contained in:
79
lib/settings/sales_order_settings.dart
Normal file
79
lib/settings/sales_order_settings.dart
Normal file
@ -0,0 +1,79 @@
|
||||
|
||||
import "package:flutter/material.dart";
|
||||
import "package:flutter_tabler_icons/flutter_tabler_icons.dart";
|
||||
|
||||
import "package:inventree/l10.dart";
|
||||
import "package:inventree/preferences.dart";
|
||||
|
||||
|
||||
class InvenTreeSalesOrderSettingsWidget extends StatefulWidget {
|
||||
@override
|
||||
_InvenTreeSalesOrderSettingsState createState() => _InvenTreeSalesOrderSettingsState();
|
||||
}
|
||||
|
||||
|
||||
class _InvenTreeSalesOrderSettingsState extends State<InvenTreeSalesOrderSettingsWidget> {
|
||||
|
||||
_InvenTreeSalesOrderSettingsState();
|
||||
|
||||
bool soEnable = true;
|
||||
bool soShowCamera = true;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
loadSettings();
|
||||
}
|
||||
|
||||
Future<void> loadSettings() async {
|
||||
soEnable = await InvenTreeSettingsManager().getBool(INV_SO_ENABLE, true);
|
||||
soShowCamera = await InvenTreeSettingsManager().getBool(INV_SO_SHOW_CAMERA, true);
|
||||
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: Text(L10().salesOrderSettings)),
|
||||
body: Container(
|
||||
child: ListView(
|
||||
children: [
|
||||
ListTile(
|
||||
title: Text(L10().salesOrderEnable),
|
||||
subtitle: Text(L10().salesOrderEnableDetail),
|
||||
leading: Icon(TablerIcons.shopping_cart),
|
||||
trailing: Switch(
|
||||
value: soEnable,
|
||||
onChanged: (bool value) {
|
||||
InvenTreeSettingsManager().setValue(INV_SO_ENABLE, value);
|
||||
setState(() {
|
||||
soEnable = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: Text(L10().salesOrderShowCamera),
|
||||
subtitle: Text(L10().salesOrderShowCameraDetail),
|
||||
leading: Icon(TablerIcons.camera),
|
||||
trailing: Switch(
|
||||
value: soShowCamera,
|
||||
onChanged: (bool value) {
|
||||
InvenTreeSettingsManager().setValue(INV_SO_SHOW_CAMERA, value);
|
||||
setState(() {
|
||||
soShowCamera = value;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
]
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user