mirror of
https://github.com/inventree/inventree-app.git
synced 2026-10-08 08:07:09 +00:00
More refactoring
Helper function to display a scrollable form in a dialog
This commit is contained in:
1 parent
e8a4a387ea
commit
af104717ab
2 files changed
+162
-108
No files matched your search
@@ -38,4 +38,27 @@ void showProgressDialog(BuildContext context, String title, String description)
|
||||
|
||||
void hideProgressDialog(BuildContext context) {
|
||||
Navigator.pop(context);
|
||||
}
|
||||
|
||||
void showFormDialog(BuildContext context, String title, {GlobalKey<FormState> key, List<Widget> fields, List<Widget> actions}) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
title: Text(title),
|
||||
actions: actions,
|
||||
content: Form(
|
||||
key: key,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: fields
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user