mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-12 02:05:29 +00:00
UX Overhaul (#300)
* Add "global actions" to title bar * Implement actions * Add "speed dial" action buttons * tweak global action icons * Refactor actions for "stock item" display * Refactor "part" detail * part category * SupplierPart * More updates * Add BottomAppBar * Add a global bottom app bar * Move "edit" buttons back to the app bar * tweaks * Updates to drawer navigation menu * home screen improvements * text tweaks * Fix appBarTitle for notifications widget * Update "tabs" for category display * Fix for attachment widget * Update tabs for purchaseorder view * Update part display * Cleanup * Add "BOM" tab to part detail widget * Paginated list search cleanup * Update release notes * Update old function * linting * linting * Tweaks to bottomappbar - Increase icon size slightly - Adjust "actions" icon
This commit is contained in:
@ -43,33 +43,35 @@ class _AttachmentWidgetState extends RefreshableState<AttachmentWidget> {
|
||||
List<InvenTreeAttachment> attachments = [];
|
||||
|
||||
@override
|
||||
String getAppBarTitle(BuildContext context) => L10().attachments;
|
||||
String getAppBarTitle() => L10().attachments;
|
||||
|
||||
@override
|
||||
List<Widget> getAppBarActions(BuildContext context) {
|
||||
List<Widget> appBarActions(BuildContext context) {
|
||||
if (!widget.hasUploadPermission) return [];
|
||||
|
||||
List<Widget> actions = [];
|
||||
|
||||
if (widget.hasUploadPermission) {
|
||||
// File upload
|
||||
actions.add(
|
||||
IconButton(
|
||||
icon: FaIcon(FontAwesomeIcons.circlePlus),
|
||||
onPressed: () async {
|
||||
FilePickerDialog.pickFile(
|
||||
onPicked: (File file) async {
|
||||
await upload(context, file);
|
||||
}
|
||||
);
|
||||
},
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return actions;
|
||||
return [
|
||||
IconButton(
|
||||
icon: FaIcon(FontAwesomeIcons.camera),
|
||||
onPressed: () async {
|
||||
FilePickerDialog.pickImageFromCamera().then((File? file) {
|
||||
upload(context, file);
|
||||
});
|
||||
}
|
||||
),
|
||||
IconButton(
|
||||
icon: FaIcon(FontAwesomeIcons.fileArrowUp),
|
||||
onPressed: () async {
|
||||
FilePickerDialog.pickFileFromDevice().then((File? file) {
|
||||
upload(context, file);
|
||||
});
|
||||
}
|
||||
)
|
||||
];
|
||||
}
|
||||
|
||||
Future<void> upload(BuildContext context, File file) async {
|
||||
Future<void> upload(BuildContext context, File? file) async {
|
||||
|
||||
if (file == null) return;
|
||||
|
||||
showLoadingOverlay(context);
|
||||
final bool result = await widget.attachment.uploadAttachment(file, widget.referenceId);
|
||||
|
Reference in New Issue
Block a user