mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-13 18:55:34 +00:00
More refactoring
Helper function to display a scrollable form in a dialog
This commit is contained in:
@ -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