I'm building a mobile front-end to an existing (very complex) web application - and Flutterflow has saved me a ton of time (although I do worry about long-term maintainability).
However, there's one feature that I'm really struggling to find a good way to implement.
In the main application, we have a form builder - the admins at a customer can design their own forms, with multiple sections (some of which can be repeating), each section containing a number of questions. We currently have 25 different types of question - from simple ones like a text or rich text field, date field - to more app-specific ones like "which user does this belong to" or "which folder is this about".
Luckily, most of the question types can use a single API endpoint to record their answers, so that's pretty simple. But each type of question needs its own component/widget (as you can imagine, the UI for recording a signature is very different to the one for recording your geolocation).
My first stab at building this involved creating a FormValueEditor component in Flutterflow - it makes the API call to get the form contents from the server and then is basically one giant ConditionalBuilder. It looks at each question's question_type field, matching one of the conditions in the ConditionalBuilder which show/hides the relevant editor component - a FormValueTextEditor or FormValueSignatureEditor or whatever.
However, as you can imagine, this ConditionalBuilder is pretty unwieldy.
So I was wondering if there was a better way.
In other languages (or in pure Dart/Flutter) I would probably create a Map/Hash object that links each question type string to the relevant widget class - then the FormValueEditor does a lookup and dynamically creates and inserts the correct widget into the page.
But I don't think that's possible with Flutterflow.
My other thought was to build a custom set of widgets in Flutter/Dart and import them - but I'm a bit worried about getting the interface between the two.
Any thoughts on the best way to approach this?