2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-15 11:45:31 +00:00

Refactor modal form into a new stateful widget

This commit is contained in:
Oliver
2021-07-22 17:49:43 +10:00
parent 885df45138
commit 64aed4b31a
3 changed files with 126 additions and 88 deletions

View File

@ -19,6 +19,7 @@ import 'package:inventree/widget/spinner.dart';
import 'package:inventree/widget/drawer.dart';
class InvenTreeHomePage extends StatefulWidget {
InvenTreeHomePage({Key? key}) : super(key: key);
@override

View File

@ -60,7 +60,9 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
IconButton(
icon: FaIcon(FontAwesomeIcons.edit),
tooltip: L10().edit,
onPressed: _editPartDialog,
onPressed: () {
_editPartDialog(context);
},
)
);
}
@ -170,7 +172,7 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
);
}
void _editPartDialog() {
void _editPartDialog(BuildContext context) {
// Values which can be edited
var _name;
@ -180,6 +182,7 @@ class _PartDisplayState extends RefreshableState<PartDetailWidget> {
var _link;
launchApiForm(
context,
L10().editPart,
part.url,
{