From a2081aab15f3279b03bc935601fc6c98ea684c92 Mon Sep 17 00:00:00 2001 From: Arthi-chaud Date: Fri, 25 Feb 2022 10:24:18 +0100 Subject: [PATCH] Mobile Client: Action form: add static description --- mobile/ios/Runner.xcodeproj/project.pbxproj | 6 +++--- .../xcshareddata/xcschemes/Runner.xcscheme | 2 +- mobile/lib/src/views/setup_action_page.dart | 9 +++++++-- mobile/lib/src/widgets/action_form.dart | 4 ++++ 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/mobile/ios/Runner.xcodeproj/project.pbxproj b/mobile/ios/Runner.xcodeproj/project.pbxproj index 5ee3094..b95f859 100644 --- a/mobile/ios/Runner.xcodeproj/project.pbxproj +++ b/mobile/ios/Runner.xcodeproj/project.pbxproj @@ -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 */; -} \ No newline at end of file +} diff --git a/mobile/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/mobile/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index c87d15a..6dd6010 100644 --- a/mobile/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/mobile/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ { }).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 { 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 { ...[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 { 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(), diff --git a/mobile/lib/src/widgets/action_form.dart b/mobile/lib/src/widgets/action_form.dart index 3370993..ca7aea4 100644 --- a/mobile/lib/src/widgets/action_form.dart +++ b/mobile/lib/src/widgets/action_form.dart @@ -11,6 +11,8 @@ class ActionForm extends StatefulWidget { final List parametersNames; /// Initial values of the fields final Map initValues; + /// What the action does + final String description; /// On validate callback final void Function(Map) 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 { 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,