-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
- Loading branch information
1 parent
4698e7e
commit 2e798b1
Showing
14 changed files
with
321 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 InvenTreePurchaseOrderSettingsWidget extends StatefulWidget { | ||
@override | ||
_InvenTreePurchaseOrderSettingsState createState() => _InvenTreePurchaseOrderSettingsState(); | ||
} | ||
|
||
|
||
class _InvenTreePurchaseOrderSettingsState extends State<InvenTreePurchaseOrderSettingsWidget> { | ||
|
||
_InvenTreePurchaseOrderSettingsState(); | ||
|
||
bool poEnable = true; | ||
bool poShowCamera = 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); | ||
|
||
if (mounted) { | ||
setState(() { | ||
}); | ||
} | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar(title: Text(L10().purchaseOrderSettings)), | ||
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; | ||
}); | ||
}, | ||
), | ||
), | ||
] | ||
) | ||
) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
}); | ||
}, | ||
), | ||
), | ||
] | ||
) | ||
) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.