mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-12 02:05: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:
@ -26,11 +26,12 @@ import "package:inventree/widget/refreshable_state.dart";
|
||||
*/
|
||||
class AttachmentWidget extends StatefulWidget {
|
||||
|
||||
const AttachmentWidget(this.attachmentClass, this.modelId, this.hasUploadPermission) : super();
|
||||
const AttachmentWidget(this.attachmentClass, this.modelId, this.imagePrefix, this.hasUploadPermission) : super();
|
||||
|
||||
final InvenTreeAttachment attachmentClass;
|
||||
final int modelId;
|
||||
final bool hasUploadPermission;
|
||||
final String imagePrefix;
|
||||
|
||||
@override
|
||||
_AttachmentWidgetState createState() => _AttachmentWidgetState();
|
||||
@ -54,6 +55,10 @@ class _AttachmentWidgetState extends RefreshableState<AttachmentWidget> {
|
||||
IconButton(
|
||||
icon: Icon(TablerIcons.camera),
|
||||
onPressed: () async {
|
||||
widget.attachmentClass.uploadImage(
|
||||
widget.modelId,
|
||||
prefix: widget.imagePrefix,
|
||||
);
|
||||
FilePickerDialog.pickImageFromCamera().then((File? file) {
|
||||
upload(context, file);
|
||||
});
|
||||
@ -78,7 +83,6 @@ class _AttachmentWidgetState extends RefreshableState<AttachmentWidget> {
|
||||
|
||||
final bool result = await widget.attachmentClass.uploadAttachment(
|
||||
file,
|
||||
widget.attachmentClass.REF_MODEL_TYPE,
|
||||
widget.modelId
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user