Mobile Client: Action form: add static description

This commit is contained in:
Arthi-chaud
2022-02-25 10:24:18 +01:00
parent 1fffd8d3c3
commit a2081aab15
4 changed files with 15 additions and 6 deletions
+3 -3
View File
@@ -523,7 +523,7 @@
249021D3217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
defaultConfigurationName = Debug;
};
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
isa = XCConfigurationList;
@@ -533,9 +533,9 @@
249021D4217E4FDB00AE95B9 /* Profile */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
defaultConfigurationName = Debug;
};
/* End XCConfigurationList section */
};
rootObject = 97C146E61CF9000F007C117D /* Project object */;
}
}
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
LastUpgradeVersion = "1320"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
+7 -2
View File
@@ -66,6 +66,9 @@ class _SetupActionPageState extends State<SetupActionPage> {
}).toList(),
);
var cardShape = const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(10)));
return AerisCardPage(
body: Padding(
padding: const EdgeInsets.only(bottom: 20, left: 10, right: 10),
@@ -101,7 +104,7 @@ class _SetupActionPageState extends State<SetupActionPage> {
const SizedBox(height: 30),
if (availableActions == null)
SkeletonLoader(
builder: const Card(child: SizedBox(height: 40), elevation: 5),
builder: Card(shape: cardShape, child: const SizedBox(height: 40), elevation: 5),
items: 10,
highlightColor: Theme.of(context).colorScheme.secondary
)
@@ -109,7 +112,8 @@ class _SetupActionPageState extends State<SetupActionPage> {
...[for (aeris.Action availableAction in availableActions!)
Card(
elevation: 5,
child: ExpandablePanel(
shape: cardShape,
child: ExpandablePanel(
header: Padding(
padding:
const EdgeInsets.only(left: 30, top: 20, bottom: 20),
@@ -119,6 +123,7 @@ class _SetupActionPageState extends State<SetupActionPage> {
expanded: Padding(
padding: const EdgeInsets.all(20),
child: ActionForm(
description: "This is the action's very very very very long description", ///TODO Find actual description
name: availableAction.name,
parametersNames:
availableAction.parameters.keys.toList(),
+4
View File
@@ -11,6 +11,8 @@ class ActionForm extends StatefulWidget {
final List<String> parametersNames;
/// Initial values of the fields
final Map<String, Object> initValues;
/// What the action does
final String description;
/// On validate callback
final void Function(Map<String, String>) onValidate;
@@ -18,6 +20,7 @@ class ActionForm extends StatefulWidget {
const ActionForm(
{Key? key,
required this.name,
required this.description,
required this.parametersNames,
required this.onValidate,
this.initValues = const {}})
@@ -36,6 +39,7 @@ class _ActionFormState extends State<ActionForm> {
key: _formKey,
child: Column(
children: [
Text(widget.description, textAlign: TextAlign.left, style: TextStyle(color: Theme.of(context).colorScheme.onSurface)),
...widget.parametersNames.map((name) => FormBuilderTextField(
initialValue: (widget.initValues.containsKey(name)) ? widget.initValues[name] as String : null,
name: name,