mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-18 05:05:28 +00:00
Format code
This commit is contained in:
@ -5,7 +5,6 @@ import "package:inventree/widget/refreshable_state.dart";
|
||||
import "package:flutter_markdown/flutter_markdown.dart";
|
||||
import "package:inventree/l10.dart";
|
||||
|
||||
|
||||
/*
|
||||
* A widget for displaying the notes associated with a given model.
|
||||
* We need to pass in the following parameters:
|
||||
@ -14,7 +13,6 @@ import "package:inventree/l10.dart";
|
||||
* - Title for the app bar
|
||||
*/
|
||||
class NotesWidget extends StatefulWidget {
|
||||
|
||||
const NotesWidget(this.model, {Key? key}) : super(key: key);
|
||||
|
||||
final InvenTreeModel model;
|
||||
@ -23,12 +21,10 @@ class NotesWidget extends StatefulWidget {
|
||||
_NotesState createState() => _NotesState();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class representing the state of the NotesWidget
|
||||
*/
|
||||
class _NotesState extends RefreshableState<NotesWidget> {
|
||||
|
||||
_NotesState();
|
||||
|
||||
@override
|
||||
@ -41,30 +37,21 @@ class _NotesState extends RefreshableState<NotesWidget> {
|
||||
|
||||
@override
|
||||
List<Widget> appBarActions(BuildContext context) {
|
||||
|
||||
List<Widget> actions = [];
|
||||
|
||||
if (widget.model.canEdit) {
|
||||
actions.add(
|
||||
IconButton(
|
||||
actions.add(IconButton(
|
||||
icon: Icon(TablerIcons.edit),
|
||||
tooltip: L10().edit,
|
||||
onPressed: () {
|
||||
widget.model.editForm(
|
||||
context,
|
||||
L10().editNotes,
|
||||
fields: {
|
||||
"notes": {
|
||||
"multiline": true,
|
||||
}
|
||||
},
|
||||
onSuccess: (data) async {
|
||||
refresh(context);
|
||||
widget.model.editForm(context, L10().editNotes, fields: {
|
||||
"notes": {
|
||||
"multiline": true,
|
||||
}
|
||||
);
|
||||
}
|
||||
)
|
||||
);
|
||||
}, onSuccess: (data) async {
|
||||
refresh(context);
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
return actions;
|
||||
@ -77,5 +64,4 @@ class _NotesState extends RefreshableState<NotesWidget> {
|
||||
data: widget.model.notes,
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user