mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Improve form spacing
This commit is contained in:
parent
29c92cd00e
commit
1896b71533
2 changed files with 18 additions and 2 deletions
|
|
@ -616,6 +616,8 @@ class _APIFormWidgetState extends State<APIFormWidget> {
|
|||
|
||||
_APIFormWidgetState(this.title, this.url, this.fields, this.method, this.onSuccess) : super();
|
||||
|
||||
bool spacerRequired = false;
|
||||
|
||||
List<Widget> _buildForm() {
|
||||
|
||||
List<Widget> widgets = [];
|
||||
|
|
@ -626,6 +628,18 @@ class _APIFormWidgetState extends State<APIFormWidget> {
|
|||
continue;
|
||||
}
|
||||
|
||||
// Add divider before some widgets
|
||||
if (spacerRequired) {
|
||||
switch (field.type) {
|
||||
case "related field":
|
||||
case "choice":
|
||||
widgets.add(Divider(height: 15));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
widgets.add(field.constructField());
|
||||
|
||||
if (field.hasErrors()) {
|
||||
|
|
@ -649,9 +663,11 @@ class _APIFormWidgetState extends State<APIFormWidget> {
|
|||
switch (field.type) {
|
||||
case "related field":
|
||||
case "choice":
|
||||
widgets.add(Divider(height: 10));
|
||||
widgets.add(Divider(height: 15));
|
||||
spacerRequired = false;
|
||||
break;
|
||||
default:
|
||||
spacerRequired = true;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ description: InvenTree stock management
|
|||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||
# Read more about iOS versioning at
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
version: 0.4.3+25
|
||||
version: 0.4.5+26
|
||||
|
||||
environment:
|
||||
sdk: ">=2.12.0 <3.0.0"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue