createObject method Null safety

  1. @Operation()
Future<Response> createObject()

Implementation

@Operation.post()
Future<Response> createObject() async {
  final instance = _query!.entity.instanceOf() as InstanceType;
  instance.readFromMap(request!.body.as());
  _query!.values = instance;

  _query = await willInsertObjectWithQuery(_query);
  InstanceType result = (await _query?.insert())!;

  return didInsertObject(result);
}