ofMSchemaFuture<T extends MModel> static method

Future<MSchemaForm<T>> ofMSchemaFuture<T extends MModel>(
  1. BuildContext context,
  2. T model, {
  3. MSchemaRef? mtype,
  4. Map<JsonPath, FormFieldValidator>? validators,
})

Implementation

static Future<MSchemaForm<T>> ofMSchemaFuture<T extends MModel>(
  BuildContext context,
  T model, {
  MSchemaRef? mtype,
  Map<JsonPath, FormFieldValidator>? validators,
}) async {
  assert(mtype != null);
  final definition =
      await context.mschemaService.getSchema(mtype ?? model.mtype);
  return MSchemaForm<T>(context, model, definition.asEntitySchema(),
      validators: validators);
}