title static method

Widget title(
  1. BuildContext context,
  2. AppModel app,
  3. String componentName,
  4. String componentId,
)

Implementation

static Widget title(BuildContext context, AppModel app, String componentName,
    String componentId) {
  var componentConstructor =
      Registry.registry()!.registryMap()[componentName];
  if (componentConstructor != null) {
    return FutureBuilder<dynamic>(
        future: componentConstructor.getModel(app: app, id: componentId),
        builder: (context, snapshot) {
          if (snapshot.hasData) {
            var model = snapshot.data;
            var descr = (model.description ?? componentId);
            return text(app, context, '$componentName-$descr');
          } else {
            return Container();
          }
        });
  } else {
    return text(app, context, '?');
  }
}