getWidgetView static method

WidgetView? getWidgetView(
  1. String name,
  2. String key,
  3. String label,
  4. Map? properties,
)

Implementation

static WidgetView? getWidgetView(
    String name, String key, String label, Map? properties) {
  WidgetView? rtn;
  if (name == 'TextInput') {
    /*TextFormField widget = TextFormField(
      key: Key(key),
      controller: TextEditingController(),
      decoration: InputDecoration(labelText:label,hintText:label),
    );
    */
    TextFormField widget = InvokableTextFormField(
      key: Key(key),
      controller: TextEditingController(),
      decoration: InputDecoration(labelText: label, hintText: label),
    );
    rtn = WidgetView(widget, properties);
  } else if (name == 'Button') {
    rtn = WidgetView(
        TextButton(key: Key(key), onPressed: () {}, child: Text(label)),
        properties);
  } else if (name == 'Text') {
    rtn = WidgetView(
        InvokableText(TextController(label), key: Key(key)), properties);
  }
  return rtn;
}